Skip to content

Modules

Module Sources

github.com and bitbucket.org sources

Terraform will recognize unprefixed github.com and bitbucket.org URLs and interpret them automatically as Git repository sources.

To clone over HTTPS.

module "consul" {
  source = "github.com/hashicorp/example" # for github
  source = "bitbucket.org/hashicorp/example" # for bitbucket
}

To clone over SSH

source = "git@github.com:hashicorp/example.git"
source = ""bitbucket.org/hashicorp/example.git"

Generic Git Repository

To use HTTPS or SSH:

module "vpc" {
  source = "git::https://example.com/vpc.git"
}

module "storage" {
  source = "git::ssh://username@example.com/storage.git"
}

Selecting a Revision

module "vpc" {
  source = "git::https://example.com/vpc.git?ref=v1.2.0"
}
The value of the ref argument can be any reference that would be accepted by the git checkout command, including branch and tag names.