Skip to content

feat(dsql-cluster): add DSQL Cluster resource #9

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

Merged
merged 3 commits into from
Mar 12, 2025

Conversation

danarbaugh
Copy link
Member

This adds support for removal of DSQL Cluster resources for each currently supported region. us-west-2 is partially supported because it is able to be a "witness" region, but no Cluster can be created there. Allowing list attempts within the region was attempted and was found to lead to the following error:

time="2025-03-11T15:02:32Z" level=error msg="listing failed:\n    operation error DSQL: ListClusters, exceeded maximum number of attempts, 3, https response error StatusCode: 500, RequestID: 3a37a5cc-e6c1-4cd7-b36f-8d7f0f57d673, InternalServerException: " error="operation error DSQL: ListClusters, exceeded maximum number of attempts, 3, https response error StatusCode: 500, RequestID: 3a37a5cc-e6c1-4cd7-b36f-8d7f0f57d673, InternalServerException: " owner=us-west-2 resource_type=DSQLCluster

@danarbaugh danarbaugh requested a review from a team March 11, 2025 15:45
@danarbaugh danarbaugh marked this pull request as ready for review March 11, 2025 15:45
Copy link
Collaborator

@corybekk corybekk left a comment

Choose a reason for hiding this comment

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

Thanks Dan! This looks good to me. I used the script in your companion PR and successfully cleaned up the cluster with the new module.

output:

us-east-1 - DSQLCluster - arn:aws:dsql:us-east-1:449540884463:cluster/iiabt5az32iwdnj4xpxwl5mz3e - [Arn: "arn:aws:dsql:us-east-1:449540884463:cluster/iiabt5az32iwdnj4xpxwl5mz3e", CreationTime: "2025-03-11T16:40:26Z", DeletionProtectionEnabled: "true", Identifier: "iiabt5az32iwdnj4xpxwl5mz3e", Status: "ACTIVE"] - removed
Removal requested: 0 waiting, 0 failed, 410 skipped, 1 finished


Nuke complete: 0 failed, 410 skipped, 1 finished.

Copy link

@gsoria gsoria left a comment

Choose a reason for hiding this comment

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

This looks great! Tried it locally everything works well. Thanks Dan!

aws-nuke - 3.0.0-dev - dirty
Do you really want to nuke the account with the ID 299719426765 and the alias 'alias-299719426765'?
Do you want to continue? Enter account alias to continue.
> alias-299719426765

starting scan for resources
us-east-1 - DSQLCluster - arn:aws:dsql:us-east-1:299719426765:cluster/euabt5bl6sdwetsn4cx7tri6ry - [Arn: "arn:aws:dsql:us-east-1:299719426765:cluster/euabt5bl6sdwetsn4cx7tri6ry", CreationTime: "2025-03-11T21:49:06Z", DeletionProtectionEnabled: "true", Identifier: "euabt5bl6sdwetsn4cx7tri6ry", Status: "ACTIVE"] - would remove
Scan complete: 1 total, 1 nukeable, 0 filtered.

Do you really want to nuke the account with the ID 299719426765 and the alias 'alias-299719426765'?
Do you want to continue? Enter account alias to continue.
> alias-299719426765

us-east-1 - DSQLCluster - arn:aws:dsql:us-east-1:299719426765:cluster/euabt5bl6sdwetsn4cx7tri6ry - [Arn: "arn:aws:dsql:us-east-1:299719426765:cluster/euabt5bl6sdwetsn4cx7tri6ry", CreationTime: "2025-03-11T21:49:06Z", DeletionProtectionEnabled: "true", Identifier: "euabt5bl6sdwetsn4cx7tri6ry", Status: "ACTIVE"] - triggered remove
Removal requested: 1 waiting, 0 failed, 0 skipped, 0 finished


us-east-1 - DSQLCluster - arn:aws:dsql:us-east-1:299719426765:cluster/euabt5bl6sdwetsn4cx7tri6ry - [Arn: "arn:aws:dsql:us-east-1:299719426765:cluster/euabt5bl6sdwetsn4cx7tri6ry", CreationTime: "2025-03-11T21:49:06Z", DeletionProtectionEnabled: "true", Identifier: "euabt5bl6sdwetsn4cx7tri6ry", Status: "ACTIVE"] - waiting for removal
Removal requested: 1 waiting, 0 failed, 0 skipped, 0 finished


us-east-1 - DSQLCluster - arn:aws:dsql:us-east-1:299719426765:cluster/euabt5bl6sdwetsn4cx7tri6ry - [Arn: "arn:aws:dsql:us-east-1:299719426765:cluster/euabt5bl6sdwetsn4cx7tri6ry", CreationTime: "2025-03-11T21:49:06Z", DeletionProtectionEnabled: "true", Identifier: "euabt5bl6sdwetsn4cx7tri6ry", Status: "ACTIVE"] - removed
Removal requested: 0 waiting, 0 failed, 0 skipped, 1 finished


Nuke complete: 0 failed, 0 skipped, 1 finished.

Comment on lines +98 to +104
// https://aws.amazon.com/rds/aurora/dsql/faqs/#:~:text=available%20in%20all-,AWS%20Regions,-%3F
// NOTE: us-west-2 (Oregon) is available as a witness region, but clusters cannot be created in this region
supportedRegions := []string{
"us-east-1",
"us-east-2",
}

Copy link

Choose a reason for hiding this comment

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

Thanks for documenting this!

@danarbaugh danarbaugh merged commit 83a1b4b into oreilly-main Mar 12, 2025
2 checks passed
@danarbaugh danarbaugh deleted the dsql-clusters branch March 12, 2025 17:52
@danarbaugh danarbaugh restored the dsql-clusters branch March 12, 2025 19:05
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