Skip to content

Commit

Permalink
feat: expose purpose field (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
elatovg authored Jun 10, 2022
1 parent 20fdb5f commit ec9dd06
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Functional examples are included in the
| 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 |
| 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 |
| set\_encrypters\_for | Name of keys for which encrypters will be set. | `list(string)` | `[]` | no |
| set\_owners\_for | Name of keys for which owners will be set. | `list(string)` | `[]` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ resource "google_kms_crypto_key" "key" {
name = var.keys[count.index]
key_ring = google_kms_key_ring.key_ring.id
rotation_period = var.key_rotation_period
purpose = var.purpose

lifecycle {
prevent_destroy = true
Expand Down
2 changes: 1 addition & 1 deletion test/integration/simple_example/inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name: simple_example
depends:
- name: inspec-gcp
git: https://github.com/inspec/inspec-gcp.git
tag: v1.8.8
tag: v1.10.27
attributes:
- name: project_id
required: true
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ variable "prevent_destroy" {
default = true
}

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

variable "set_owners_for" {
description = "Name of keys for which owners will be set."
type = list(string)
Expand Down

0 comments on commit ec9dd06

Please sign in to comment.