I have my aws VPC module that works perfectly. I applied the code using terraform apply and the resources were deployed successfully.
I don’t make any changes to the files but I run terraform plan . It shows Plan: 0 to add, 4 to change, 0 to destroy.
when I analyze the changes, I see the gateway_id value is replaced with the nat_gateway_id . (Please see the attached image).
I wonder why it shows changes when there is no actual change!
Here is the terraform code part for which it shows the changes:
resource "aws_route_table" "private_rt" {
count = length(var.private_subnet_cidrs) > 0 ? length(var.private_subnet_cidrs) : 0
vpc_id = aws_vpc.main.id
route {
cidr_block = "0.0.0.0/0"
gateway_id = aws_nat_gateway.gw[count.index%2].id
}
tags = module.private_rt_labels[count.index].tags
}
