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

Feature Request: Conditionally require StartingPosition for AWS::Lambda::EventSourceMapping #1744

Closed
iamed2 opened this issue Oct 21, 2020 · 3 comments
Labels
new rule New rule

Comments

@iamed2
Copy link

iamed2 commented Oct 21, 2020

StartingPosition is required for certain source types (Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams):

Deploying without specifying StartingPosition results in an error like:

validation error detected: Value null at 'startingPosition' failed to satisfy constraint: Member must not be null. (Service: Lambda, Status Code: 400, Request ID: 7dfa2c0c-8ea6-4d87-a8ef-e9e3d6a50e23, Extended Request ID: null)

It would be helpful to get a better error earlier, from cfn-lint.

@PatMyron PatMyron added the new rule New rule label Oct 21, 2020
@PatMyron
Copy link
Contributor

PatMyron commented Oct 21, 2020

don't think this fits into any of our existing concise constraint formats, so it would require a new rule in resources/
seems like the service would have to be parsed out of EventSourceArn

...
    def match(self, cfn):
        matches = []
        resources = cfn.get_resources(['AWS::Lambda::EventSourceMapping'])
        ...
        return matches

@kddejong
Copy link
Contributor

Yea, agreed. I think this has come up enough that it would be good to have a generic rule to do this. I think the 3 ways I've seen this.

  1. A property is required based on a different properties value (within the same property layer)
  2. A value of a property has to be a certain value based on a different properties value (within the same property layer)
  3. A property in another resource has values that may depend on another resources property value.

Things get a littler harder and taxing when we have to cross resource or property layers

@iamed2
Copy link
Author

iamed2 commented Nov 4, 2020

Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new rule New rule
Projects
None yet
Development

No branches or pull requests

3 participants