Interview Prep/Terraform/Modules, Variables, Sensitive Values and Workspaces

`Error: Invalid module source address` for `source = "github.com/acme/modules//vpc?ref=v1.0"` with a `version = "1.0.0"` argument.

BeginnerTroubleshootingModules, Variables, Sensitive Values and Workspaces
Answer

Likely causes → version only works with registry sources; Git sources pin with ?ref=. Also typos in the //subdir syntax.

Diagnose → Read the source string carefully: registry format is namespace/name/provider.

Fix → Remove version for Git sources; keep ?ref=v1.0.0. For registry: source = "terraform-aws-modules/vpc/aws" and version = "~> 5.0".

Prevent → Use registry sources where possible and pin versions.

All Terraform questions Roadmap: Terraform

More on Modules, Variables, Sensitive Values and Workspaces