Skip to content

Commit 2219041

Browse files
committed
kiro based updates
1 parent 8ef9522 commit 2219041

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3679
-431
lines changed

README.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,33 @@ aws2tf.py will import into Terraform existing AWS infrastructure, and produce th
1616

1717
Finally aws2tf runs a `terraform plan` command and there should hopefully be no subsequent additions or deletions reported by the terraform plan command as all the appropriate terraform configuration files will have automatically been created.
1818

19+
## Recent Improvements
20+
21+
### Code Optimization (December 2024)
22+
23+
The codebase has been significantly optimized:
24+
25+
* **86.5% code reduction** in resource handlers (1,265 boilerplate functions eliminated)
26+
* **100% coverage** of Terraform AWS provider (1,612 resources supported)
27+
* **Handler system** with `__getattr__` for automatic default handling
28+
* **Base handler utilities** for common transformation patterns
29+
* **Maintained file organization** - 201 service-specific files preserved
30+
31+
See `code/fixtf_aws_resources/README.md` for details on the handler system.
32+
33+
### Extended Resource Support
34+
35+
* **aws_dict_extended.py** - Complete mapping of all 1,582 Terraform AWS resources
36+
* **177 new resources added** including latest AWS services
37+
* **Proper boto3 API mappings** for all resources
38+
39+
See `code/.automation/` for tools and documentation.
40+
1941
## Requirements & Prerequisites
2042

2143
+ MacOS or Linux
2244
+ Python3 (v3.12.0+)
23-
+ boto3 1.40.44 or later (pip3 install -r requirements.txt).
45+
+ boto3 1.42.16 or later (pip3 install -r requirements.txt).
2446
+ AWS cli (v2) **version 2.31.4 or higher** needs to be installed and you need a login with at least "Read" privileges.
2547
+ Terraform **version v1.12.0** or higher needs to be installed. (recommend you avoid early point releases eg. 1.9.0/1.9.1)
2648
+ jq **version 1.6 or higher**
@@ -221,6 +243,38 @@ For stack sets (-s option) look for these two files in the generated/tf* directo
221243
* stack-unprocessed.err
222244
* stack-null.err
223245

246+
---
247+
248+
## Testing
249+
250+
aws2tf includes a comprehensive test suite with 267 tests covering all critical functionality.
251+
252+
### Running Tests
253+
254+
```bash
255+
# Install test dependencies
256+
pip install -r requirements-test.txt
257+
258+
# Run all tests
259+
pytest
260+
261+
# Run with coverage report
262+
pytest --cov=code --cov=aws2tf --cov-report=html
263+
264+
# Run specific test categories
265+
pytest tests/unit/ # Unit tests only
266+
pytest tests/integration/ # Integration tests only
267+
pytest -m performance # Performance tests only
268+
```
269+
270+
### Test Coverage
271+
272+
- **267 tests** covering input validation, file operations, resource discovery, and more
273+
- **96% coverage** for context.py
274+
- **91% coverage** for build_lists.py
275+
- **25% overall coverage** with focus on critical code paths
276+
277+
See [tests/README.md](tests/README.md) for detailed testing documentation.
224278

225279
---
226280

