aws-ia / terraform-aws-vpc

AWS VPC Module
https://registry.terraform.io/modules/aws-ia/vpc/aws/latest
Apache License 2.0
82 stars 89 forks source link

Fix secondary cidr creation on the first pass #151

Open alexohima opened 1 month ago

alexohima commented 1 month ago

Description: This pull request addresses a bug with the secondary CIDR creation in the module. The create_vpc local is fairly complex, taking into account whether vpc_id is passed or not. When setting up a secondary CIDR, we pass in vpc_id from another resource that hasn't been built yet, leading to a race condition and application errors. To fix this, we can introduce a create_vpc variable and change local.create_vpc to use its value instead of vpc_id. This fix ensures secondary CIDR creation within the first Terraform apply.

Changes Made:

Related Issues: https://github.com/aws-ia/terraform-aws-vpc/issues/142


alexohima commented 3 weeks ago

@drewmullen Can we get an update on this?