Update module sources page

This commit is contained in:
Laura Pacilio 2021-12-21 17:10:29 -05:00
parent 04fb42cb05
commit f55af42086
1 changed files with 30 additions and 31 deletions

View File

@ -22,23 +22,23 @@ used by other Terraform commands.
The module installer supports installation from a number of different source The module installer supports installation from a number of different source
types, as listed below. types, as listed below.
* [Local paths](#local-paths) - [Local paths](#local-paths)
* [Terraform Registry](#terraform-registry) - [Terraform Registry](#terraform-registry)
* [GitHub](#github) - [GitHub](#github)
* [Bitbucket](#bitbucket) - [Bitbucket](#bitbucket)
* Generic [Git](#generic-git-repository), [Mercurial](#generic-mercurial-repository) repositories - Generic [Git](#generic-git-repository), [Mercurial](#generic-mercurial-repository) repositories
* [HTTP URLs](#http-urls) - [HTTP URLs](#http-urls)
* [S3 buckets](#s3-bucket) - [S3 buckets](#s3-bucket)
* [GCS buckets](#gcs-bucket) - [GCS buckets](#gcs-bucket)
* [Modules in Package Sub-directories](#modules-in-package-sub-directories) - [Modules in Package Sub-directories](#modules-in-package-sub-directories)
Each of these is described in the following sections. Module source addresses Each of these is described in the following sections. Module source addresses
use a _URL-like_ syntax, but with extensions to support unambiguous selection use a _URL-like_ syntax, but with extensions to support unambiguous selection
@ -135,7 +135,7 @@ If you are using the SaaS version of Terraform Cloud, its private
registry hostname is `app.terraform.io`. If you use a self-hosted Terraform registry hostname is `app.terraform.io`. If you use a self-hosted Terraform
Enterprise instance, its private registry hostname is the same as the host Enterprise instance, its private registry hostname is the same as the host
where you'd access the web UI and the host you'd use when configuring where you'd access the web UI and the host you'd use when configuring
the `remote` backend. the [Terraform Cloud CLI integration](/cli/cloud).
Registry modules support versioning. You can provide a specific version as shown Registry modules support versioning. You can provide a specific version as shown
in the above examples, or use flexible in the above examples, or use flexible
@ -323,13 +323,12 @@ optionally return a different result when Terraform is requesting it.
If the response is successful (`200`-range status code), Terraform looks in If the response is successful (`200`-range status code), Terraform looks in
the following locations in order for the next address to access: the following locations in order for the next address to access:
* The value of a response header field named `X-Terraform-Get`. - The value of a response header field named `X-Terraform-Get`.
* If the response is an HTML page, a `meta` element with the name `terraform-get`: - If the response is an HTML page, a `meta` element with the name `terraform-get`:
```html ```html
<meta name="terraform-get" <meta name="terraform-get" content="github.com/hashicorp/example" />
content="github.com/hashicorp/example" />
``` ```
In either case, the result is interpreted as another module source address In either case, the result is interpreted as another module source address
@ -354,10 +353,10 @@ module "vpc" {
The extensions that Terraform recognizes for this special behavior are: The extensions that Terraform recognizes for this special behavior are:
* `zip` - `zip`
* `tar.bz2` and `tbz2` - `tar.bz2` and `tbz2`
* `tar.gz` and `tgz` - `tar.gz` and `tgz`
* `tar.xz` and `txz` - `tar.xz` and `txz`
If your URL _doesn't_ have one of these extensions but refers to an archive If your URL _doesn't_ have one of these extensions but refers to an archive
anyway, use the `archive` argument to force this interpretation: anyway, use the `archive` argument to force this interpretation:
@ -399,9 +398,9 @@ Terraform will extract the archive to obtain the module source tree.
The module installer looks for AWS credentials in the following locations, The module installer looks for AWS credentials in the following locations,
preferring those earlier in the list when multiple are available: preferring those earlier in the list when multiple are available:
* The `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables. - The `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables.
* The default profile in the `.aws/credentials` file in your home directory. - The default profile in the `.aws/credentials` file in your home directory.
* If running on an EC2 instance, temporary credentials associated with the - If running on an EC2 instance, temporary credentials associated with the
instance's IAM Instance Profile. instance's IAM Instance Profile.
## GCS Bucket ## GCS Bucket
@ -412,8 +411,8 @@ prefix, followed by
For example For example
* `gcs::https://www.googleapis.com/storage/v1/BUCKET_NAME/PATH_TO_MODULE` - `gcs::https://www.googleapis.com/storage/v1/BUCKET_NAME/PATH_TO_MODULE`
* `gcs::https://www.googleapis.com/storage/v1/BUCKET_NAME/PATH/TO/module.zip` - `gcs::https://www.googleapis.com/storage/v1/BUCKET_NAME/PATH/TO/module.zip`
```hcl ```hcl
module "consul" { module "consul" {
@ -423,9 +422,9 @@ module "consul" {
The module installer uses Google Cloud SDK to authenticate with GCS. To set credentials you can: The module installer uses Google Cloud SDK to authenticate with GCS. To set credentials you can:
* Enter the path of your service account key file in the GOOGLE_APPLICATION_CREDENTIALS environment variable, or; - Enter the path of your service account key file in the GOOGLE_APPLICATION_CREDENTIALS environment variable, or;
* If you're running Terraform from a GCE instance, default credentials are automatically available. See [Creating and Enabling Service Accounts](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances) for Instances for more details - If you're running Terraform from a GCE instance, default credentials are automatically available. See [Creating and Enabling Service Accounts](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances) for Instances for more details
* On your computer, you can make your Google identity available by running `gcloud auth application-default login`. - On your computer, you can make your Google identity available by running `gcloud auth application-default login`.
## Modules in Package Sub-directories ## Modules in Package Sub-directories
@ -437,16 +436,16 @@ A special double-slash syntax is interpreted by Terraform to indicate that
the remaining path after that point is a sub-directory within the package. the remaining path after that point is a sub-directory within the package.
For example: For example:
* `hashicorp/consul/aws//modules/consul-cluster` - `hashicorp/consul/aws//modules/consul-cluster`
* `git::https://example.com/network.git//modules/vpc` - `git::https://example.com/network.git//modules/vpc`
* `https://example.com/network-module.zip//modules/vpc` - `https://example.com/network-module.zip//modules/vpc`
* `s3::https://s3-eu-west-1.amazonaws.com/examplecorp-terraform-modules/network.zip//modules/vpc` - `s3::https://s3-eu-west-1.amazonaws.com/examplecorp-terraform-modules/network.zip//modules/vpc`
If the source address has arguments, such as the `ref` argument supported for If the source address has arguments, such as the `ref` argument supported for
the version control sources, the sub-directory portion must be _before_ those the version control sources, the sub-directory portion must be _before_ those
arguments: arguments:
* `git::https://example.com/network.git//modules/vpc?ref=v1.2.0` - `git::https://example.com/network.git//modules/vpc?ref=v1.2.0`
Terraform will still extract the entire package to local disk, but will read Terraform will still extract the entire package to local disk, but will read
the module from the subdirectory. As a result, it is safe for a module in the module from the subdirectory. As a result, it is safe for a module in