CodexBloom - Programming Q&A Platform

Terraform Provider Timeout scenarios When Creating Google Cloud Pub/Sub Topic

👀 Views: 34 đŸ’Ŧ Answers: 1 📅 Created: 2025-07-02
terraform google-cloud pubsub hcl

I'm integrating two systems and I'm working with a timeout scenario when trying to create a Google Cloud Pub/Sub topic with Terraform. The behavior I receive is: `behavior: behavior creating Pub/Sub Topic: googleapi: behavior 504: Deadline exceeded while waiting for the operation to complete, timeout`. I've checked the Google Cloud Console and confirmed that my service account has the necessary permissions, including `pubsub.topics.create`. My Terraform version is 1.3.5, and I'm using the `hashicorp/google` provider version 3.5.0. Here's the code I'm using to define the Pub/Sub topic: ```hcl resource "google_pubsub_topic" "my_topic" { name = "my-unique-topic" project = "my-gcp-project" } ``` I've also tried increasing the timeout settings in the provider configuration like this: ```hcl provider "google" { credentials = file("${path.module}/account.json") project = "my-gcp-project" region = "us-central1" timeout { create = "10m" } } ``` Despite this, the timeout continues. I've verified my network connectivity to GCP and can create the topic manually via the console without issues. I've also tried running `terraform plan` and `terraform apply` multiple times, but it always ends up timing out. Any suggestions on how to troubleshoot or resolve this scenario? Any suggestions would be helpful.