Skip to content

Commit e2a3a04

Browse files
OlamideOl1claude
andauthored
fix(network): narrow depends_on to stop plan-time replacements (#278)
Module-level depends_on on modules with pending changes defers every data source inside the dependent module to apply time. Changing cluster_names (which only retags the VPC and subnets) therefore made the S3 endpoint's aws_region lookup unknown and forced replacement of the VPC endpoint. - s3_endpoint: drop depends_on; route_table_ids already orders it after the route tables - nat_gateway / public_subnet_routes: drop module.public_subnets from depends_on; subnets are already passed by value. Keep the internet gateway dependency, which is still required. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a8f82fd commit e2a3a04

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎aws/network/main.tf‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module "nat_gateway" {
2828
public_subnets = module.public_subnets.instances
2929
tags = var.tags
3030

31-
depends_on = [aws_internet_gateway.this, module.public_subnets]
31+
depends_on = [aws_internet_gateway.this]
3232
}
3333

3434
module "private_subnets" {
@@ -84,7 +84,7 @@ module "public_subnet_routes" {
8484
tags = merge(var.tags, var.public_subnet_tags)
8585
vpc = local.vpc
8686

87-
depends_on = [module.public_subnets, aws_internet_gateway.this]
87+
depends_on = [aws_internet_gateway.this]
8888
}
8989

9090
module "s3_endpoint" {
@@ -100,8 +100,6 @@ module "s3_endpoint" {
100100
module.private_subnet_routes.route_table_ids,
101101
[module.public_subnet_routes.route_table.id],
102102
)
103-
104-
depends_on = [module.private_subnet_routes, module.public_subnet_routes]
105103
}
106104

107105
resource "aws_internet_gateway" "this" {

0 commit comments

Comments
 (0)