Skip to content

Commit

Permalink
add destroy_scheduled_duration attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisw-tracer committed Oct 30, 2023
1 parent 088124c commit 7e4b063
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Functional examples are included in the
| location | Location for the keyring. | `string` | n/a | yes |
| owners | List of comma-separated owners for each key declared in set\_owners\_for. | `list(string)` | `[]` | no |
| prevent\_destroy | Set the prevent\_destroy lifecycle attribute on keys. | `bool` | `true` | no |
| key\_destroy\_scheduled\_duration | Set the destroy\_scheduled\_duration attribute on keys. The default when not set is 24 hours | `string` | `""` | no |
| project\_id | Project id where the keyring will be created. | `string` | n/a | yes |
| purpose | The immutable purpose of the CryptoKey. Possible values are ENCRYPT\_DECRYPT, ASYMMETRIC\_SIGN, and ASYMMETRIC\_DECRYPT. | `string` | `"ENCRYPT_DECRYPT"` | no |
| set\_decrypters\_for | Name of keys for which decrypters will be set. | `list(string)` | `[]` | no |
Expand Down
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ resource "google_kms_crypto_key" "key" {
prevent_destroy = true
}

destroy_scheduled_duration = var.key_destroy_scheduled_duration

version_template {
algorithm = var.key_algorithm
protection_level = var.key_protection_level
Expand All @@ -54,6 +56,8 @@ resource "google_kms_crypto_key" "key_ephemeral" {
prevent_destroy = false
}

destroy_scheduled_duration = var.key_destroy_scheduled_duration

version_template {
algorithm = var.key_algorithm
protection_level = var.key_protection_level
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ variable "prevent_destroy" {
default = true
}

variable "key_destroy_scheduled_duration" {
description = "Set The period of time that versions of keys spend in the DESTROY_SCHEDULED state before transitioning to DESTROYED"
type = string
default = ""
}

variable "purpose" {
type = string
description = "The immutable purpose of the CryptoKey. Possible values are ENCRYPT_DECRYPT, ASYMMETRIC_SIGN, and ASYMMETRIC_DECRYPT."
Expand Down

0 comments on commit 7e4b063

Please sign in to comment.