Interview Prep/Terraform/Import, Already Exists and State Surgery

`Error: Cannot import non-existent remote object` for a resource you can see in the console.

IntermediateTroubleshootingImport, Already Exists and State Surgery
Answer

Likely causes → The provider is configured for a different region or account than the console; the ID format is wrong (name vs ARN vs ID); the import targets a resource using a provider alias you didn't specify.

Diagnose →

aws sts get-caller-identity; echo $AWS_REGION
terraform providers

Check the resource's "Import" section in the provider docs for the expected ID.

Fix → Use the correct ID and the matching provider. With import blocks, set provider = aws.west when needed.

Prevent → Keep a team snippet of ID formats for frequently imported types.

All Terraform questions Roadmap: Terraform in production

More on Import, Already Exists and State Surgery