From 667c4b8e45f34b85a42fb3b3f79683f782117183 Mon Sep 17 00:00:00 2001 From: Zied ANDOLSI Date: Wed, 1 Nov 2023 20:31:35 +0100 Subject: [PATCH] feat: add topic kms key name variable (#145) Co-authored-by: Awais Malik --- README.md | 1 + main.tf | 1 + variables.tf | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 782a20e..9418672 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Then perform the following commands on the root folder: | region | The region in which resources will be applied. | `string` | n/a | yes | | scheduler\_job | An existing Cloud Scheduler job instance | `object({ name = string })` | `null` | no | | time\_zone | The timezone to use in scheduler | `string` | `"Etc/UTC"` | no | +| 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 | | topic\_labels | A set of key/value label pairs to assign to the pubsub topic. | `map(string)` | `{}` | no | | topic\_name | Name of pubsub topic connecting the scheduled job and the function | `string` | `"test-topic"` | no | | 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 | diff --git a/main.tf b/main.tf index de5c1b2..9e3cc9b 100644 --- a/main.tf +++ b/main.tf @@ -46,6 +46,7 @@ module "pubsub_topic" { create_topic = var.scheduler_job == null ? true : false grant_token_creator = var.grant_token_creator topic_labels = var.topic_labels + topic_kms_key_name = var.topic_kms_key_name } /****************************************** diff --git a/variables.tf b/variables.tf index 6edc03a..d365871 100644 --- a/variables.tf +++ b/variables.tf @@ -174,6 +174,12 @@ variable "topic_labels" { default = {} } +variable "topic_kms_key_name" { + type = string + description = "The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic." + default = null +} + variable "message_data" { type = string description = "The data to send in the topic message."