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

Implement Allowed Values rule #536

Merged
merged 7 commits into from
Jan 2, 2019

Conversation

fatbasstard
Copy link
Contributor

@fatbasstard fatbasstard commented Dec 31, 2018

Issue #50

Introduce new rule E3030 to check allowed values as mentioned in the documentation. Properties sometimes have a list of "allowed values" (e.g. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html#cfn-aws-ec2-vpc-instancetenancy).

Allowed Values can now be specified using the new spec patched and ValueTypes. A few of these values are already part of the Spec files (https://github.com/awslabs/cfn-python-lint/blob/master/src/cfnlint/data/ExtendedSpecs/all/03_value_types.json#L145)

This PR will implements the rule that checks these values. Currently 2 types are covered by the rule: Values and Parameters (Ref's to Parameters with Allowed Values and/or a Default value)

This (currently) replaces the 2 existing hardcoded rules to check for the Lambda Runtimes. In the long run, when more values are added, more specific rule might become obsolete. (MVP!)

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

@codecov-io

This comment has been minimized.

Also added a fix. The rule breaks/broke when a Parameter has no AllowedValues
@kddejong
Copy link
Contributor

Cool. Thanks @fatbasstard should have time to review this today but first pass looks great.

Copy link
Contributor

@kddejong kddejong left a comment

Choose a reason for hiding this comment

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

gnarly 👍

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.

None yet

3 participants