Class: OpsWorks::Config
- Inherits:
-
Object
- Object
- OpsWorks::Config
- Defined in:
- lib/opsworks/config.rb
Instance Attribute Summary collapse
-
#ssh_user_name ⇒ Object
readonly
Returns the value of attribute ssh_user_name.
-
#stacks ⇒ Object
readonly
Returns the value of attribute stacks.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/opsworks/config.rb', line 11 def initialize file = ENV["AWS_CONFIG_FILE"] || "#{ENV['HOME']}/.aws/config" raise "AWS config file not found" unless File.exists? file ini = IniFile.load(file) aws_config = ini['default'] AWS.config( access_key_id: aws_config["aws_access_key_id"], secret_access_key: aws_config["aws_secret_access_key"], ) @stacks = ini['opsworks']['stack-id'].split(',').map(&:strip) @ssh_user_name = ini['opsworks']['ssh-user-name'].strip end |
Instance Attribute Details
#ssh_user_name ⇒ Object (readonly)
Returns the value of attribute ssh_user_name.
9 10 11 |
# File 'lib/opsworks/config.rb', line 9 def ssh_user_name @ssh_user_name end |
#stacks ⇒ Object (readonly)
Returns the value of attribute stacks.
9 10 11 |
# File 'lib/opsworks/config.rb', line 9 def stacks @stacks end |