Terraform scenarios to associate GCP Pub/Sub subscription with dead-letter topic despite correct configuration
I'm migrating some code and I've encountered a strange issue with I've been working on this all day and I'm trying to set up a Google Cloud Pub/Sub subscription in Terraform, and I want to associate it with a dead-letter topic. However, when I run `terraform apply`, I receive the behavior `behavior: Pub/Sub subscription 'my-subscription' has invalid dead_letter_policy: dead_letter_topic 'projects/my-project/topics/my-dlq' does not exist`. I am certain that the dead-letter topic was created beforehand and is correctly spelled in my configuration. Here's the relevant part of my code: ```hcl resource "google_pubsub_topic" "main_topic" { name = "my-topic" } resource "google_pubsub_topic" "dead_letter_topic" { name = "my-dlq" } resource "google_pubsub_subscription" "main_subscription" { name = "my-subscription" topic = google_pubsub_topic.main_topic.id dead_letter_policy { dead_letter_topic = google_pubsub_topic.dead_letter_topic.id max_delivery_attempts = 5 } } ``` I've also tried running `terraform plan` and the output shows that both topics are indeed recognized, but when I apply, it fails. I've ensured that the topics are created in the same Terraform workspace and that the necessary IAM permissions are set. Can anyone suggest what might be wrong or how I can debug this further? Any insight would be greatly appreciated! I'm working in a macOS environment. I'd really appreciate any guidance on this. I've been using Hcl for about a year now. The stack includes Hcl and several other technologies. What would be the recommended way to handle this?