mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
Change standard AWS access and secret key parameter names to aws_access_key and aws_secret_key. Fixes an authentication problem with the rds module and standardizes the naming convention on something more encompassing than ec2_*_key.
This commit is contained in:
parent
3f2f5fec0a
commit
baf508a379
9 changed files with 55 additions and 53 deletions
|
@ -8,22 +8,31 @@ AWS_REGIONS = ['ap-northeast-1',
|
|||
'us-west-2']
|
||||
|
||||
|
||||
def ec2_argument_spec():
|
||||
def ec2_argument_keys_spec():
|
||||
return dict(
|
||||
region=dict(aliases=['aws_region', 'ec2_region'], choices=AWS_REGIONS),
|
||||
ec2_url=dict(),
|
||||
ec2_secret_key=dict(aliases=['aws_secret_key', 'secret_key'], no_log=True),
|
||||
ec2_access_key=dict(aliases=['aws_access_key', 'access_key']),
|
||||
aws_secret_key=dict(aliases=['ec2_secret_key', 'secret_key'], no_log=True),
|
||||
aws_access_key=dict(aliases=['ec2_access_key', 'access_key']),
|
||||
)
|
||||
|
||||
|
||||
def ec2_argument_spec():
|
||||
spec = ec2_argument_keys_spec()
|
||||
spec.update(
|
||||
dict(
|
||||
region=dict(aliases=['aws_region', 'ec2_region'], choices=AWS_REGIONS),
|
||||
ec2_url=dict(),
|
||||
)
|
||||
)
|
||||
return spec
|
||||
|
||||
|
||||
def get_ec2_creds(module):
|
||||
|
||||
# Check module args for credentials, then check environment vars
|
||||
|
||||
ec2_url = module.params.get('ec2_url')
|
||||
ec2_secret_key = module.params.get('ec2_secret_key')
|
||||
ec2_access_key = module.params.get('ec2_access_key')
|
||||
ec2_secret_key = module.params.get('aws_secret_key')
|
||||
ec2_access_key = module.params.get('aws_access_key')
|
||||
region = module.params.get('region')
|
||||
|
||||
if not ec2_url:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue