@ -140,20 +140,24 @@ import json
import traceback
try :
import boto 3
import boto core
HAS_BOTO3 = True
except ImportError :
HAS_BOTO3 = False
from ansible . module_utils . basic import AnsibleModule
from ansible . module_utils . ec2 import boto3_conn , ec2_argument_spec , get_aws_connection_info
from ansible . module_utils . _text import to_native
def main ( ) :
argument_spec = ec2_argument_spec ( )
argument_spec . update ( dict (
name = dict ( ) ,
function_arn = dict ( ) ,
wait = dict ( choices= BOOLEANS , default= True , type = ' bool ' ) ,
tail_log = dict ( choices= BOOLEANS , default= False , type = ' bool ' ) ,
dry_run = dict ( choices= BOOLEANS , default= False , type = ' bool ' ) ,
wait = dict ( default= True , type = ' bool ' ) ,
tail_log = dict ( default= False , type = ' bool ' ) ,
dry_run = dict ( default= False , type = ' bool ' ) ,
version_qualifier = dict ( ) ,
payload = dict ( default = { } , type = ' dict ' ) ,
) )
@ -192,7 +196,7 @@ def main():
client = boto3_conn ( module , conn_type = ' client ' , resource = ' lambda ' ,
region = region , endpoint = ec2_url , * * aws_connect_kwargs )
except ( botocore . exceptions . ClientError , botocore . exceptions . ValidationError ) as e :
module . fail_json ( msg = " Failure connecting boto3 to AWS " , exception = traceback . format_exc ( ) )
module . fail_json ( msg = " Failure connecting boto3 to AWS : %s " % to_native ( e ) , exception = traceback . format_exc ( ) )
invoke_params = { }
@ -282,9 +286,6 @@ def main():
module . exit_json ( changed = True , result = results )
# import module snippets
from ansible . module_utils . basic import *
from ansible . module_utils . ec2 import *
if __name__ == ' __main__ ' :
main ( )