Class: AWSCosts::Region

Inherits:
Object
  • Object
show all
Defined in:
lib/awscosts/region.rb

Constant Summary collapse

SUPPORTED =
{
  'us-east-1' => { :full_name => 'US (Northern Virginia)', :price_mapping => 'us-east-1', :emr_mapping => 'us-east' },
  'us-west-1' => { :full_name => 'US (Northern California)', :price_mapping => 'us-west-1', :emr_mapping => 'us-west' },
  'us-west-2' => { :full_name => 'US (Oregon)', :price_mapping => 'us-west-2', :emr_mapping => 'us-west-2' },
  'eu-west-1' => { :full_name => 'EU (Ireland)', :price_mapping => 'eu-west-1', :emr_mapping => 'eu-ireland' },
  'eu-central-1' => { :full_name => 'EU (Frankfurt)' },
  'ap-southeast-1' => { :full_name => 'Asia Pacific (Singapore)', :price_mapping => 'ap-southeast-1', :emr_mapping => 'apac-sin' },
  'ap-southeast-2' => { :full_name => 'Asia Pacific (Sydney)', :price_mapping => 'ap-southeast-2', :emr_mapping => 'apac-syd' },
  'ap-northeast-1' => { :full_name => 'Asia Pacific (Tokyo)', :price_mapping => 'ap-northeast-1', :emr_mapping => 'apac-tokyo' },
  'sa-east-1' => { :full_name => 'South America (Sao Paulo)', :price_mapping => 'sa-east-1', :emr_mapping => 'sa-east-1' }
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#emr_mappingObject (readonly)

Returns the value of attribute emr_mapping.



4
5
6
# File 'lib/awscosts/region.rb', line 4

def emr_mapping
  @emr_mapping
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



4
5
6
# File 'lib/awscosts/region.rb', line 4

def full_name
  @full_name
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/awscosts/region.rb', line 4

def name
  @name
end

#price_mappingObject (readonly)

Returns the value of attribute price_mapping.



4
5
6
# File 'lib/awscosts/region.rb', line 4

def price_mapping
  @price_mapping
end

Class Method Details

.find(name) ⇒ Object



18
19
20
# File 'lib/awscosts/region.rb', line 18

def self.find name
  SUPPORTED[name] ? self.new(name) : nil
end

Instance Method Details

#ec2Object



23
24
25
# File 'lib/awscosts/region.rb', line 23

def ec2
  AWSCosts::EC2.new(self)
end

#emrObject



27
28
29
# File 'lib/awscosts/region.rb', line 27

def emr
  AWSCosts::EMR.fetch(self.emr_mapping)
end

#s3Object



31
32
33
# File 'lib/awscosts/region.rb', line 31

def s3
  AWSCosts::S3.new(self)
end