Skip to content

Terraform module template following Standard Module Structure.

License

Notifications You must be signed in to change notification settings

roshaaaan/template-terraform-module

 
 

Repository files navigation

template-terraform-module

Terraform Actions Status Shell Script Actions Status Markdown Actions Status YAML Actions Status JSON Actions Status GitHub tag License

Terraform module template following Standard Module Structure.

Usage

Named terraform-<PROVIDER>-<NAME>. Module repositories must use this three-part name format.

curl -fsSL https://raw.githubusercontent.com/tmknom/template-terraform-module/master/install | sh -s terraform-aws-sample
cd terraform-aws-sample && make install

Examples

Requirements

Write your Terraform module requirements.

Providers

Write your Terraform module providers.

Inputs

Write your Terraform module inputs.

Outputs

Write your Terraform module outputs.

Development

Development Requirements

Configure environment variables

export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export AWS_DEFAULT_REGION=ap-northeast-1

Installation

git clone [email protected]:tmknom/template-terraform-module.git
cd template-terraform-module
make install

Makefile targets

apply-complete                 Run terraform apply examples/complete
apply-minimal                  Run terraform apply examples/minimal
check-format                   Check format code
clean                          Clean .terraform
destroy-complete               Run terraform destroy examples/complete
destroy-minimal                Run terraform destroy examples/minimal
diff                           Word diff
docs                           Generate docs
format                         Format code
help                           Show help
install                        Install requirements
lint                           Lint code
plan-complete                  Run terraform plan examples/complete
plan-minimal                   Run terraform plan examples/minimal
release                        Release GitHub and Terraform Module Registry
upgrade                        Upgrade makefile

Releasing new versions

Bump VERSION file, and run make release.

Terraform Module Registry

License

Apache 2 Licensed. See LICENSE for full details.

About

Terraform module template following Standard Module Structure.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 43.6%
  • Makefile 38.1%
  • HCL 18.3%