Alpha
The aws-ia Terraform standards are updated often. Please be sure to refer to this document often to keep updated!
Root module: Every Terraform configuration has at least one module, typically known as its root module. In the case of aws-ia modules, the root module is always meant to be made up of reuseable modules or build blocks.
Child modules: A module that has been called by another module is often referred to as a child module.
Types of reuseable aws-ia Modules:
../terraform-partnername-productname
├── LICENSE
├── NOTICE.txt
├── deploy
│ └── main.tf
├── main.tf
└── setup_workspace
├── variables.tf
└── workspace.tf
File: deploy/main.tf
# Example deployment using Terraform Cloud
# Defaults to TFC for remote backend
terraform {
backend "remote" {}
required_version = ">= 1.0.5"
}
# Use baseline VPC from aws-ia registery
<REPLACE ME!>
# Deploys example workload instance via root module
module "workload" {
source = "../"
# interface to be defined
#
}
File: /main.tf
# Root Module
# No backends should be defined by default in Root Module
# This module is intended to be called by one or more other modules and must not contain any provider blocks
File: /setup_workspace/
Creates the Terraform workspace in TFC. See the registry for more information.
Local: Write Terraform state and configuration to local working directory.
Terraform Cloud (TFC): Writes Terraform state and configuration to remote TFC workspace and stream it locally
For more into in how to setup TFC Workspace refer to the cloud_workspace module
Binary version: >= 1.0.5
Provider Version: ~> v3.58.0
Module /main.tf
must not contain provider block definitions.
Deploy example /deploy/main.tf
- When creating an example Terraform Cloud deployment for the module are creating refer to the source directly.
module "self_deployment_example" {
source = "../"
}
module "vpc" {
source = "aws-ia/vpc/aws"
version = "0.0.2"
}