Replaces 'old' get_ec2_creds connection method with get_aws_connection_info to support passing in security_token for temporary creds.

This commit is contained in:
Shayne Clausson 2015-09-28 19:50:02 +02:00 committed by Matt Clay
parent f91cc1d3e5
commit 92f88a4cb4

View file

@ -241,13 +241,10 @@ def main():
if not HAS_BOTO: if not HAS_BOTO:
module.fail_json(msg="Boto is required for this module") module.fail_json(msg="Boto is required for this module")
ec2_url, aws_access_key, aws_secret_key, region = get_ec2_creds(module) region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module)
try: try:
iam = boto.iam.connection.IAMConnection( iam = boto.iam.connection.IAMConnection(**aws_connect_kwargs)
aws_access_key_id=aws_access_key,
aws_secret_access_key=aws_secret_key,
)
except boto.exception.NoAuthHandlerFound, e: except boto.exception.NoAuthHandlerFound, e:
module.fail_json(msg=str(e)) module.fail_json(msg=str(e))