Skip to content

Commit

Permalink
feat: Adding message_storage_policy to pubsub module
Browse files Browse the repository at this point in the history
  • Loading branch information
essentialmetrics committed Dec 6, 2024
1 parent e94ae41 commit d4ec765
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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 = {}
}

0 comments on commit d4ec765

Please sign in to comment.