From 8feceaf334c674befe066aefb5f5a89a97604842 Mon Sep 17 00:00:00 2001 From: Albert Lloveras Date: Thu, 13 Oct 2022 19:49:10 +1100 Subject: [PATCH 1/4] Document that NETRC is also respected The current documentation wording seems to suggest that the only `.netrc` file that will be considered by Terraform is the one sitting in the current user's HOME directory. However, unless I am missing something, Terraform uses `go-getter` to fetch remote modules which mean that the `NETRC` environment variable will also be respected and, in fact, will take precedence over any `.netrc` file on the user's home directory. See: https://github.com/hashicorp/go-getter/blob/f7a8c48a1f863bcd167b51adcec00a18d10c85a5/netrc.go#L23-L36 --- website/docs/language/modules/sources.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/language/modules/sources.mdx b/website/docs/language/modules/sources.mdx index c595e51a6c..3d37693de3 100644 --- a/website/docs/language/modules/sources.mdx +++ b/website/docs/language/modules/sources.mdx @@ -356,7 +356,9 @@ In either case, the result is interpreted as another module source address using one of the forms documented elsewhere on this page. If an HTTP/HTTPS URL requires authentication credentials, use a `.netrc` -file in your home directory to configure these. For information on this format, +to configure these. By default, Terraform will search for the `.netrc` file +in your HOME directory. However, that default filesystem location can be overriden +through the `NETRC` environment variable. For information on the `.netrc` format, see [the documentation for using it in `curl`](https://everything.curl.dev/usingcurl/netrc). ### Fetching archives over HTTP From cf6ffbcc912da2890fd0411a3ea5a1213ab46b7f Mon Sep 17 00:00:00 2001 From: Albert Lloveras Date: Thu, 13 Oct 2022 19:59:10 +1100 Subject: [PATCH 2/4] . --- website/docs/language/modules/sources.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/language/modules/sources.mdx b/website/docs/language/modules/sources.mdx index 3d37693de3..a77a64bcf9 100644 --- a/website/docs/language/modules/sources.mdx +++ b/website/docs/language/modules/sources.mdx @@ -356,7 +356,7 @@ In either case, the result is interpreted as another module source address using one of the forms documented elsewhere on this page. If an HTTP/HTTPS URL requires authentication credentials, use a `.netrc` -to configure these. By default, Terraform will search for the `.netrc` file +file to configure these. By default, Terraform will search for the `.netrc` file in your HOME directory. However, that default filesystem location can be overriden through the `NETRC` environment variable. For information on the `.netrc` format, see [the documentation for using it in `curl`](https://everything.curl.dev/usingcurl/netrc). From 9bca926104ad2bc6d6634c789a29fcc0328dcdc4 Mon Sep 17 00:00:00 2001 From: Albert Lloveras Date: Thu, 13 Oct 2022 19:59:17 +1100 Subject: [PATCH 3/4] . --- website/docs/language/modules/sources.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/language/modules/sources.mdx b/website/docs/language/modules/sources.mdx index a77a64bcf9..568bce0765 100644 --- a/website/docs/language/modules/sources.mdx +++ b/website/docs/language/modules/sources.mdx @@ -358,7 +358,7 @@ using one of the forms documented elsewhere on this page. If an HTTP/HTTPS URL requires authentication credentials, use a `.netrc` file to configure these. By default, Terraform will search for the `.netrc` file in your HOME directory. However, that default filesystem location can be overriden -through the `NETRC` environment variable. For information on the `.netrc` format, +by setting the `NETRC` environment variable. For information on the `.netrc` format, see [the documentation for using it in `curl`](https://everything.curl.dev/usingcurl/netrc). ### Fetching archives over HTTP From 095368b4b4bb7c8b530ed25fe5f05094a9e4e1c6 Mon Sep 17 00:00:00 2001 From: Albert Lloveras Date: Fri, 21 Oct 2022 09:48:22 +1100 Subject: [PATCH 4/4] PR Feedback Co-authored-by: Matthew Garrell <69917312+mgarrell777@users.noreply.github.com> --- website/docs/language/modules/sources.mdx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/website/docs/language/modules/sources.mdx b/website/docs/language/modules/sources.mdx index 568bce0765..b178577c88 100644 --- a/website/docs/language/modules/sources.mdx +++ b/website/docs/language/modules/sources.mdx @@ -356,10 +356,9 @@ In either case, the result is interpreted as another module source address using one of the forms documented elsewhere on this page. If an HTTP/HTTPS URL requires authentication credentials, use a `.netrc` -file to configure these. By default, Terraform will search for the `.netrc` file -in your HOME directory. However, that default filesystem location can be overriden -by setting the `NETRC` environment variable. For information on the `.netrc` format, -see [the documentation for using it in `curl`](https://everything.curl.dev/usingcurl/netrc). +file to configure the credentials. By default, Terraform searches for the `.netrc` file +in your HOME directory. However, you can override the default filesystem location by setting the `NETRC` environment variable. For information on the `.netrc` format, +refer to [the documentation for using it in `curl`](https://everything.curl.dev/usingcurl/netrc). ### Fetching archives over HTTP