Skip to content

Commit

Permalink
cloudevent trigger: make ack deadline configurable (#249)
Browse files Browse the repository at this point in the history
Signed-off-by: James Rawlings <jrawlings@chainguard.dev>
  • Loading branch information
rawlingsj committed Apr 6, 2024
1 parent a400e58 commit c1b4de6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions modules/cloudevent-trigger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ No requirements.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_ack_deadline_seconds"></a> [ack\_deadline\_seconds](#input\_ack\_deadline\_seconds) | The deadline for acking a message. | `number` | `300` | no |
| <a name="input_broker"></a> [broker](#input\_broker) | The name of the pubsub topic we are using as a broker. | `string` | n/a | yes |
| <a name="input_filter"></a> [filter](#input\_filter) | A Knative Trigger-style filter over the cloud event attributes.<br><br>This is normally used to filter relevant event types, for example:<br><br> { "type" : "dev.chainguard.foo" }<br><br>In this case, only events with a type attribute of "dev.chainguard.foo" will be delivered. | `map(string)` | `{}` | no |
| <a name="input_filter_prefix"></a> [filter\_prefix](#input\_filter\_prefix) | A Knative Trigger-style filter over the cloud event attribute prefixes.<br><br>This can be used to filter relevant event types, for example:<br><br> { "type" : "dev.chainguard." }<br><br>In this case, any event with a type attribute that starts with "dev.chainguard." will be delivered. | `map(string)` | `{}` | no |
Expand Down
3 changes: 1 addition & 2 deletions modules/cloudevent-trigger/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ resource "google_pubsub_subscription" "this" {
name = "${var.name}-${random_string.suffix.result}"
topic = var.broker

// TODO: Tune this and/or make it configurable?
ack_deadline_seconds = 300
ack_deadline_seconds = var.ack_deadline_seconds

filter = join(" AND ", local.filter-elements)

Expand Down
6 changes: 6 additions & 0 deletions modules/cloudevent-trigger/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ variable "maximum_backoff" {
type = number
default = 600
}

variable "ack_deadline_seconds" {
description = "The deadline for acking a message."
type = number
default = 300
}

0 comments on commit c1b4de6

Please sign in to comment.