Skip to content

Commit ec9dd06

Browse files
authored
feat: expose purpose field (#59)
1 parent 20fdb5f commit ec9dd06

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Functional examples are included in the
5656
| owners | List of comma-separated owners for each key declared in set\_owners\_for. | `list(string)` | `[]` | no |
5757
| prevent\_destroy | Set the prevent\_destroy lifecycle attribute on keys. | `bool` | `true` | no |
5858
| project\_id | Project id where the keyring will be created. | `string` | n/a | yes |
59+
| purpose | The immutable purpose of the CryptoKey. Possible values are ENCRYPT\_DECRYPT, ASYMMETRIC\_SIGN, and ASYMMETRIC\_DECRYPT. | `string` | `"ENCRYPT_DECRYPT"` | no |
5960
| set\_decrypters\_for | Name of keys for which decrypters will be set. | `list(string)` | `[]` | no |
6061
| set\_encrypters\_for | Name of keys for which encrypters will be set. | `list(string)` | `[]` | no |
6162
| set\_owners\_for | Name of keys for which owners will be set. | `list(string)` | `[]` | no |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ resource "google_kms_crypto_key" "key" {
2929
name = var.keys[count.index]
3030
key_ring = google_kms_key_ring.key_ring.id
3131
rotation_period = var.key_rotation_period
32+
purpose = var.purpose
3233

3334
lifecycle {
3435
prevent_destroy = true

test/integration/simple_example/inspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ name: simple_example
1616
depends:
1717
- name: inspec-gcp
1818
git: https://github.com/inspec/inspec-gcp.git
19-
tag: v1.8.8
19+
tag: v1.10.27
2020
attributes:
2121
- name: project_id
2222
required: true

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ variable "prevent_destroy" {
4141
default = true
4242
}
4343

44+
variable "purpose" {
45+
type = string
46+
description = "The immutable purpose of the CryptoKey. Possible values are ENCRYPT_DECRYPT, ASYMMETRIC_SIGN, and ASYMMETRIC_DECRYPT."
47+
default = "ENCRYPT_DECRYPT"
48+
}
49+
4450
variable "set_owners_for" {
4551
description = "Name of keys for which owners will be set."
4652
type = list(string)

0 commit comments

Comments
 (0)