Skip to content

Conversation

@james00012
Copy link
Contributor

@james00012 james00012 commented Jan 1, 2026

Summary

Migrates 30 AWS resources from legacy BaseAwsResource pattern to generic Resource[C] pattern.

Combines and replaces PRs #988, #989, #990.

Migrated Resources

ASGroups, ApiGateway, ApiGatewayV2, CodeDeployApplications, DBClusters, DBInstances, DBSubnetGroups, EBSVolumes, EC2DedicatedHosts, EC2Endpoints, EC2Instances, ECSClusters, ECSServices, EKSClusters, ElasticFileSystem, Elasticaches, KmsCustomerKeys, LambdaFunctions, LambdaLayers, LoadBalancers, LoadBalancersV2, MSKCluster, OpenSearchDomains, RdsParameterGroup, RedshiftClusters, SecurityHub, TransitGateways, TransitGatewaysVpcAttachment, VPCLatticeServiceNetwork, VPCLatticeTargetGroup

Changes

  • Consolidated *_types.go into main resource files
  • Replaced struct pattern with factory functions (NewXxx())
  • Updated tests to use factory functions

This PR migrates 30 additional AWS resources from the legacy BaseAwsResource
pattern to the generic Resource[C] pattern introduced in commit 88f04bd.

Migrated resources:
- ApiGateway, ApiGatewayV2
- ASGroups
- CodeDeployApplications
- DBInstances, DBSubnetGroups, DBClusters
- EBSVolumes
- EC2Instances, EC2DedicatedHosts, EC2Endpoints
- ECSClusters, ECSServices
- ElasticFileSystem
- EKSClusters
- Elasticaches
- LoadBalancers, LoadBalancersV2
- KmsCustomerKeys
- LambdaFunctions, LambdaLayers
- MSKCluster
- OpenSearchDomains
- RdsParameterGroup
- RedshiftClusters
- SecurityHub
- TransitGateways, TransitGatewaysVpcAttachment
- VPCLatticeServiceNetwork, VPCLatticeTargetGroup

Key changes per resource:
- Consolidated *_types.go files into main resource files
- Replaced struct-based pattern with factory function (NewXxx)
- Used standalone lister/nuker functions with type parameters
- Updated tests to use factory functions
@james00012 james00012 requested a review from denis256 as a code owner January 1, 2026 16:04
@james00012 james00012 changed the title feat: migrate 30 AWS resources to generic Resource[C] pattern (combined) feat: migrate 30 AWS resources to generic Resource[C] pattern Jan 1, 2026
@james00012 james00012 force-pushed the feat/generic-resource-combined branch from 2ac223d to 02b3fed Compare January 1, 2026 17:53
- Add SequentialDeleteThenWaitAll and ConcurrentDeleteThenWaitAll helpers
- Refactor 10 resources to use batch_deleter patterns (removes direct report.Record calls)
- Simplify 5 over-engineered resources:
  - apigateway: remove unnecessary client cert post-cleanup
  - kms_customer_key: remove alias deletion (AWS auto-deletes)
  - transit_gateway: remove global state, inline permission verification
  - efs: replace 20s hardcoded sleep with proper waiter
  - lambda_layer: use composite identifier format (name:version)
- Fix EKS test timeout by properly simulating deleted cluster
Use SDK paginator to handle cases with many RDS clusters.
- Use WrapAwsInitClient for cleaner initialization
- Add pagination using DescribeAutoScalingGroupsPaginator
- Improve tests with table-driven approach and tag filtering test
@james00012 james00012 closed this Jan 2, 2026
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