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

Adding support for retry_policy #40

Conversation

mkaramosly
Copy link
Contributor

  • Add support for retry_policy.maximum_backoff and retry_policy.minimum_backoff
module "pubsub" {
  source  = "terraform-google-modules/pubsub/google"
  version = "~> 1.4"

  topic              = "tf-topic"
  project_id         = "my-pubsub-project"
  push_subscriptions = [
    {
      name                  = "push"   // required
      ack_deadline_seconds  = 20 // optional
      push_endpoint         = "https://example.com" // required
      x-goog-version        = "v1beta1" // optional
      oidc_service_account  = "[email protected]" // optional
      audience              = "example" // optional
      expiration_policy     = "1209600s" // optional
      dead_letter_topic     = "example-dl-topic" // optional
      max_delivery_attempts = 5 // optional
      maximum_backoff       = "600s" // optional
      minimum_backoff       = "300s" // optional
    }
  ]
  pull_subscriptions = [
    {
      name                  = "pull" // required
      ack_deadline_seconds  = 20 // optional
      dead_letter_topic     = "example-dl-topic" // optional
      max_delivery_attempts = 5 // optional
      maximum_backoff       = "600s" // optional
      minimum_backoff       = "300s" // optional
    }
  ]
}

@morgante
Copy link
Contributor

morgante commented Nov 11, 2020

@mkaramosly Please run terraform fmt:

main.tf
--- old/main.tf
+++ new/main.tf
@@ -120,7 +120,7 @@
   dynamic "retry_policy" {
     for_each = (lookup(var.push_subscriptions[count.index], "maximum_backoff", "") != "") ? [var.push_subscriptions[count.index].maximum_backoff] : []
     content {
-      maximum_backoff     = lookup(var.push_subscriptions[count.index], "maximum_backoff", "")
+      maximum_backoff = lookup(var.push_subscriptions[count.index], "maximum_backoff", "")
       minimum_backoff = lookup(var.push_subscriptions[count.index], "minimum_backoff", "")
     }
   }
@@ -181,7 +181,7 @@
   dynamic "retry_policy" {
     for_each = (lookup(var.pull_subscriptions[count.index], "maximum_backoff", "") != "") ? [var.pull_subscriptions[count.index].maximum_backoff] : []
     content {
-      maximum_backoff     = lookup(var.pull_subscriptions[count.index], "maximum_backoff", "")
+      maximum_backoff = lookup(var.pull_subscriptions[count.index], "maximum_backoff", "")
       minimum_backoff = lookup(var.pull_subscriptions[count.index], "minimum_backoff", "")
     }
   }
Error: terraform fmt failed with exit code 3

@mkaramosly mkaramosly force-pushed the feat/add-support-of-retry-policy branch from 75ecbf9 to 5fcbbe3 Compare November 11, 2020 21:29
@mkaramosly
Copy link
Contributor Author

@morgante Done!

@morgante morgante merged commit 4972a25 into terraform-google-modules:master Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants