feat(aws): add SSM Parameter Store resource#1069
Open
Amit2465 wants to merge 1 commit intogruntwork-io:masterfrom
Open
feat(aws): add SSM Parameter Store resource#1069Amit2465 wants to merge 1 commit intogruntwork-io:masterfrom
Amit2465 wants to merge 1 commit intogruntwork-io:masterfrom
Conversation
5eec327 to
f9c3f73
Compare
Contributor
|
Clean implementation with good test coverage. A few items:
|
Add support for nuking AWS SSM Parameter Store parameters using the generic resource pattern. Parameters are discovered via paginated DescribeParameters and deleted individually. Safety: - Skip AWS-managed public parameters under the /aws/ prefix (e.g. /aws/service/*, /aws/reference/*) — these are read-only and cannot be deleted - Skip parameters whose tags cannot be fetched to preserve cloud-nuke-excluded and cloud-nuke-after protections, unlike other resources that pass nil tags and silently bypass these checks
f9c3f73 to
38fbad3
Compare
Contributor
Author
|
@james00012 Good catches, all fixed.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1065.
Add support for nuking AWS SSM Parameter Store parameters using the generic resource pattern.
How it works
Parameters are discovered via paginated
DescribeParametersand deleted individually usingDeleteParameter. Tags are fetched separately viaListTagsForResourceto support name, time, and tag-based config filtering.Safety measures
/aws/prefix, e.g./aws/service/*,/aws/reference/*) are skipped. AWS reserves this namespace and customers cannot create parameters there — deletion would fail withAccessDeniedException.ShouldIncludewould silently bypasscloud-nuke-excludedandcloud-nuke-afterprotection checks, risking accidental deletion of protected resources.Pre-commit checks
gofmt— no issuesgolangci-lint run ./aws/resources/...— 0 issuesgo build ./...— cleango vet ./aws/resources/...— cleanManually verified against a real AWS account:
inspect-aws --resource-type ssm-parametercorrectly lists parameters/aws/managed parameters are correctly skipped and never listedTest output
TODOs
Read the Gruntwork contribution guidelines.
nuke_sandboxandnuke_phxdevopsjobs in.circleci/config.ymlhave been updated with appropriate exclusions (either directly in the job or via the.circleci/nuke_config.ymlfile) to prevent nuking IAM roles, groups, resources, etc that are important for the test accounts.Release Notes (draft)
Added AWS SSM Parameter Store (
ssm-parameter) as a new supported resource type.Migration Guide
This PR introduces
ssm-parameteras a new AWS resource type. Sincecloud-nukeautomatically includes all registered resource types, SSM Parameter Store parameters will be nuked by default if no config file is provided.To opt out, add the following to your config file:
See configuration docs for full filter options.