Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/pubsub/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ resource "google_pubsub_topic" "topic" {
project = google_project_service.enable_destination_api.project
labels = var.topic_labels
kms_key_name = var.kms_key_name
dynamic "message_storage_policy" {
for_each = var.message_storage_policy
content {
allowed_persistence_regions = message_storage_policy.key == "allowed_persistence_regions" ? message_storage_policy.value : null
}
}

#--------------------------------#
Expand Down
6 changes: 6 additions & 0 deletions modules/pubsub/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@ variable "kms_key_name" {
type = string
default = null
}

variable "message_storage_policy" {
type = map(any)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@essentialmetrics can you plz define this as an object with optional components?

description = "A map of storage policies. Default - inherit from organization's Resource Location Restriction policy."
default = {}
}