Add parameter to modules/pubsub to support message_storage_policy.enforce_in_transit (#3761)
Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
@@ -228,8 +228,8 @@ module "pubsub" {
|
||||
|
||||
| name | description | type | required | default |
|
||||
|---|---|:---:|:---:|:---:|
|
||||
| [name](variables.tf#L49) | PubSub topic name. | <code>string</code> | ✓ | |
|
||||
| [project_id](variables.tf#L54) | Project used for resources. | <code>string</code> | ✓ | |
|
||||
| [name](variables.tf#L55) | PubSub topic name. | <code>string</code> | ✓ | |
|
||||
| [project_id](variables.tf#L60) | Project used for resources. | <code>string</code> | ✓ | |
|
||||
| [context](variables.tf#L17) | Context-specific interpolations. | <code title="object({ custom_roles = optional(map(string), {}) iam_principals = optional(map(string), {}) kms_keys = optional(map(string), {}) locations = optional(map(string), {}) project_ids = optional(map(string), {}) })">object({…})</code> | | <code>{}</code> |
|
||||
| [iam](variables-iam.tf#L17) | IAM bindings for topic in {ROLE => [MEMBERS]} format. | <code>map(list(string))</code> | | <code>{}</code> |
|
||||
| [iam_bindings](variables-iam.tf#L24) | Authoritative IAM bindings in {KEY => {role = ROLE, members = [], condition = {}}}. Keys are arbitrary. | <code title="map(object({ members = list(string) role = string condition = optional(object({ expression = string title = string description = optional(string) })) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
@@ -238,9 +238,10 @@ module "pubsub" {
|
||||
| [kms_key](variables.tf#L30) | KMS customer managed encryption key. | <code>string</code> | | <code>null</code> |
|
||||
| [labels](variables.tf#L36) | Labels. | <code>map(string)</code> | | <code>{}</code> |
|
||||
| [message_retention_duration](variables.tf#L43) | Minimum duration to retain a message after it is published to the topic. | <code>string</code> | | <code>null</code> |
|
||||
| [regions](variables.tf#L59) | List of regions used to set persistence policy. | <code>list(string)</code> | | <code>[]</code> |
|
||||
| [schema](variables.tf#L66) | Topic schema. If set, all messages in this topic should follow this schema. | <code title="object({ definition = string msg_encoding = optional(string, "ENCODING_UNSPECIFIED") schema_type = string })">object({…})</code> | | <code>null</code> |
|
||||
| [subscriptions](variables.tf#L76) | Topic subscriptions. Also define push configs for push subscriptions. If options is set to null subscription defaults will be used. Labels default to topic labels if set to null. | <code title="map(object({ ack_deadline_seconds = optional(number) enable_exactly_once_delivery = optional(bool, false) enable_message_ordering = optional(bool, false) expiration_policy_ttl = optional(string) filter = optional(string) iam = optional(map(list(string)), {}) labels = optional(map(string)) message_retention_duration = optional(string) retain_acked_messages = optional(bool, false) bigquery = optional(object({ table = string drop_unknown_fields = optional(bool, false) service_account_email = optional(string) use_table_schema = optional(bool, false) use_topic_schema = optional(bool, false) write_metadata = optional(bool, false) })) cloud_storage = optional(object({ bucket = string filename_prefix = optional(string) filename_suffix = optional(string) max_duration = optional(string) max_bytes = optional(number) avro_config = optional(object({ write_metadata = optional(bool, false) })) })) dead_letter_policy = optional(object({ topic = string max_delivery_attempts = optional(number) })) iam_bindings = optional(map(object({ members = list(string) role = string condition = optional(object({ expression = string title = string description = optional(string) })) })), {}) iam_bindings_additive = optional(map(object({ member = string role = string condition = optional(object({ expression = string title = string description = optional(string) })) })), {}) push = optional(object({ endpoint = string attributes = optional(map(string)) no_wrapper = optional(object({ write_metadata = optional(bool, false) })) oidc_token = optional(object({ audience = optional(string) service_account_email = string })) })) retry_policy = optional(object({ minimum_backoff = optional(number) maximum_backoff = optional(number) })) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [message_storage_enforce_in_transit](variables.tf#L49) | If true, var.regions is also used to enforce in-transit guarantees for messages. | <code>bool</code> | | <code>null</code> |
|
||||
| [regions](variables.tf#L65) | List of regions used to set persistence policy. | <code>list(string)</code> | | <code>[]</code> |
|
||||
| [schema](variables.tf#L72) | Topic schema. If set, all messages in this topic should follow this schema. | <code title="object({ definition = string msg_encoding = optional(string, "ENCODING_UNSPECIFIED") schema_type = string })">object({…})</code> | | <code>null</code> |
|
||||
| [subscriptions](variables.tf#L82) | Topic subscriptions. Also define push configs for push subscriptions. If options is set to null subscription defaults will be used. Labels default to topic labels if set to null. | <code title="map(object({ ack_deadline_seconds = optional(number) enable_exactly_once_delivery = optional(bool, false) enable_message_ordering = optional(bool, false) expiration_policy_ttl = optional(string) filter = optional(string) iam = optional(map(list(string)), {}) labels = optional(map(string)) message_retention_duration = optional(string) retain_acked_messages = optional(bool, false) bigquery = optional(object({ table = string drop_unknown_fields = optional(bool, false) service_account_email = optional(string) use_table_schema = optional(bool, false) use_topic_schema = optional(bool, false) write_metadata = optional(bool, false) })) cloud_storage = optional(object({ bucket = string filename_prefix = optional(string) filename_suffix = optional(string) max_duration = optional(string) max_bytes = optional(number) avro_config = optional(object({ write_metadata = optional(bool, false) })) })) dead_letter_policy = optional(object({ topic = string max_delivery_attempts = optional(number) })) iam_bindings = optional(map(object({ members = list(string) role = string condition = optional(object({ expression = string title = string description = optional(string) })) })), {}) iam_bindings_additive = optional(map(object({ member = string role = string condition = optional(object({ expression = string title = string description = optional(string) })) })), {}) push = optional(object({ endpoint = string attributes = optional(map(string)) no_wrapper = optional(object({ write_metadata = optional(bool, false) })) oidc_token = optional(object({ audience = optional(string) service_account_email = string })) })) retry_policy = optional(object({ minimum_backoff = optional(number) maximum_backoff = optional(number) })) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ resource "google_pubsub_topic" "default" {
|
||||
allowed_persistence_regions = [
|
||||
for v in var.regions : lookup(local.ctx.locations, v, v)
|
||||
]
|
||||
enforce_in_transit = var.message_storage_enforce_in_transit
|
||||
}
|
||||
}
|
||||
dynamic "schema_settings" {
|
||||
|
||||
@@ -46,6 +46,12 @@ variable "message_retention_duration" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "message_storage_enforce_in_transit" {
|
||||
description = "If true, var.regions is also used to enforce in-transit guarantees for messages."
|
||||
type = bool
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "name" {
|
||||
description = "PubSub topic name."
|
||||
type = string
|
||||
|
||||
Reference in New Issue
Block a user