We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a subnet is modfied in source, only one resource is modified in the plan/apply
plan
apply
When a subnet in the list of var.subnets is updated or deleted, it forces recreation of all subsequent subnets in the list.
var.subnets
If I were to update the subnet_ip for subnet-01 it would force re-creation of subnet-02 as well.
subnet_ip
subnet-01
subnet-02
module "vpc" { source = "terraform-google-modules/network/google" version = "~> 1.0.0" ... subnets = [ { subnet_name = "subnet-01" subnet_ip = "10.10.10.0/24" subnet_region = "us-west1" }, { subnet_name = "subnet-02" subnet_ip = "10.10.20.0/24" subnet_region = "us-west1" subnet_private_access = "true" subnet_flow_logs = "true" description = "This subnet has a description" }, ] ... }
The text was updated successfully, but these errors were encountered:
Thanks for the report.
We should solve this by switching subnets to use for_each: https://www.terraform.io/docs/configuration/resources.html#for_each-multiple-resource-instances-defined-by-a-map-or-set-of-strings
for_each
Sorry, something went wrong.
I also ran into this and started a feature branch that I got working. I should be able to open a PR later today 😄
tfhartmann
Successfully merging a pull request may close this issue.
Expected behavior
When a subnet is modfied in source, only one resource is modified in the
plan
/apply
Actual behavior
When a subnet in the list of
var.subnets
is updated or deleted, it forces recreation of all subsequent subnets in the list.Example
If I were to update the
subnet_ip
forsubnet-01
it would force re-creation ofsubnet-02
as well.The text was updated successfully, but these errors were encountered: