Skip to content

Commit 667c4b8

Browse files
feat: add topic kms key name variable (#145)
Co-authored-by: Awais Malik <awmalik@google.com>
1 parent 08f1d42 commit 667c4b8

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Then perform the following commands on the root folder:
6565
| region | The region in which resources will be applied. | `string` | n/a | yes |
6666
| scheduler\_job | An existing Cloud Scheduler job instance | `object({ name = string })` | `null` | no |
6767
| time\_zone | The timezone to use in scheduler | `string` | `"Etc/UTC"` | no |
68+
| topic\_kms\_key\_name | The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. | `string` | `null` | no |
6869
| topic\_labels | A set of key/value label pairs to assign to the pubsub topic. | `map(string)` | `{}` | no |
6970
| topic\_name | Name of pubsub topic connecting the scheduled job and the function | `string` | `"test-topic"` | no |
7071
| vpc\_connector | The VPC Network Connector that this cloud function can connect to. It should be set up as fully-qualified URI. The format of this field is projects//locations//connectors/*. | `string` | `null` | no |

‎main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module "pubsub_topic" {
4646
create_topic = var.scheduler_job == null ? true : false
4747
grant_token_creator = var.grant_token_creator
4848
topic_labels = var.topic_labels
49+
topic_kms_key_name = var.topic_kms_key_name
4950
}
5051

5152
/******************************************

‎variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ variable "topic_labels" {
174174
default = {}
175175
}
176176

177+
variable "topic_kms_key_name" {
178+
type = string
179+
description = "The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic."
180+
default = null
181+
}
182+
177183
variable "message_data" {
178184
type = string
179185
description = "The data to send in the topic message."

0 commit comments

Comments
 (0)