Skip to content

Conversation

jonife
Copy link
Contributor

@jonife jonife commented Feb 15, 2022

Issue #, if available:

Description of changes:
Update validation for dlq
Description of how you validated changes:

Checklist:

  • Add/update unit tests using:
  • Add/update integration tests
  • make pr passes
  • Update documentation
  • Verify transformed template deploys and application functions as expected

Examples?

Please reach out in the comments, if you want to add an example. Examples will be
added to sam init through https://github.com/awslabs/aws-sam-cli-app-templates/

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

"'DeadLetterQueue' requires Type and TargetArn properties to be specified.".format(valid_dlq_types),
)

if not (isinstance(self.DeadLetterQueue.get("Type"), str)):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you update this method to validate that the DeadLetterQueue is of type Dict, and if not raise a validation error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know this is necessary as this is already handled by sam. And this error is thrown when DeadLetterQueue is not dict Type of property 'DeadLetterQueue' is invalid.

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure where I can find this error, but I found this usage where we just check that the self.DeadLetterQueue is not None

if self.DeadLetterQueue:
self._validate_dlq()

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks @jonife for the clarification

@jonife jonife requested a review from moelasmar February 15, 2022 23:35
@jfuss jfuss merged commit 2956d26 into aws:develop Feb 21, 2022
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.

3 participants