Stack-Resources.md

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,43 @@
77
* AWS::AmazonMQ::Broker
88
* AWS::AmazonMQ::Configuration
99
* AWS::Amplify::App
10+
* AWS::Amplify::Branch
11+
* AWS::ApiGateway::Account
1012
* AWS::ApiGateway::ApiKey
13+
* AWS::ApiGateway::Authorizer
1114
* AWS::ApiGateway::BasePathMapping
1215
* AWS::ApiGateway::ClientCertificate
16+
* AWS::ApiGateway::Deployment
1317
* AWS::ApiGateway::DomainName
1418
* AWS::ApiGateway::GatewayResponse
19+
* AWS::ApiGateway::Method
1520
* AWS::ApiGateway::Model
1621
* AWS::ApiGateway::RequestValidator
22+
* AWS::ApiGateway::Resource
1723
* AWS::ApiGateway::RestApi
24+
* AWS::ApiGateway::Stage
1825
* AWS::ApiGateway::UsagePlan
1926
* AWS::ApiGateway::UsagePlanKey
2027
* AWS::ApiGateway::VpcLink
2128
* AWS::ApiGatewayV2::Api
29+
* AWS::ApiGatewayV2::ApiMapping
30+
* AWS::ApiGatewayV2::Authorizer
31+
* AWS::ApiGatewayV2::Deployment
2232
* AWS::ApiGatewayV2::DomainName
33+
* AWS::ApiGatewayV2::Integration
34+
* AWS::ApiGatewayV2::IntegrationResponse
35+
* AWS::ApiGatewayV2::Model
36+
* AWS::ApiGatewayV2::Route
37+
* AWS::ApiGatewayV2::RouteResponse
38+
* AWS::ApiGatewayV2::Stage
2339
* AWS::ApiGatewayV2::VpcLink
2440
* AWS::AppMesh::GatewayRoute
2541
* AWS::AppMesh::Mesh
2642
* AWS::AppMesh::Route
43+
* AWS::AppMesh::VirtualGateway
44+
* AWS::AppMesh::VirtualNode
45+
* AWS::AppMesh::VirtualRouter
46+
* AWS::AppMesh::VirtualService
2747
* AWS::ApplicationAutoScaling::ScalableTarget
2848
* AWS::ApplicationAutoScaling::ScalingPolicy
2949
* AWS::Athena::DataCatalog
@@ -33,51 +53,86 @@
3353
* AWS::AutoScaling::AutoScalingGroup
3454
* AWS::AutoScaling::LaunchConfiguration
3555
* AWS::AutoScaling::LifecycleHook
56+
* AWS::CDK::Metadata
57+
* AWS::CertificateManager::Certificate
3658
* AWS::Cloud9::EnvironmentEC2
3759
* AWS::CloudFront::CachePolicy
3860
* AWS::CloudFront::CloudFrontOriginAccessIdentity
3961
* AWS::CloudFront::Distribution
4062
* AWS::CloudFront::Function
4163
* AWS::CloudFront::OriginRequestPolicy
4264
* AWS::CloudWatch::Alarm
43-
* AWS::CodeBuild::Project
4465
* AWS::CodeCommit::Repository
4566
* AWS::Cognito::UserPool
67+
* AWS::Cognito::UserPoolClient
68+
* AWS::Cognito::UserPoolGroup
4669
* AWS::Config::ConfigRule
4770
* AWS::Config::ConfigurationRecorder
4871
* AWS::Config::DeliveryChannel
72+
* AWS::Connect::ContactFlow
73+
* AWS::Connect::HoursOfOperation
74+
* AWS::Connect::Instance
75+
* AWS::Connect::InstanceStorageConfig
76+
* AWS::Connect::IntegrationAssociation
77+
* AWS::Connect::PhoneNumber
78+
* AWS::Connect::Queue
79+
* AWS::Connect::RoutingProfile
80+
* AWS::Connect::SecurityProfile
81+
* AWS::Connect::User
4982
* AWS::DMS::ReplicationInstance
5083
* AWS::DMS::ReplicationSubnetGroup
84+
* AWS::DataZone::DataSource
85+
* AWS::DataZone::Domain
86+
* AWS::DataZone::Environment
87+
* AWS::DataZone::EnvironmentActions
88+
* AWS::DataZone::EnvironmentBlueprintConfiguration
89+
* AWS::DataZone::EnvironmentProfile
90+
* AWS::DataZone::Project
91+
* AWS::DataZone::ProjectMembership
92+
* AWS::DataZone::SubscriptionTarget
93+
* AWS::DataZone::UserProfile
5194
* AWS::DirectoryService::MicrosoftAD
5295
* AWS::DocDB::DBCluster
5396
* AWS::DocDB::DBInstance
5497
* AWS::DocDB::DBSubnetGroup
5598
* AWS::DynamoDB::Table
5699
* AWS::EC2::DHCPOptions
100+
* AWS::EC2::EIP
57101
* AWS::EC2::EIPAssociation
58102
* AWS::EC2::FlowLog
103+
* AWS::EC2::GatewayRouteTableAssociation
59104
* AWS::EC2::Instance
60105
* AWS::EC2::InternetGateway
61106
* AWS::EC2::KeyPair
62107
* AWS::EC2::LaunchTemplate
63108
* AWS::EC2::NatGateway
64109
* AWS::EC2::NetworkAcl
110+
* AWS::EC2::NetworkAclEntry
111+
* AWS::EC2::Route
65112
* AWS::EC2::RouteTable
66113
* AWS::EC2::SecurityGroup
114+
* AWS::EC2::SecurityGroupEgress
115+
* AWS::EC2::SecurityGroupIngress
67116
* AWS::EC2::Subnet
117+
* AWS::EC2::SubnetNetworkAclAssociation
118+
* AWS::EC2::SubnetRouteTableAssociation
68119
* AWS::EC2::VPC
69120
* AWS::EC2::VPCDHCPOptionsAssociation
70121
* AWS::EC2::VPCEndpoint
71122
* AWS::EC2::VPCEndpointService
123+
* AWS::EC2::VPCGatewayAttachment
72124
* AWS::EC2::Volume
73125
* AWS::ECR::Repository
74126
* AWS::ECS::Cluster
75127
* AWS::ECS::Service
76128
* AWS::ECS::TaskDefinition
129+
* AWS::EFS::AccessPoint
77130
* AWS::EFS::FileSystem
131+
* AWS::EFS::MountTarget
78132
* AWS::EKS::Cluster
133+
* AWS::EKS::Nodegroup
79134
* AWS::EMR::Cluster
80-
* AWS::EMR::InstanceGroupConfig": f3.write(type+" "+pid+" fetched as part of aws_emr_cluster..\n")
135+
* AWS::EMR::InstanceGroupConfig
81136
* AWS::EMR::SecurityConfiguration
82137
* AWS::ElasticLoadBalancingV2::Listener
83138
* AWS::ElasticLoadBalancingV2::ListenerRule
@@ -92,15 +147,21 @@
92147
* AWS::Glue::Job
93148
* AWS::Glue::Partition
94149
* AWS::Glue::SecurityConfiguration
150+
* AWS::Glue::Table
95151
* AWS::Glue::Trigger
152+
* AWS::IAM::AccessKey
96153
* AWS::IAM::Group
97154
* AWS::IAM::InstanceProfile
98155
* AWS::IAM::ManagedPolicy
156+
* AWS::IAM::Policy
99157
* AWS::IAM::Role
100158
* AWS::IAM::ServiceLinkedRole
101159
* AWS::IAM::User
160+
* AWS::IAM::UserToGroupAddition
102161
* AWS::KMS::Alias
103162
* AWS::KMS::Key
163+
* AWS::Kendra::DataSource
164+
* AWS::Kendra::Faq
104165
* AWS::Kendra::Index
105166
* AWS::Kinesis::Stream
106167
* AWS::KinesisFirehose::DeliveryStream
@@ -111,6 +172,14 @@
111172
* AWS::Lambda::Function
112173
* AWS::Lambda::LayerVersion
113174
* AWS::Logs::LogGroup
175+
* AWS::MSK::Cluster
176+
* AWS::MSK::ClusterPolicy
177+
* AWS::MSK::ServerlessCluster
178+
* AWS::MWAA::Environment
179+
* AWS::NetworkFirewall::Firewall
180+
* AWS::NetworkFirewall::FirewallPolicy
181+
* AWS::NetworkFirewall::LoggingConfiguration
182+
* AWS::NetworkFirewall::RuleGroup
114183
* AWS::OpenSearchService::Domain
115184
* AWS::Pipes::Pipe
116185
* AWS::RDS::DBCluster
@@ -126,18 +195,21 @@
126195
* AWS::RedshiftServerless::Namespace
127196
* AWS::RedshiftServerless::Workgroup
128197
* AWS::Route53::HostedZone
198+
* AWS::Route53::RecordSet
129199
* AWS::S3::AccessGrant
130200
* AWS::S3::AccessGrantsInstance
131201
* AWS::S3::AccessGrantsLocation
132202
* AWS::S3::AccessPoint
133203
* AWS::S3::Bucket
204+
* AWS::S3::BucketPolicy
134205
* AWS::S3::MultiRegionAccessPoint
135206
* AWS::S3::MultiRegionAccessPointPolicy
136207
* AWS::S3::StorageLens
137208
* AWS::SNS::Subscription
138209
* AWS::SNS::Topic
139210
* AWS::SNS::TopicPolicy
140211
* AWS::SQS::Queue
212+
* AWS::SQS::QueuePolicy
141213
* AWS::SSM::Association
142214
* AWS::SSM::Document
143215
* AWS::SSM::Parameter
@@ -146,6 +218,7 @@
146218
* AWS::SageMaker::Domain
147219
* AWS::SageMaker::Endpoint
148220
* AWS::SageMaker::Image
221+
* AWS::SageMaker::ImageVersion
149222
* AWS::SageMaker::Model
150223
* AWS::SageMaker::NotebookInstance
151224
* AWS::SageMaker::NotebookInstanceLifecycleConfig
@@ -157,6 +230,7 @@
157230
* AWS::SecretsManager::ResourcePolicy
158231
* AWS::SecretsManager::RotationSchedule
159232
* AWS::SecretsManager::Secret
233+
* AWS::SecretsManager::SecretTargetAttachment
160234
* AWS::ServiceDiscovery::HttpNamespace
161235
* AWS::ServiceDiscovery::PrivateDnsNamespace
162236
* AWS::ServiceDiscovery::Service
@@ -174,4 +248,6 @@
174248
* AWS::VpcLattice::ServiceNetworkVpcAssociation
175249
* AWS::VpcLattice::TargetGroup
176250
* AWS::WAFv2::IPSet
251+
* AWS::WAFv2::LoggingConfiguration
177252
* AWS::WAFv2::WebACL
253+
* AWS::WorkSpaces::Workspace

0 commit comments

Comments
 (0)