-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
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
Unexpected Breaking Change: google_compute_instance addition of resource_policies #19525
Unexpected Breaking Change: google_compute_instance addition of resource_policies #19525
Comments
Confirmed this diff. Working on a fix. Setting the field as This field is under |
I can't reproduce the issue and see the |
Hi @ggtisc, Here is a clean config to recreate this diff. Just to clarify that it exists.
Terraform v1.9.5
resource "google_compute_resource_policy" "test-policy" {
name = "test-policy"
snapshot_schedule_policy {
schedule {
hourly_schedule {
hours_in_cycle = 1
start_time = "11:00"
}
}
}
}
resource "google_compute_instance" "test-instance" {
name = "test-instance"
machine_type = "n1-standard-1"
zone = var.zone
boot_disk {
initialize_params {
image = "debian-cloud/debian-11"
}
}
network_interface {
network = "default"
}
}
resource "google_compute_disk_resource_policy_attachment" "this" {
name = google_compute_resource_policy.test-policy.name
disk = google_compute_instance.test-instance.name
zone = google_compute_instance.test-instance.zone
project = google_compute_instance.test-instance.project
} You can get rid of this diff by setting boot_disk {
initialize_params {
resource_policies = [ google_compute_resource_policy.test-policy.id ]
image = "debian-cloud/debian-11"
}
} |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform Version & Provider Version(s)
https://github.com/hashicorp/terraform-provider-google/releases/tag/v6.3.0 causes the breaking change
Affected Resource(s)
google_compute_instance
Terraform Configuration
Debug Output
Expected Behavior
Prior to this release, using the
google_compute_disk_resource_policy_attachment
policy was the main tool we could use for adding a snapshot policy to the bootdisk of an instance.We would expect that the use of that pattern would not break with the release of a new field.
Actual Behavior
Per the debug, this causes a conflict between the config for
google_compute_instance
and the state of the GCE resource when used withgoogle_compute_disk_resource_policy_attachment
.I would have expected to have that field be both a:
forceNew
, since clearly we can add in the resource policy and destroy it without affecting the instance itselfcomputed
field (or other mechanism) since this value can be set by this resourceSteps to reproduce
google_compute_disk_resource_policy_attachment
resource.Important Factoids
No response
References
Change which caused this: GoogleCloudPlatform/magic-modules#11527
b/369404586
The text was updated successfully, but these errors were encountered: