diff options
author | billwanjohi <kaguru@gmail.com> | 2015-06-23 18:31:48 +0000 |
---|---|---|
committer | billwanjohi <kaguru@gmail.com> | 2015-06-23 18:42:30 +0000 |
commit | 33533eb1560ded3de4f2402c0d2c076c09bad088 (patch) | |
tree | 47be9e8d5fb297cfcb97c870d543d9715a65d784 | |
parent | 165abd15271e930129534e1f9b36ab31a6ee77f5 (diff) | |
download | ansible-modules-core-33533eb1560ded3de4f2402c0d2c076c09bad088.tar.gz |
iam: use modern helper to allow sts
previous implementation ignored the session token when present
-rw-r--r-- | cloud/amazon/iam.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/cloud/amazon/iam.py b/cloud/amazon/iam.py index a7d0fbee..d2807a23 100644 --- a/cloud/amazon/iam.py +++ b/cloud/amazon/iam.py @@ -565,13 +565,10 @@ def main(): module.fail_json(changed=False, msg="iam_type: role, cannot currently be updated, " "please specificy present or absent") - 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)) |