Terraform hangs while planning changes to GCP resources with complex dependencies
I'm migrating some code and I'm migrating some code and I've searched everywhere and can't find a clear answer. I'm experiencing an scenario where Terraform hangs indefinitely when I run `terraform plan` on a set of Google Cloud Platform (GCP) resources. I'm using Terraform version 1.3.0 and the GCP provider version 3.5.0. The configuration involves multiple interdependent resources, including a Compute Instance that relies on a VPC and a Firewall rule that references tags from the Instance. Here's a simplified version of my configuration: ```hcl provider "google" { project = "my-project" region = "us-central1" } resource "google_compute_network" "default" { name = "my-network" auto_create_subnetworks = "true" } resource "google_compute_firewall" "allow_ssh" { name = "allow-ssh" network = google_compute_network.default.name allow { protocol = "tcp" ports = ["22"] } target_tags = [google_compute_instance.my_instance.tags[0]] } resource "google_compute_instance" "my_instance" { name = "my-instance" machine_type = "n1-standard-1" zone = "us-central1-a" boot_disk { initialize_params { image = "debian-cloud/debian-10" } } network_interface { network = google_compute_network.default.name access_config { // Ephemeral IP } } tags = ["ssh"] } ``` I've tried running `terraform init` and `terraform validate`, both of which run without errors. However, when I invoke `terraform plan`, it gets exploring at `Refreshing state...` with no output after that. I've also increased the verbosity of the logging to see if I could capture more information, but it doesn't provide any useful insights. I've checked if there are any existing resources that might conflict with the ones I'm trying to create, and even tried isolating the resources to see if one of them is causing the hang. The question continues whether I apply the changes directly or run a plan. Does anyone have insights on what might be causing this hanging behavior or how to debug it effectively? Are there best practices for managing complex dependencies in Terraform to avoid such issues? This is part of a larger web app I'm building. Is there a better approach? This is part of a larger application I'm building. Is there a better approach? Thanks for your help in advance! I'm open to any suggestions.