-
Notifications
You must be signed in to change notification settings - Fork 0
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 external SNS topic trigger stack #1
Conversation
c9ac77e
to
3cb07cf
Compare
self.triggered_lambda_dlq_alarm = cloudwatch.Alarm( | ||
scope=self, | ||
id=self.get_construct_id(triggered_lambda_fn_name, "dlq", "alarm"), | ||
alarm_description=( | ||
f"Alarm if more than 1 message in {triggered_lambda_dlq_name} in 10 minute period" | ||
), | ||
metric=self.triggered_lambda_dlq.metric_approximate_number_of_messages_visible( | ||
statistic=cloudwatch.Stats.MAXIMUM, | ||
period=cdk.Duration.minutes(10), | ||
), | ||
evaluation_periods=1, | ||
threshold=1, | ||
datapoints_to_alarm=1, | ||
comparison_operator=cloudwatch.ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD, |
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.
wonder if this should be configurable as well.
3cb07cf
to
be540ae
Compare
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.
left single comment about alarm
) | ||
self.external_sns_event_queue.grant_consume_messages(triggered_lambda_fn) | ||
|
||
# Alarm that fires if external_sns_event_queue fails delivery or if lambda fails to process |
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.
I had a comment before about making this configurable. could you add a todo maybe if not make it configurable this go around?
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.
Got it, will add a TODO comment
be540ae
to
5c7a61a
Compare
This PR adds a stack template for subscribing to an external SNS topic (in another AWS account) and triggering a lambda within the deploying AWS account.
This is expected to be useful in the future if we want to create additional triggers from PTS SNS topics or from other SNS topics.