Interview Prep/Terraform/Dependencies, Cycles and Providers

A data source reads the wrong AMI/VPC: `data "aws_vpc"` returns a VPC from `us-east-1` though resources go to `ap-south-1`.

IntermediateTroubleshootingDependencies, Cycles and Providers
Answer

Likely causes → Multiple provider configurations; the data source uses the default provider while resources use provider = aws.mumbai.

Diagnose → terraform providers and grep -n 'provider\s*=' *.tf

Fix → Set provider = aws.mumbai on the data source too.

Prevent → In multi-region stacks, avoid an unaliased default provider, so every resource and data source must pick one explicitly.

All Terraform questions Roadmap: Terraform

More on Dependencies, Cycles and Providers