This repository was archived by the owner on Feb 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 572
This repository was archived by the owner on Feb 11, 2022. It is now read-only.
config.rb:574:in read_aws_files': undefined method []' #521
Copy link
Copy link
Open
Description
looks like the problem is when using aws_profile in the Vagrantfile. when setting up aws configure, mine did not come out as profile nonprod but rather just nonprod so I'm forced to put my Access Key & Access Key ID instead which I can't do for security reasons.
rather than making new aws configs just so this plugin works, I think this section should be changed
# determine section in config ini file
if profile == 'default'
ini_profile = profile
else
ini_profile = 'profile ' + profile
end
# get info from config ini file for selected profile
data = File.read(aws_config)
doc_cfg = IniParse.parse(data)possibly to:
# get info from config ini file for selected profile
data = File.read(aws_config)
doc_cfg = IniParse.parse(data)
# determine section in config ini file
if profile == 'default' || !doc_cfg[profile].nil?
ini_profile = profile
else
ini_profile = 'profile ' + profile
endOR
# determine section in config ini file
if profile == 'default'
ini_profile = profile
else
ini_profile = 'profile ' + profile
end
# get info from config ini file for selected profile
data = File.read(aws_config)
doc_cfg = IniParse.parse(data)
aws_region = doc_cfg[ini_profile]['region']
# determine section in credentials ini file
ini_profile = profile
# get info from credentials ini file for selected profile
data = File.read(aws_creds)
doc_cfg = IniParse.parse(data)
aws_id = doc_cfg[ini_profile]['aws_access_key_id']
aws_secret = doc_cfg[ini_profile]['aws_secret_access_key']
aws_token = doc_cfg[ini_profile]['aws_session_token']to:
# determine section in credentials ini file
ini_profile = profile
# get info from credentials ini file for selected profile
data = File.read(aws_creds)
doc_cfg = IniParse.parse(data)
aws_region = doc_cfg[ini_profile]['region']
aws_id = doc_cfg[ini_profile]['aws_access_key_id']
aws_secret = doc_cfg[ini_profile]['aws_secret_access_key']
aws_token = doc_cfg[ini_profile]['aws_session_token']not sure which would work better, but both fix my issue.
camdunne, NiniGeek, gabrielg, kidharb, jhkrischel and 2 more
Metadata
Metadata
Assignees
Labels
No labels