-
Notifications
You must be signed in to change notification settings - Fork 597
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 E3017 to check when a prop is required based on a value #1746
add rule E3017 to check when a prop is required based on a value #1746
Conversation
b6e36f3
to
830e27a
Compare
Think investigating similar rules/requests will be helpful: Something to note is that quite a few of them are the opposite: a certain property cannot be specified based on the value of another property. Might be useful to support both formats: # just example possibilities for discussion
not StartingPosition if AWS::Lambda::EventSourceMapping.EventSourceArn == arn:aws*:(kinesis|kafka|dynamodb):*
!StartingPosition if AWS::Lambda::EventSourceMapping.EventSourceArn == arn:aws*:(kinesis|kafka|dynamodb):* this is also very similar to |
"AWS::Lambda::EventSourceMapping": { | ||
"EventSourceArn": [ | ||
{ | ||
"Regex": "arn:aws:(kinesis|kafka|dynamodb):*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing support for other partitions
"Regex": "arn:aws:(kinesis|kafka|dynamodb):*", | |
"Regex": "arn:aws*:(kinesis|kafka|dynamodb):*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kddejong sorry, got confused by that trailing wildcard. Should be something like this instead:
+ "Regex": "arn:aws.*:(kinesis|kafka|dynamodb):",
+ "Regex": "arn:aws.*:(kinesis|kafka|dynamodb):.*",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Resolved it here #1759
13d4fc6
to
22b1412
Compare
c27aae5
to
911f0f3
Compare
@PatMyron I'm going to look at another rule for doing the opposite check because I'm finding use cases where it could be valuable. |
test/unit/rules/resources/properties/test_required_based_on_value.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Pat Myron <PatMyron@users.noreply.github.com>
Issue #, if available:
#1744
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.