Class: BBC::Cosmos::Config::AWS
- Inherits:
-
Object
- Object
- BBC::Cosmos::Config::AWS
- Defined in:
- lib/bbc/cosmos/config/aws.rb
Instance Method Summary collapse
-
#initialize(ec2, s3) ⇒ AWS
constructor
A new instance of AWS.
- #instance_id ⇒ Object
- #region ⇒ Object
- #s3_config(config) ⇒ Object
- #s3_config_location ⇒ Object
- #tags ⇒ Object
Constructor Details
#initialize(ec2, s3) ⇒ AWS
Returns a new instance of AWS.
5 6 7 8 |
# File 'lib/bbc/cosmos/config/aws.rb', line 5 def initialize(ec2, s3) @ec2 = ec2 @s3 = s3 end |
Instance Method Details
#instance_id ⇒ Object
18 19 20 |
# File 'lib/bbc/cosmos/config/aws.rb', line 18 def instance_id @instance_id ||= BBC::Cosmos.production? ? aws_instance_id : "instance_id" end |
#region ⇒ Object
14 15 16 |
# File 'lib/bbc/cosmos/config/aws.rb', line 14 def region @region ||= ::AWS.config.region end |
#s3_config(config) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/bbc/cosmos/config/aws.rb', line 26 def s3_config(config) path = [ config[:configuration][:config_path], config[:environment], 'config', config[:configuration][:commit], "#{s3_config_location}.json" ].join('/') JSON.parse(@s3.buckets[config[:component_resources_bucket]].objects[path].read, :symbolize_names => true) end |
#s3_config_location ⇒ Object
22 23 24 |
# File 'lib/bbc/cosmos/config/aws.rb', line 22 def s3_config_location ['AppName'] end |
#tags ⇒ Object
10 11 12 |
# File 'lib/bbc/cosmos/config/aws.rb', line 10 def @tags ||= instance. end |