acantril / aws-sa-pro

Course Files for AWS Certified Solutions Architect - Professional - Adrian Cantrill
MIT License
737 stars 505 forks source link

Custom Resources CloudFormation template Error #9

Open MohamedAYACH opened 2 years ago

MohamedAYACH commented 2 years ago

trying to create the stack using customresource.yaml file return the following error:

Resource handler returned message: "The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: e284565a-47a7-4711-9228-1fec8795a9d6, Extended Request ID: null)" (RequestToken: c710323d-72f2-80af-f088-8014e0b10247, HandlerErrorCode: InvalidRequest)

MohamedAYACH commented 2 years ago

And Also this is cloudwatch:

[ERROR] Runtime.UserCodeSyntaxError: Syntax error in module 'index': invalid syntax (index.py, line 38) Traceback (most recent call last): File "/var/task/index.py" Line 38 print 'copy {} to {} '.format(key, dest_key)

acantril commented 2 years ago

you are using an older version of the repo. These have all been updated :)

acantril commented 2 years ago

do a git pull

MohamedAYACH commented 2 years ago

Hello,

Sorry but the error at the level of lambda function still persists:

[ERROR] Runtime.UserCodeSyntaxError: Syntax error in module 'index': invalid syntax (index.py, line 38) Traceback (most recent call last): File "/var/task/index.py" Line 38 print 'copy {} to {} '.format(key, dest_key)

MohamedAYACH commented 2 years ago

CloudFormation did not receive a response from your Custom Resource. Please check your logs for requestId [fc1fe86a-b445-4c4e-9cb9-9bce578cbaf4]. If you are using the Python cfn-response module, you may need to update your Lambda function code so that CloudFormation can attach the updated version.

yasser-alhawary commented 2 years ago

i created a pull request to fix it , the print function is not in python3.9 format so the function fail

13