From 92f88a4cb47756079f7280761fd4bdcf498ee695 Mon Sep 17 00:00:00 2001 From: Shayne Clausson Date: Mon, 28 Sep 2015 19:50:02 +0200 Subject: [PATCH] Replaces 'old' get_ec2_creds connection method with get_aws_connection_info to support passing in security_token for temporary creds. --- lib/ansible/modules/cloud/amazon/iam_cert.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/iam_cert.py b/lib/ansible/modules/cloud/amazon/iam_cert.py index 1f58be753c8..53b2368bd30 100644 --- a/lib/ansible/modules/cloud/amazon/iam_cert.py +++ b/lib/ansible/modules/cloud/amazon/iam_cert.py @@ -241,13 +241,10 @@ def main(): if not HAS_BOTO: 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: - iam = boto.iam.connection.IAMConnection( - aws_access_key_id=aws_access_key, - aws_secret_access_key=aws_secret_key, - ) + iam = boto.iam.connection.IAMConnection(**aws_connect_kwargs) except boto.exception.NoAuthHandlerFound, e: module.fail_json(msg=str(e))