`Error: Unsupported attribute` on `module.vpc.private_subnets` — `This object does not have an attribute named "private_subnets"`.
BeginnerTroubleshootingPlan Errors and Unexpected Replacements
Answer
Likely causes → The module doesn't declare that output, or it's named differently (private_subnet_ids), or you upgraded the module and the output was renamed.
Diagnose → grep -rn '^output' .terraform/modules/vpc/outputs.tf (for registry modules) or the module's README.
Fix → Use the correct output name, or add the output to your module.
Prevent → Treat module outputs as an API; changing them is a breaking change with a major version bump.
More on Plan Errors and Unexpected Replacements
`Error: Invalid for_each argument` — `The "for_each" map includes keys derived from resource attributes that cannot be determined until apply`.Intermediate`The given "for_each" argument value is unsuitable: the "for_each" argument must be a map, or set of strings, and you have provided a value of type list of string.`Beginner`Error: Invalid for_each argument` — `Sensitive values, or values derived from sensitive values, cannot be used as for_each arguments.`Intermediate`Error: Invalid count argument` — `The "count" value depends on resource attributes that cannot be determined until apply`.Intermediate`Error: Unsupported attribute` — `This object has no argument, nested block, or exported attribute named "public_ip_address"`.Beginner`Error: Missing resource instance key` — `Because aws_instance.web has "count" set, its attributes must be accessed on specific instances.`Beginner