Skip to content
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

Add missing fields to compute resources [KMS and disks] #9328

Conversation

modular-magician
Copy link
Collaborator

closes hashicorp/terraform-provider-google#18050

Hi this is a PR to fix feature gap between the API and the provider on disks and encryption. I'll look for any tickets that this fixes and update them later.

Tested this for basic breaking changes (created an instance on upstream provider and did a terraform apply on the custom provider) - no changes in configuration shown

On some of these fields i wasn't able to add a ConflictsWith param. LMK if the API errors are sufficient in these cases or do we want this to throw an error on terraform's side

Also for the guest_os_features field i've made it so that it is computed but it will show null until the user sets it in his config. This field changes based on the source used for the disk and is ForceNew, so i think that this it's a safer behavior to have it null until the user specifficaly sets it in his config.

Fields added:

  • google_compute_instance

    • boot_disk.architecture
    • boot_disk.guest_os_features
    • boot_disk.disk_encryption_key_rsa
    • boot_disk.disk_encryption_service_account
    • boot_disk.initialize_params.source_image_encryption_key
      • boot_disk.initialize_params.source_image_encryption_key.raw_key
      • boot_disk.initialize_params.source_image_encryption_key.rsa_encrypted_key
      • boot_disk.initialize_params.source_image_encryption_key.kms_key_self_link
      • boot_disk.initialize_params.source_image_encryption_key.kms_key_service_account
      • boot_disk.initialize_params.source_image_encryption_key.sha256
    • boot_disk.initialize_params.snapshot
    • boot_disk.initialize_params.source_snapshot_encryption_key
      • boot_disk.initialize_params.source_snapshot_encryption_key.raw_key
      • boot_disk.initialize_params.source_snapshot_encryption_key.rsa_encrypted_key
      • boot_disk.initialize_params.source_snapshot_encryption_key.kms_key_self_link
      • boot_disk.initialize_params.source_snapshot_encryption_key.kms_key_service_account
      • boot_disk.initialize_params.source_snapshot_encryption_key.sha256
    • attached_disk.disk_encryption_key_rsa
    • attached_disk.disk_encryption_service_account
    • instance_encryption_key
      • instance_encryption_key.kms_key_self_link
      • instance_encryption_key.kms_key_service_account
      • instance_encryption_key.sha256
  • google_compute_image

    • image_encryption_key.raw_key
    • image_encryption_key.rsa_encrypted_key
  • google_compute_snapshot

    • snapshot_encryption_key.rsa_encrypted_key
  • google_compute_instance_template

    • disk.architecture
    • disk.guest_os_features
    • source_image_encryption_key.raw_key
    • source_image_encryption_key,rsa_encrypted_key
    • source_snapshot_encryption_key.raw_key
    • source_snapshot_encryption_key.rsa_encrypted_key
    • disk_encryption_key.kms_key_service_account
  • google_compute_region_instance_template

    • disk.architecture
    • disk.guest_os_features
    • source_image_encryption_key.raw_key
    • source_image_encryption_key,rsa_encrypted_key
    • source_snapshot_encryption_key.raw_key
    • source_snapshot_encryption_key.rsa_encrypted_key
    • disk_encryption_key.kms_key_service_account

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: added several `boot_disk`, `attached_disk`, and `instance_encryption_key` fields for improved encryption key support in `google_compute_instance` and template resources
compute: added support for `image_encryption_key.raw_key` and ` image_encryption_key.rsa_encrypted_key` to `google_compute_image` resource
compute: added support for `snapshot_encryption_key.rsa_encrypted_key` to `google_compute_snapshot` resource

Derived from GoogleCloudPlatform/magic-modules#12672

[upstream:d7f8e8a5a42907f8a0e072fb585c92ef9b32335a]

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician requested a review from a team as a code owner February 14, 2025 00:43
@modular-magician modular-magician merged commit bf187f8 into hashicorp:main Feb 14, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compute instance data encryption option is missing in terraform
1 participant