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

cfn-lint prevents using SnapStart with Python 3.12 (w/SAM CLI) #3887

Open
awsbrando opened this issue Dec 20, 2024 · 1 comment
Open

cfn-lint prevents using SnapStart with Python 3.12 (w/SAM CLI) #3887

awsbrando opened this issue Dec 20, 2024 · 1 comment

Comments

@awsbrando
Copy link

awsbrando commented Dec 20, 2024

CloudFormation Lint Version

1.20.2

What operating system are you using?

Amazon Linux 2

Describe the bug

On Nov 18 2024, SnapStart for Python 3.12 was launched (https://aws.amazon.com/about-aws/whats-new/2024/11/aws-lambda-snapstart-python-net-functions/). cfn-lint is giving lint errors about non-support when using sam validate --lint for templates that contain SnapStart and python3.12 as a runtime.

[[E2530: SnapStart supports the configured runtime] ('python3.12' is not supported for 'SnapStart' enabled functions) matched 137]
Error: Linting failed. At least one linting rule was matched to the provided template.

One area of the code where it is validating this can be found here --

and runtime not in ["java8.al2", "java8"]

Expected behavior

For cfn-lint properly validate SnapStart and not return unsupported SnapStart for Python 3.12.

NOTE: SnapStart for AWS Lambda is only supported in some region, as opposed to Java. The list may need to be modified and/or checked independently for now in the code.

image

Reproduction template

AWSTemplateFormatVersion: '2010-09-09'
Transform:
  - AWS::LanguageExtensions
  - AWS::Serverless-2016-10-31

Description: >
  SnapStart Sample (Python 3.12)

Parameters:
  Environment:
    Type: String
    Default: local
    AllowedValues:
      - local
      - dev

Globals:
  Function:
    Timeout: 30
    MemorySize: 1024
    Runtime: python3.12
    Architectures:
      - arm64
    Tracing: Active
    AutoPublishAlias: live

  SnapStartFunc:
    Type: AWS::Serverless::Function
    Properties:
      FunctionName: "snapstat-sample-api"
      CodeUri: src/

...
@valerena
Copy link

Official list of runtimes that support SnapStart right now: https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html#snapstart-runtimes

  • Java 11 and later
  • Python 3.12 and later
  • .NET 8 and later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants