mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 01:44:03 -07:00
Add support for AWS Security Token Service (temporary credentials) to all AWS cloud modules.
This commit is contained in:
parent
e710e46ff2
commit
9980205edc
7 changed files with 59 additions and 141 deletions
|
@ -74,18 +74,6 @@ options:
|
|||
required: false
|
||||
default: null
|
||||
aliases: []
|
||||
aws_secret_key:
|
||||
description:
|
||||
- AWS secret key.
|
||||
required: false
|
||||
default: null
|
||||
aliases: ['ec2_secret_key', 'secret_key']
|
||||
aws_access_key:
|
||||
description:
|
||||
- AWS access key.
|
||||
required: false
|
||||
default: null
|
||||
aliases: ['ec2_access_key', 'access_key']
|
||||
overwrite:
|
||||
description:
|
||||
- Whether an existing record should be overwritten on create if values do not match
|
||||
|
@ -106,6 +94,7 @@ options:
|
|||
version_added: "1.9"
|
||||
requirements: [ "boto" ]
|
||||
author: Bruce Pennypacker
|
||||
extends_documentation_fragment: aws
|
||||
'''
|
||||
|
||||
# FIXME: the command stuff should have a more state like configuration alias -- MPD
|
||||
|
@ -176,6 +165,7 @@ import time
|
|||
try:
|
||||
import boto
|
||||
from boto import route53
|
||||
from boto.route53 import Route53Connection
|
||||
from boto.route53.record import ResourceRecordSets
|
||||
except ImportError:
|
||||
print "failed=True msg='boto required for this module'"
|
||||
|
@ -223,7 +213,7 @@ def main():
|
|||
retry_interval_in = module.params.get('retry_interval')
|
||||
private_zone_in = module.params.get('private_zone')
|
||||
|
||||
ec2_url, aws_access_key, aws_secret_key, region = get_ec2_creds(module)
|
||||
region, ec2_url, aws_connect_kwargs = get_aws_connection_info(module)
|
||||
|
||||
value_list = ()
|
||||
|
||||
|
@ -250,7 +240,7 @@ def main():
|
|||
|
||||
# connect to the route53 endpoint
|
||||
try:
|
||||
conn = boto.route53.connection.Route53Connection(aws_access_key, aws_secret_key)
|
||||
conn = Route53Connection(**aws_connect_kwargs)
|
||||
except boto.exception.BotoServerError, e:
|
||||
module.fail_json(msg = e.error_message)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue