feat: introduce generic Resource[C] pattern for AWS (first batch)#984
Merged
james00012 merged 3 commits intomasterfrom Dec 31, 2025
Merged
feat: introduce generic Resource[C] pattern for AWS (first batch)#984james00012 merged 3 commits intomasterfrom
james00012 merged 3 commits intomasterfrom
Conversation
Migrates AWS resources to use the same generic Resource[C] pattern introduced for GCP in #983. This is the first batch of 10 resources. Changes: - Add AwsResourceAdapter[C] to wrap generic resources for AWS interface - Update AwsResource.Nuke() signature to accept context.Context - Migrate 10 simple resources to generic pattern: - AccessAnalyzer - CloudWatchDashboards - CloudWatchLogGroups - EC2KeyPairs - EC2PlacementGroups - EventBridgeSchedule - KinesisFirehose - KinesisStreams - LaunchConfigs - SesEmailTemplates Benefits: - Consolidates _types.go + .go files into single .go file - Uses factory functions (NewXxx()) instead of struct literals - Context passed directly to Nuke() instead of stored in struct - Consistent pattern between AWS and GCP resources Remaining 111 AWS resources can be migrated incrementally.
eac9250 to
6087800
Compare
…rectness Changes: - Use interface types instead of concrete clients for mockability - Add BulkDeleter helper for APIs with batch delete support - Fix missing pagination in KinesisFirehose, LaunchConfigs, SesEmailTemplates - Fix logging levels: errors use Errorf, deletion start uses Infof - Add unit tests for list, filter, and delete functions
The batch_deleter already logs "[OK] Deleted X" for each item, so individual delete functions don't need to log again.
denis256
approved these changes
Dec 31, 2025
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.
Summary
Migrates AWS resources to use the same generic
Resource[C]pattern introduced for GCP in #983.AwsResourceAdapter[C]to wrap generic resources for AWS interface compatibilityAwsResource.Nuke()signature to acceptcontext.ContextMigrated Resources
&resources.AccessAnalyzer{}resources.NewAccessAnalyzer()&resources.CloudWatchDashboards{}resources.NewCloudWatchDashboards()&resources.CloudWatchLogGroups{}resources.NewCloudWatchLogGroups()&resources.EC2KeyPairs{}resources.NewEC2KeyPairs()&resources.EC2PlacementGroups{}resources.NewEC2PlacementGroups()&resources.EventBridgeSchedule{}resources.NewEventBridgeSchedule()&resources.KinesisFirehose{}resources.NewKinesisFirehose()&resources.KinesisStreams{}resources.NewKinesisStreams()&resources.LaunchConfigs{}resources.NewLaunchConfigs()&resources.SesEmailTemplates{}resources.NewSesEmailTemplates()Benefits
*_types.go+*.gointo single file per resourceNuke()instead of stored in structBreaking Change
AwsResource.Nuke()signature changed fromNuke(identifiers []string)toNuke(ctx context.Context, identifiers []string). All existing resources updated.Test plan
go build ./...passesgo test ./aws/resources/...)