-
Notifications
You must be signed in to change notification settings - Fork 130
Adding all endpoint types to SNS.2 Remediation #145
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
Conversation
| "SuccessSampleRate": logging_arn } | ||
| "LambdaFailureFeedbackRoleArn": logging_arn, | ||
| "LambdaSuccessFeedbackRoleArn": logging_arn, | ||
| "LambdaSuccessFeedbackSampleRate": logging_arn, |
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.
Should the expected sample rate really be the logging arn?
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.
No and it scares me that it just passes like that...
|
|
||
| for endpoint in endpointTypes: | ||
| sns.set_topic_attributes(TopicArn=topic_arn, AttributeName=f'{endpoint}SuccessFeedbackRoleArn', AttributeValue='') | ||
| sns.set_topic_attributes(TopicArn=topic_arn, AttributeName=f'{endpoint}FailureFeedbackRoleArn', AttributeValue='') |
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.
could probably use error handling here - if we're trying to reset, we should catch exceptions on each iteration, log, and continue
| sns.set_topic_attributes(TopicArn=topic_arn, AttributeName=failureFeedbackRoleValue, AttributeValue=logging_role) | ||
| for endpoint in endpointTypes: | ||
| sns.set_topic_attributes(TopicArn=topic_arn, AttributeName=f'{endpoint}SuccessFeedbackRoleArn', AttributeValue=logging_role) | ||
| sns.set_topic_attributes(TopicArn=topic_arn, AttributeName=f'{endpoint}FailureFeedbackRoleArn', AttributeValue=logging_role) |
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 agree with your choice of error handling here - the change is transactional as a whole, it either fully succeeds or we try to reset to the best of our ability
Description of changes:
Adding all endpoint types to SNS.2 Remediation, rather than just Lambda. Edited unit testing to reflect this.
Passes all unit tests, deploys successfully, tested and works as expected.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.