Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding message_storage_policy to pubsub module #240

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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)
description = "A map of storage policies. Default - inherit from organization's Resource Location Restriction policy."
default = {}
}