Skip to content

Commit

Permalink
iam: use modern helper to allow sts
Browse files Browse the repository at this point in the history
previous implementation ignored the session token when present
  • Loading branch information
billwanjohi authored and mattclay committed Dec 8, 2016
1 parent 5cd3c6e commit 86e679f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/ansible/modules/cloud/amazon/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,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))

Expand Down

0 comments on commit 86e679f

Please sign in to comment.