iam: use modern helper to allow sts

previous implementation ignored the session token when present
pull/18777/head
billwanjohi 10 years ago committed by Matt Clay
parent 5cd3c6ebe6
commit 86e679fe3c

@ -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))

Loading…
Cancel
Save