Open lyricnz opened 5 hours ago
Looks like the API is returning the entries in the lexicographical order by name and requires the same order in the resource. While it is possible to comply with this requirement when using bare resources, it is impossible to do that within modules that use dynamic
to provide module mounts depending on the inputs without requiring users to specify correct volume names.
Community Note
Terraform Version & Provider Version(s)
Affected Resource(s)
google_cloud_run_v2_service
Terraform Configuration
Debug Output
terraform2.log
Expected Behavior
terraform plan
should show no changesActual Behavior
terraform plan
wants to swap the order of the volumes. even if I apply this, the next plan/apply is the same.Steps to reproduce
terraform plan
Important Factoids
It looks like google-side API is returning the volumes in a particular order (cloudsql last?) which doesn't match what we're setting. If we SWAP the order of declaration of the volumes, then it plan/apply clean.
The same thing happens with the volume_mounts attribute.
References
https://github.com/hashicorp/terraform-provider-google/issues/13368 https://github.com/GoogleCloudPlatform/magic-modules/pull/8929