Closed PrateekKhatri closed 3 years ago
kms_key_name
is set as computed
here although it shouldn't be. We will fix it, thank you for filing the issue
Thanks for the update.
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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
While adding "machine_image_encryption_key" configuration getting "Computed attributes cannot be set, but a value was set for machine_image_encryption_key.0.kms_key_name" error.
Below is the code:
Provide version used : 3.64.0
Source Code resource "google_compute_machine_image" "image" { provider = google-beta project = var.project_name name = "${var.env_name}-${var.infra_type}-machine-image" machine_image_encryption_key { kms_key_name = "projects/${var.project_name}/locations/global/keyRings/${var.key_ring_name}/cryptoKeys/${var.key_name}" } source_instance = google_compute_instance.vm.self_link }
Getting below error while running terraform plan or apply: Error: Computed attributes cannot be set
on ......\gcp_infrastructure_samples\infra_samples\modules\compute_machine_image\machineimage.tf line 8, in resource "google_compute_machine_image" "image": 8: kms_key_name = "projects/cspm-dev/locations/global/keyRings/aj-kms-01/cryptoKeys/key-symmetric-01"
Computed attributes cannot be set, but a value was set for "machine_image_encryption_key.0.kms_key_name".