hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.36k stars 1.75k forks source link

For Google Cloud Pub/Sub subscription, Retry policy defaulted to "retry with exponential backoff" with latest module #20445

Open MadhuSurya-Git opened 1 day ago

MadhuSurya-Git commented 1 day ago

Community Note

For Google Cloud Pub/Sub subscription, Retry policy defaulted to "retry with exponential backoff" with latest provider

Problem:

The latest version of the Terraform Google Cloud provider has introduced a change in the default retry policy for Pub/Sub subscriptions. Previously, the default was "retry immediately," but now it defaults to "retry with exponential backoff" with a default backoff configuration (retry_policy_time = {minimum_backoff = "10s" maximum_backoff = "600s"}). This unexpected behavior is causing issues for our application teams, who require the "retry immediately" policy.

When we hardcode version 6.0 of the Google Cloud provider in our latest terraform module, it automatically applied the "retry immediately" policy (no backoff was provided), it has worked as expected. Currently we have provided this workaround for most of our application teams. But we don't recommend to hardcode Google Cloud provider version in our modules as per our process standards.

Impact:

The default exponential backoff policy is causing delays in message delivery, impacting the performance and responsiveness of our applications.

Requirement:

We need to ensure that the default retry policy for Pub/Sub subscriptions reverts to "retry immediately" when using the latest version of the Terraform Google Cloud provider. Our Application teams requirement is "retry immediately"

Please resolve this bug immediately

Terraform Version & Provider Version(s)

Terraform v1.5.7

terraform { backend "azurerm" {} }

provider "google" { access_token = data.google_service_account_access_token.sa.access_token project = var.project_id region = "us-east1" }

provider "google-beta" { access_token = data.google_service_account_access_token.sa.access_token project = var.project_id region = "us-east1" }

provider "google" { credentials = file(var.gcp_credential_path) alias = "impersonated" }

data "google_service_account_access_token" "sa" { provider = google.impersonated target_service_account = "sa-${substr(var.project_id, 0, min(length(var.project_id), 27))}@${var.project_id}.iam.gserviceaccount.com" lifetime = "3600s" scopes = [ "https://www.googleapis.com/auth/cloud-platform", ] }

Affected Resource(s)

Pub/Sub subscription

Terraform Configuration

terraform { backend "azurerm" {} }

provider "google" { access_token = data.google_service_account_access_token.sa.access_token project = var.project_id region = "us-east1" }

provider "google-beta" { access_token = data.google_service_account_access_token.sa.access_token project = var.project_id region = "us-east1" }

provider "google" { credentials = file(var.gcp_credential_path) alias = "impersonated" }

data "google_service_account_access_token" "sa" { provider = google.impersonated target_service_account = "sa-${substr(var.project_id, 0, min(length(var.project_id), 27))}@${var.project_id}.iam.gserviceaccount.com" lifetime = "3600s" scopes = [ "https://www.googleapis.com/auth/cloud-platform", ] }

module "gcp_pubsub" { source = "acnciotfregistry.accenture.com/accenture-cio/pubsub/google" version = "2.1.0" project_id = var.project_id topic_name = "NewTopic-us-east1" subscription_name = "NewSubscription-us-east1" intended_event_type = "Application" resources_to_create = "BOTH" delivery_type = "Push" endpoint_url = "https://www.testendpointurl.com" push_auth_service_account = "sa-103879-big-data@${var.project_id}.iam.gserviceaccount.com" labels = { examplenum = "gcp_pubsub_test" creates = "subscription" } }

Debug Output

NA

Expected Behavior

retry policy for Pub/Sub subscriptions should set to "retry immediately"

Actual Behavior

retry policy for Pub/Sub subscriptions set to "retry with exponential backoff" with a default backoff configuration (retry_policy_time = {minimum_backoff = "10s" maximum_backoff = "600s"}).

Steps to reproduce

  1. terraform apply

Important Factoids

When we hardcode provider version 6.0 (highlighted in bold) in our latest module, it is setting retry policy for Pub/Sub subscriptions to "retry immediately". Our requirement is without hardcoding provider version we need retry policy to set as "retry immediately" Please fix this issue.

terraform { backend "azurerm" {} }

provider "google" { access_token = data.google_service_account_access_token.sa.access_token project = var.project_id region = "us-east1" }

provider "google-beta" { access_token = data.google_service_account_access_token.sa.access_token project = var.project_id region = "us-east1" }

provider "google" { credentials = file(var.gcp_credential_path) alias = "impersonated" }

data "google_service_account_access_token" "sa" { provider = "google.impersonated" target_service_account = "sa-${substr(var.project_id, 0, min(length(var.project_id), 27))}@${var.project_id}.iam.gserviceaccount.com" lifetime = "3600s" scopes = [ "https://www.googleapis.com/auth/cloud-platform", ] }

terraform { required_providers { google = { source = "hashicorp/google" version = "~> 6.0.0" } google-beta = { source = "hashicorp/google-beta" version = "~> 6.0.0" } } }

References

NA

b/380481675

ggtisc commented 1 day ago

This looks like an enhancement proposal for google_pubsub_topic retry_policy_time