Skip to content

Commit

Permalink
Add disk encyption key to the google_compute_instance_template - Sove…
Browse files Browse the repository at this point in the history
…reign support (#2750)

* add disk encyption key to the google_compute_instance_template

* add a condition to the kms_key_self_link

* use dynamic variable for disk_encryption_key

* remove the getpip from the repo

---------

Co-authored-by: Julio Castillo <[email protected]>
Co-authored-by: Ludovico Magnocavallo <[email protected]>
  • Loading branch information
3 people authored Dec 9, 2024
1 parent 3f86056 commit 2defaed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/compute-vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,13 @@ resource "google_compute_instance_template" "default" {
disk_type = var.boot_disk.initialize_params.type
resource_manager_tags = var.tag_bindings
source_image = var.boot_disk.initialize_params.image

dynamic "disk_encryption_key" {
for_each = var.encryption != null ? [""] : []
content {
kms_key_self_link = var.encryption.kms_key_self_link
}
}
}

dynamic "confidential_instance_config" {
Expand Down

0 comments on commit 2defaed

Please sign in to comment.