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

Compatibility with cfn-lint #5309

Closed
jonathanmorley opened this issue Dec 5, 2019 · 3 comments
Closed

Compatibility with cfn-lint #5309

jonathanmorley opened this issue Dec 5, 2019 · 3 comments
Assignees
Labels
@aws-cdk/core Related to core CDK functionality effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. management/devenv Related to CDK development/build environment

Comments

@jonathanmorley
Copy link
Contributor

❓ General Issue

Compatibility with cfn-lint checks

The CloudFormation templates generated by CDK do not follow all the conventions specified by the cfn-lint repository.

Specifically, we notice that W2001 (Check if Parameters are Used) and I1022 (Use Sub instead of Join) are commonly violated by CDK-generated templates.

Suggestions for solutions:

  1. Change the way CDK synthesizes parameters and string-interpolations to match the conventions in cfn-lint
  2. Add a Metadata entry to templates synthesized by CDK that will exclude the template from certain cfn-lint checks
@jonathanmorley jonathanmorley added the needs-triage This issue or PR still needs to be triaged. label Dec 5, 2019
@SomayaB SomayaB added feature-request A feature should be added or improved. @aws-cdk/core Related to core CDK functionality labels Dec 5, 2019
@SomayaB SomayaB added the management/devenv Related to CDK development/build environment label Dec 5, 2019
@eladb eladb added the effort/medium Medium work item – several days of effort label Jan 23, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Mar 5, 2020
@eladb
Copy link
Contributor

eladb commented Aug 17, 2020

Closing for now

@PatMyron
Copy link
Contributor

PatMyron commented Nov 27, 2020

cfn-lint rule results from linting many CDK-generated templates:

aws-cdk $ find . -name "*expected.json" | xargs cfn-lint --include-checks I --include-experimental | grep -Eo '^[EWI][0-9]+' | sort | uniq -c | sort -nr
1283 I1022 # suggesting sub instead of join
 433 W3010 # hardcoded availability zones
 425 E2510 # invalid availability zones
 311 W3005 # unnecessary DependsOn
 112 W2001 # unused Parameter
  77 I3011 # UpdateReplacePolicy/DeletionPolicy missing on stateful resource types
  12 E0000 # Template needs to be an object ([ ] around the whole .json template)
  11 W2506 # AWS::EC2::Image::Id Parameter type
   7 E3012 # CloudFormation typecasts: https://github.com/aws-cloudformation/cfn-python-lint/issues/547
   6 W3011 # only one of UpdateReplacePolicy/DeletionPolicy set
   5 W2501 # hardcoded sensitive properties
   2 E1024 # Fn::Cidr typecasts
   1 E3030 # AllowedValues
   1 E3002 # https://github.com/aws-cloudformation/cfn-python-lint/issues/1577
   1 E1027 # ssm-secure dynamic reference unsupported type: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html#dynamic-references-ssm-secure-strings
   1 E1020 # Ref as name of output
   1 E0002 # Unknown exception while processing rule W1001: unhashable type: 'dict_node' (Ref as name of output)

@tvb
Copy link

tvb commented Mar 12, 2021

Why is this closed @eladb?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. management/devenv Related to CDK development/build environment
Projects
None yet
Development

No branches or pull requests

5 participants