mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
credential keys now actually work when set via env
all credential keys are converted to uppercase, dashes replaced with underscores and prefixed with 'AWS_'
This commit is contained in:
parent
71adb3d04e
commit
c62dcccd8d
1 changed files with 5 additions and 2 deletions
|
@ -20,9 +20,12 @@ class GetCredentials(Task):
|
|||
for key in keys:
|
||||
creds[key] = manifest.credentials[key]
|
||||
return creds
|
||||
if all(getenv(key) is not None for key in keys):
|
||||
|
||||
def env_key(key):
|
||||
return ('aws-'+key).upper().replace('-', '_')
|
||||
if all(getenv(env_key(key)) is not None for key in keys):
|
||||
for key in keys:
|
||||
creds[key] = getenv(key)
|
||||
creds[key] = getenv(env_key(key))
|
||||
return creds
|
||||
raise RuntimeError(('No ec2 credentials found, they must all be specified '
|
||||
'exclusively via environment variables or through the manifest.'))
|
||||
|
|
Loading…
Add table
Reference in a new issue