Skill 5.1.3

Version control and other remote sources

Key Concepts

Terraform recognizes github.com/ORG/REPO and bitbucket.org/ORG/REPO shorthands, and any Git repository with the git:: prefix, such as git::https://example.com/network.git or git::ssh://.... Append ?ref=v1.4.0 to select a tag, branch or commit. A double slash selects a subdirectory: git::https://example.com/infra.git//modules/vpc?ref=v1.4.0.

Other sources include Mercurial (hg::), HTTP URLs that point to an archive, Amazon S3 buckets (s3::) and Google Cloud Storage (gcs::). terraform init or terraform get downloads remote modules into .terraform/modules. In Terraform 1.12, the source argument must be a literal string; it cannot use variables.