aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.71k stars 3.93k forks source link

Lambda: SnapStart Warning #32210

Open jrobbins-LiveData opened 6 days ago

jrobbins-LiveData commented 6 days ago

Describe the issue

In trying out the new Python SnapStart feature, I see this warning

[Warning at /LambdaFunction] SnapStart only support published Lambda versions. Ignore if function already have published versions [ack: @aws-cdk/aws-lambda:snapStartRequirePublish]

Since apparently the only way I can enable SnapStart is on the Function construct (and not on the VersionOptions construct), it seems that "doing it right" with CDK entails getting this spurious warning?

Also, the grammar of the warning seems a bit wrong: It would be better phrased as SnapStart only supports published Lambda versions. Ignore if function already has published versions.

Links

This isn't technically a documentation issue, but, rather, a CDK deploy-time output issue, but since there's a grammar component, I thought maybe it belonged here.

pahud commented 6 days ago

Yes we should fix the grammar error. We welcome the PRs.

To dismiss this warning, you can use cdk acknowledge for that.

jrobbins-LiveData commented 4 days ago

Thanks @pahud. Is there a "HOWTO" doc I could read to learn how to create the PR?

pahud commented 4 days ago

@jrobbins-LiveData

We have an official contributing guide https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md

And you might be interested to read this blog of sharing as well

Contributing to AWS CDK https://community.aws/content/2jhmIXdVWZJy3uJnUfEzEmp652j/contributing-to-aws-cdk

mpetito-envative commented 2 hours ago

To dismiss this warning, you can use cdk acknowledge for that.

I may be missing something but if I run npx cdk acknowledge @aws-cdk/aws-lambda:snapStartRequirePublish I end up with a null in the cdk.context.json acknowledged-issue-numbers property and the warning persists.

I instead had to add the following acknowledgement in my cdk code:

    cdk.Annotations.of(func).acknowledgeWarning(
      '@aws-cdk/aws-lambda:snapStartRequirePublish',
    );