Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The runtime parameter of python3.7 is no longer supported for creating or updating AWS Lambda functions. #30145

Closed
abdullahodibat opened this issue May 10, 2024 · 7 comments
Assignees
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. needs-reproduction This issue needs reproduction.

Comments

@abdullahodibat
Copy link

Describe the bug

Hello,
please note this is a similar issue to: #21470
i am unable to create cloudformation stacks anymore. because of these errors:

Resource handler returned message: "The runtime parameter of python3.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.12) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: b575bb11-b5c9-45dc-8d9d-198a6fa62166)

The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: 37f11f2e-679b-4234-abd7-ed4a01afe84b)" (RequestToken: 109b8402-1a62-b4a4-633d-736a5a14647d, HandlerErrorCode: InvalidRequest)

for some reason some reason the resources below are being created with python 3.7.
image

Although the cdk libraries versions are the latest.

Expected Behavior

I should be able to create stacks without errors.

Current Behavior

The cloudformation stack failes with these errors:
Resource handler returned message: "The runtime parameter of python3.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.12) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: b575bb11-b5c9-45dc-8d9d-198a6fa62166)

The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: 37f11f2e-679b-4234-abd7-ed4a01afe84b)" (RequestToken: 109b8402-1a62-b4a4-633d-736a5a14647d, HandlerErrorCode: InvalidRequest)

Reproduction Steps

These are the aws-cdk versions that i have:
aws-cdk.aws-sqs==1.204.0 aws-cdk.aws-ec2==1.204.0 aws-cdk.aws-rds==1.204.0 aws-cdk.aws-sagemaker==1.204.0 aws-cdk.aws-apigateway==1.204.0 aws-cdk.aws-ecr-assets==1.204.0 aws-cdk.aws-s3-deployment==1.204.0 aws-cdk.aws-s3-notifications==1.204.0 aws-cdk.aws-ecs==1.204.0 aws-cdk.aws-ecs-patterns==1.204.0 aws-cdk.aws-cloudwatch-actions==1.204.0 aws-cdk.core==1.204.0

the cdk cli version is:
2.140.0

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.140.0

Framework Version

No response

Node.js Version

v20.13.0

OS

MacOS Montery

Language

Python

Language Version

3.9.17

Other information

No response

@abdullahodibat abdullahodibat added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 10, 2024
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label May 10, 2024
@ashishdhingra ashishdhingra self-assigned this May 10, 2024
@ashishdhingra ashishdhingra added needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels May 10, 2024
@ashishdhingra
Copy link
Contributor

@abdullahodibat Good morning. Could you please share the minimal reproducible code solution to reproduce the issue (along with package.json)?

I do see that you are using AWS CDK v1 packages. AWS CDK v1 has reached End-of-Support on 2023-06-01. The v1 packages are no longer being updated, and users should migrate to AWS CDK v2. For more information on how to migrate, see https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html.

Thanks
Ashish

@ashishdhingra ashishdhingra added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 10, 2024
@abdullahodibat
Copy link
Author

@ashishdhingra Thanks alot for your hint. i totally missed the V2 thing, cdk v2 is another respository. i will upgrade :)

Regards,
Abdullah

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 11, 2024
@abdullahodibat
Copy link
Author

It worked perfectly locally after i upgraded to cdk 2, but its it fails on circle ci, although i updated cdk there too.
i used aws-cdk-lib==2.141.0 and jsii==1.98.0,,,
but getting this error on circleci:

Traceback (most recent call last): File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/circleci/Credit-Risk-Service/deployment/credit_risk_service.py", line 7, in <module> MainStack(app) File "/home/circleci/Credit-Risk-Service/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in __call__ inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs) File "/home/circleci/Credit-Risk-Service/deployment/main_stack.py", line 31, in __init__ api_gateway_stack = ApiGatewayStack(self, sagemaker_endpoint=sagemaker_stack.sagemaker_endpoint_v2) File "/home/circleci/Credit-Risk-Service/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in __call__ inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs) File "/home/circleci/Credit-Risk-Service/deployment/api_gateway_stack.py", line 194, in __init__ metric = cloudwatch.Metric( File "/home/circleci/Credit-Risk-Service/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in __call__ inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs) TypeError: __init__() got an unexpected keyword argument 'dimensions'

Thanks in advance :)

@abdullahodibat
Copy link
Author

It worked perfectly locally after i upgraded to cdk 2, but its it fails on circle ci, although i updated cdk there too. i used aws-cdk-lib==2.141.0 and jsii==1.98.0,,, but getting this error on circleci:

Traceback (most recent call last): File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/circleci/Credit-Risk-Service/deployment/credit_risk_service.py", line 7, in <module> MainStack(app) File "/home/circleci/Credit-Risk-Service/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in __call__ inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs) File "/home/circleci/Credit-Risk-Service/deployment/main_stack.py", line 31, in __init__ api_gateway_stack = ApiGatewayStack(self, sagemaker_endpoint=sagemaker_stack.sagemaker_endpoint_v2) File "/home/circleci/Credit-Risk-Service/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in __call__ inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs) File "/home/circleci/Credit-Risk-Service/deployment/api_gateway_stack.py", line 194, in __init__ metric = cloudwatch.Metric( File "/home/circleci/Credit-Risk-Service/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in __call__ inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs) TypeError: __init__() got an unexpected keyword argument 'dimensions'

Thanks in advance :)

Ok working now. The cdk cloudwatch Metric Function parameter was changed to dimensions_map instead of dimensions ,,, no idea how it was working locally!

@ashishdhingra
Copy link
Contributor

@abdullahodibat Thanks for the confirmation. Glad that it's working for you now.

@ashishdhingra ashishdhingra closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. needs-reproduction This issue needs reproduction.
Projects
None yet
Development

No branches or pull requests

3 participants