Skip to content

barcelos3/terraform-modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Modules

badge-terraform

arch

Example

├── modules
│   ├── cloud-aws
│   │   └── README.md
│   ├── cloud-azure
│   │   ├── network
│   │   │   ├── subnet
│   │   │   │   ├── examples
│   │   │   │   │   ├── complete
│   │   │   │   │   │   ├── main.tf
│   │   │   │   │   │   ├── outputs.tf
│   │   │   │   │   │   ├── README.md
│   │   │   │   │   │   ├── variables.tf
│   │   │   │   │   │   └── versions.tf
│   │   │   │   │   └── simple
│   │   │   │   │       ├── main.tf
│   │   │   │   │       ├── outputs.tf
│   │   │   │   │       ├── README.md
│   │   │   │   │       ├── variables.tf
│   │   │   │   │       └── versions.tf
│   │   │   │   ├── LICENSE
│   │   │   │   ├── main.tf
│   │   │   │   ├── output.tf
│   │   │   │   ├── README.md
│   │   │   │   ├── variables.tf
│   │   │   │   └── version.tf
│   │   │   └── vnet
│   │   │       ├── examples
│   │   │       │   ├── complete
│   │   │       │   │   ├── main.tf
│   │   │       │   │   ├── outputs.tf
│   │   │       │   │   ├── README.md
│   │   │       │   │   ├── variables.tf
│   │   │       │   │   └── versions.tf
│   │   │       │   └── simple
│   │   │       │       ├── main.tf
│   │   │       │       ├── outputs.tf
│   │   │       │       ├── README.md
│   │   │       │       ├── variables.tf
│   │   │       │       └── versions.tf
│   │   │       ├── LICENSE
│   │   │       ├── main.tf
│   │   │       ├── output.tf
│   │   │       ├── README.md
│   │   │       ├── variables.tf
│   │   │       └── version.tf
│   │   ├── resource-group
│   │   │   ├── examples
│   │   │   │   ├── complete
│   │   │   │   │   ├── main.tf
│   │   │   │   │   ├── outputs.tf
│   │   │   │   │   ├── README.md
│   │   │   │   │   ├── variables.tf
│   │   │   │   │   └── versions.tf
│   │   │   │   └── simple
│   │   │   │       ├── main.tf
│   │   │   │       ├── outputs.tf
│   │   │   │       ├── README.md
│   │   │   │       ├── variables.tf
│   │   │   │       └── versions.tf
│   │   │   ├── LICENSE
│   │   │   ├── main.tf
│   │   │   ├── outputs.tf
│   │   │   ├── README.md
│   │   │   ├── variables.tf
│   │   │   └── version.tf
│   │
│   └── cloud-gcp
└──       └── README.md

Creating Modules

Hands-on: Try the Reuse Configuration with Modules tutorials.

Generic Git Repository

Arbitrary Git repositories can be used by prefixing the address with the special git:: prefix. After this prefix, any valid Git URL can be specified to select one of the protocols supported by Git.

For example, to use HTTPS or SSH:

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

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

Terraform installs modules from Git repositories by running git clone, and so it will respect any local Git configuration set on your system, including credentials. To access a non-public Git repository, configure Git with suitable credentials for that repository.

If you use the SSH protocol then any configured SSH keys will be used automatically. This is the most common way to access non-public Git repositories from automated systems because it allows access to private repositories without interactive prompts.

If using the HTTP/HTTPS protocol, or any other protocol that uses username/password credentials, configure Git Credentials Storage to select a suitable source of credentials for your environment.

Modules in Package Sub-directories

When the source of a module is a version control repository or archive file (generically, a "package"), the module itself may be in a sub-directory relative to the root of the package.

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. For example:

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 arguments:

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 a sub-directory of a package to use a local path to another module as long as it is in the same package.

About

modules terraform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages