This module help us to keep our configuration standard. We had issues with forgetting correct SA permissions on DLQ. Having everything in a module can keep the issue away.
Everything could be defined in topics
variable:
module "pubsub" {
source = "../"
project = var.project
topics = {
"topic-a" : {}
"topic-b" : {
dlq : true
users : [
"user:test@example.com",
]
}
"topic-c" : {
black_hole : true
}
"topic-d" : {
dlq : true
custom_dlq_postfix: "-dlq"
}
}
}
topics
map items can have define following keys:
- allow_dlq_users_to_push_into_dlq_topic [boolean] - once enabled, users from dlq_users can also push to dlq topics
- black_hole [boolean] -- add subscription with fairly short 600s retention
- dlq [boolean] -- add dead letter queue to the topic
- custom_dlq_postfix [string] -- change
dlq
subscription postfix from-error
to-${custom_dlq_postfix}
- custom_dlq_name [string] -- custom name for
dlq
topic & subscription - max_delivery_attempts [number] -- check documentation
- retry_policy [map(string)] -- check documentation
- bigquery_config [map(string)] -- check documentation
- enable_message_ordering [boolean] -- check documentation
- custom_subscriptions [map(map(any))] -- accepts same arguments as topic, serves for custom subscription in case one is not enough
- users [list(string)] -- list of users (with type, e.g:
serviceAccount:..., ...
), beware that any service account used as user has to be created before module usage - dlq_users [list(string)] -- list of users of DLQ subscription (with type, e.g:
serviceAccount:..., ...
), beware that any service account used as user has to be created before module usage - push_config [map(string)] -- check documentation
- schema_definition [string] -- check documentation
- schema_type [string] -- check documentation
Further examples are at example folder.
Name | Version |
---|---|
terraform | >= 0.13 |
Name | Version |
---|---|
n/a |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
project | GCP project ID | string |
n/a | yes |
topics | Map of maps of topics to be created with default subscription | map |
{} |
no |
Name | Description |
---|---|
black_hole_subscriptions | n/a |
dlq_subscriptions | n/a |
dlq_topics | n/a |
subscriptions | n/a |
topics | n/a |