Class: Bog::Initializer::AWS
- Inherits:
-
Bog::Initializer
- Object
- Bog::Initializer
- Bog::Initializer::AWS
- Defined in:
- lib/bog/initializer/aws.rb
Instance Method Summary collapse
-
#initialize(profile, options) ⇒ AWS
constructor
A new instance of AWS.
Constructor Details
#initialize(profile, options) ⇒ AWS
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bog/initializer/aws.rb', line 4 def initialize(profile, ) @access_key_id = get_input('Enter your AWS access key id:') @secret_access_key = get_input('Enter your AWS secret access key:') @region = get_input('Enter your default region (e.g. us-east-1):') plugin_directory = File.join(profile.path, '.aws') Dir.mkdir(plugin_directory) unless File.directory?(plugin_directory) file = File.open(File.join(plugin_directory, 'config'), 'w') file.write("[default]\n") file.write("aws_access_key_id=#{@access_key_id}\n") file.write("aws_secret_access_key=#{@secret_access_key}\n") file.write("region=#{@region}\n") file.close end |