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

Implement support for SNS Topics #354

Merged
merged 5 commits into from
Aug 23, 2022
Merged

Implement support for SNS Topics #354

merged 5 commits into from
Aug 23, 2022

Conversation

zackproser
Copy link
Contributor

@zackproser zackproser commented Aug 23, 2022

Description

Fixes #173 .

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Implement support for inspecting and nuking SNS Topics.

Migration Guide

@zackproser zackproser changed the title Feature/sns topics Implement support for SNS Topics Aug 23, 2022
aws/sns_test.go Outdated Show resolved Hide resolved
Comment on lines +54 to +58
if len(identifiers) > 100 {
logging.Logger.Errorf("Nuking too many SNS Topics (100): halting to avoid hitting AWS API rate limiting")
return TooManySNSTopicsErr{}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know that 100 is the limit? Should we detect rate limiting and respond to that, or is that overkill?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't know for sure, but this is the pattern for proactively trying to avoid rate limiting that I find us carrying throughout the resources. It would be nice if we had some intelligent logic to respond to rate limiting, but I'd need to think about the cleanest way to do that.

if err == nil {
logging.Logger.Infof("[OK] Deleted SNS Topic (arn=%s) in region: %s", aws.StringValue(topicArn), region)
} else {
logging.Logger.Errorf("[Failed] Error deleting SNS Topic (arn=%s) in %s", aws.StringValue(topicArn), region)
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're rate limited, is this where execution will end up? I think this is fine. In the worst case we'll have to retry the delete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, that or any other unhandled cause for an error state should end up here.

rhoboat
rhoboat previously approved these changes Aug 23, 2022
Copy link
Contributor

@rhoboat rhoboat left a comment

Choose a reason for hiding this comment

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

LGTM except that I'm not sure about the concurrency and rate limiting. But one can always retry the command, so LGTM!

Copy link
Contributor

@pete0emerson pete0emerson left a comment

Choose a reason for hiding this comment

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

:stamp:

@zackproser
Copy link
Contributor Author

Thanks for reviews! Going to merge this in now.

@zackproser zackproser merged commit 04b0bb1 into master Aug 23, 2022
@zackproser zackproser deleted the feature/sns-topics branch August 23, 2022 21:22
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.

New feature: ability to delete SNS Topic
3 participants