Skip to content

Conversation

@tmekari
Copy link
Contributor

@tmekari tmekari commented Mar 14, 2023

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.

"SuccessSampleRate": logging_arn }
"LambdaFailureFeedbackRoleArn": logging_arn,
"LambdaSuccessFeedbackRoleArn": logging_arn,
"LambdaSuccessFeedbackSampleRate": logging_arn,
Copy link
Contributor

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?

Copy link
Contributor Author

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='')
Copy link
Contributor

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)
Copy link
Contributor

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

@tmekari tmekari merged commit b09dcb8 into develop Mar 17, 2023
@tmekari tmekari deleted the bugfix/enableAllSNS2 branch March 17, 2023 18:42
tmekari added a commit that referenced this pull request Mar 17, 2023
* Adding all endpoint types

* Fixed test, added error logging to reset
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