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

bug: AwsSolutions-L1 issue with Python runtime 3.12 #1685

Open
gyalai-aws opened this issue May 6, 2024 · 1 comment
Open

bug: AwsSolutions-L1 issue with Python runtime 3.12 #1685

gyalai-aws opened this issue May 6, 2024 · 1 comment
Labels
bug Something isn't working needs-reproduction This issue needs reproduction response-requested waiting on additional information or feedback

Comments

@gyalai-aws
Copy link

What is the problem?

Using Lambda with runtime 3.12 results AwsSolutions-L1 issue.

Reproduction Steps

Create a stack with:

const pythonCode = `

Replace this with your actual Python code

def handler(event, context):
message = "Hello from an inlined Python Lambda!"
return {"message": message}
`;

const myLambda = new lambda.Function(this, 'IotCertificateCustomResource', {
runtime: lambda.Runtime.PYTHON_3_12,
role: iotCertCustomResourceRole,
code: lambda.Code.fromInline(path.resolve(__dirname, './lambda/iot_certificate')),
handler: 'main.handler'
});

What did you expect to happen?

The AwsSolutions-L1 finding should not happen as the python 3.12 is the latest.

What actually happened?

AwsSolutions-L1 error wsa reported

cdk-nag version

2.28.109

Language

Typescript

Other information

These are the runtimes considered during execution:
[
{ value: 'python2.7', family: 'python', version: '2.7' },
{ value: 'python3.6', family: 'python', version: '3.6' },
{ value: 'python3.7', family: 'python', version: '3.7' },
{ value: 'python3.8', family: 'python', version: '3.8' },
{ value: 'python3.9', family: 'python', version: '3.9' },
{ value: 'python3.10', family: 'python', version: '3.10' },
{ value: 'python3.11', family: 'python', version: '3.11' }
]

The python3.12 is missing from the list and the code https://github.com/cdklabs/cdk-nag/blob/main/src/rules/lambda/LambdaLatestVersion.ts pickes the 3.11 as latest.

@gyalai-aws gyalai-aws added bug Something isn't working needs-triage This issue or PR still needs to be triaged. labels May 6, 2024
@dontirun
Copy link
Collaborator

dontirun commented May 6, 2024

I can't reproduce this locally. These runtimes are sourced directly from the CDK, and 3.12 is included.

A few questions

  • What CDK version are you using?
  • How are you using cdk-nag?

It doesn't make sense to me that you're able to specify PYTHON_3_12 as a runtime in your application, yet its not listed on the available runtimes within the cdk.

@dontirun dontirun added response-requested waiting on additional information or feedback needs-reproduction This issue needs reproduction and removed needs-triage This issue or PR still needs to be triaged. labels May 6, 2024
@gyalai-aws gyalai-aws changed the title bug: short issue description bug: AwsSolutions-L1 issue with Python runtime 3.12 May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-reproduction This issue needs reproduction response-requested waiting on additional information or feedback
Projects
None yet
Development

No branches or pull requests

2 participants