From abdd680fd20a58caa542eff8011c6a88339c6cc8 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 13 May 2019 17:10:58 -0700 Subject: [PATCH] website: Special considerations about the "scp-like" git address syntax We've seen in the past that some users try to use this form with the ssh:// URL prefix, so we'll mention explicitly that this is invalid and show a working example of how to use it without the URL scheme prefix. --- website/docs/modules/sources.html.markdown | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/website/docs/modules/sources.html.markdown b/website/docs/modules/sources.html.markdown index 62e154537..6dd428bf5 100644 --- a/website/docs/modules/sources.html.markdown +++ b/website/docs/modules/sources.html.markdown @@ -230,6 +230,26 @@ module "vpc" { The value of the `ref` argument can be any reference that would be accepted by the `git checkout` command, including branch and tag names. +### "scp-like" address syntax + +When using Git over SSH, we recommend using the `ssh://`-prefixed URL form +for consistency with all of the other URL-like git address forms. +You may opt to use the alternative "scp-like" syntax instead, in which case you +must omit the `ssh://` scheme part and include only the `git::` part. +For example: + +```hcl +module "storage" { + source = "git::username@example.com:storage.git" +} +``` + + +If you use the `ssh://` URL scheme then Terraform will assume that the colon +marks the beginning of a port number, rather than the beginning of the path. +This matches how Git itself interprets these different forms, aside from +the Terraform-specific `git::` selector prefix. + ## Generic Mercurial Repository You can use arbitrary Mercurial repositories by prefixing the address with the