Guest User

Untitled

a guest
Nov 20th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. What is the terraform syntax to encrypt the google_compute_disk using a custom managed KMS key in the google cloud platform.
  2. Referring the documentation and using the KMS key self_link for disk_encryption_key.raw_key seems to not work. The resulting disk generated shows the disk is encrypted via google managed key.
  3.  
  4. Please let me know if I am using a wrong format.
  5.  
  6. **resource "google_compute_disk" "ext_disk" {
  7. name = "testdisk"
  8. type = "pd-ssd"
  9. zone = "${var.zone}"
  10. size = 16
  11. labels {
  12. environment = "${var.target_environment}"
  13. }
  14. disk_encryption_key {
  15. raw_key = "${google_kms_crypto_key.crypto_key.self_link}"
  16. }
  17. }**
Add Comment
Please, Sign In to add comment