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

Add rule W2530 to warn when SnapStart isn't configured correctly #2905

Merged
merged 10 commits into from
Oct 17, 2023

Conversation

kddejong
Copy link
Contributor

@kddejong kddejong commented Oct 12, 2023

Issue #, if available:
fix #2903

Description of changes:

  • Add rule W2530 to warn when SnapStart isn't configured correctly
  • Add rule I2530 to warn when SnapStart isn't configured on Java11 and Java17 runtimes
  • Add rule E2530 to error when SnapStart is configured on an unsupported runtime

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kddejong kddejong force-pushed the fix/issue/2903 branch 2 times, most recently from 2e1b456 to d7b02a8 Compare October 12, 2023 18:53
src/cfnlint/rules/resources/lmbd/SnapStart.py Outdated Show resolved Hide resolved
src/cfnlint/rules/resources/lmbd/SnapStart.py Outdated Show resolved Hide resolved
src/cfnlint/rules/resources/lmbd/SnapStart.py Outdated Show resolved Hide resolved
@kddejong
Copy link
Contributor Author

@greenwoodcm and @msailes some updates have been made based on your feedback

src/cfnlint/rules/resources/lmbd/SnapStart.py Outdated Show resolved Hide resolved
from cfnlint.rules import CloudFormationLintRule, RuleMatch


class SnapStartSupported(CloudFormationLintRule):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious people's thoughts on if we want this lint or not. the set of runtimes supporting snapstart may change in the future. do we want to have to change this lint as that happens? should we instead just let the service be the authority on which runtimes support the feature?

Copy link
Contributor Author

@kddejong kddejong Oct 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cfn-lint is used to identify issues before they are implemented. Since a template with the improper configuration will fail at deployment time I would like to have cfn-lint identify the issue before I try to do a create/update stack.

As the service changes this capability we will update the rule. Plus we provide options to suppress this rule if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greenwoodcm if the service has a spot in which we can pull this information I would gladly do so over configuring this manually. We pull a lot of data from SSM, pricing APIs, etc to build the data for our rules.

@kddejong kddejong merged commit a482a8b into aws-cloudformation:main Oct 17, 2023
21 checks passed
@kddejong kddejong deleted the fix/issue/2903 branch October 17, 2023 15:39
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

Successfully merging this pull request may close these issues.

New rule to validate lambda SnapStart configuration
3 participants