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

s3 access point support #650

Merged
merged 2 commits into from
Mar 13, 2024
Merged

s3 access point support #650

merged 2 commits into from
Mar 13, 2024

Conversation

james03160927
Copy link
Contributor

Description

Fixes #442

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.
  • Attention Grunts - if this PR adds support for a new resource, ensure the nuke_sandbox and nuke_phxdevops jobs in .circleci/config.yml have been updated with appropriate exclusions (either directly in the job or via the .circleci/nuke_config.yml file) to prevent nuking IAM roles, groups, resources, etc that are important for the test accounts.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

@james03160927 james03160927 requested a review from denis256 as a code owner March 11, 2024 12:54
accountID, ok := c.Value(util.AccountIdKey).(string)
if !ok {
logging.Errorf("unable to read the account-id from context")
return nil, errors.WithStackTrace(fmt.Errorf("unable to lookup the account id"))
Copy link
Member

Choose a reason for hiding this comment

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

I was wondering why should be defined dynamic errors and not dedicated struct errors like https://github.com/gruntwork-io/cloud-nuke/blob/master/aws/resources/ec2.go#L621

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @denis256, I'm not too sure what's the benefit of declaring a dedicated error struct in this scenario. Potential benefit would be using this error code to test things more thoroughly in unit tests -- we are not actually doing that and just checking whether certain scenario produce an error or not.

Do you have other benefits you have in mind?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it is mostly to have more robust error checking

@james03160927 james03160927 merged commit 24f6c4a into master Mar 13, 2024
3 checks passed
@james03160927 james03160927 deleted the 28-s3-access-point-support branch March 13, 2024 20:41
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.

S3 buckets are n't getting cleaned up and access points are n't deleted while nuking s3 bucket
2 participants