You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
If an issue is assigned to a user, that user is claiming responsibility for the issue.
Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.
Terraform Version & Provider Version(s)
❯ terraform version
OpenTofu v1.8.5
on darwin_amd64
+ provider registry.opentofu.org/hashicorp/google v6.11.2
terraform plan wants to swap the order of the volumes. even if I apply this, the next plan/apply is the same.
❯ TF_LOG=debug TF_LOG_PATH=terraform2.log terraform apply
google_storage_bucket.default: Refreshing state... [id=innablr-test-junk-cloudrun-service]
google_cloud_run_v2_service.default: Refreshing state... [id=projects/innablr-dev/locations/us-central1/services/cloudrun-service]
OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
OpenTofu will perform the following actions:
# google_cloud_run_v2_service.default will be updated in-place
~ resource "google_cloud_run_v2_service" "default" {
~ deletion_protection = false -> true
id = "projects/innablr-dev/locations/us-central1/services/cloudrun-service"
name = "cloudrun-service"
# (26 unchanged attributes hidden)
~ template {
# (7 unchanged attributes hidden)
~ volumes {
~ name = "bucket" -> "cloudsql"
+ cloud_sql_instance {
+ instances = [
+ "innablr-dev:australia-southeast2:innablr-dev",
]
}
- gcs {
- bucket = "innablr-test-junk-cloudrun-service" -> null
- read_only = false -> null
}
}
~ volumes {
~ name = "cloudsql" -> "bucket"
- cloud_sql_instance {
- instances = [
- "innablr-dev:australia-southeast2:innablr-dev",
] -> null
}
+ gcs {
+ bucket = "innablr-test-junk-cloudrun-service"
+ read_only = false
}
}
# (2 unchanged blocks hidden)
}
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
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.
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
#13368
GoogleCloudPlatform/magic-modules#8929
b/379910668
The text was updated successfully, but these errors were encountered: