Terraform Modules Overview
Terraform modules are the best way to encapsulate “business logic” and “Best Practices” for provisioning infrastructure.
Terraform modules are the best way to encapsulate “business logic” and “Best Practices” for provisioning infrastructure. Terraform modules are used almost like functions in
terraform; that is, they take inputs (aka
variables) and produce some
- Easily version pin infrastructure
- Useful for staging changes across infrastructure
- Public module registry makes it easy to find modules
- Distributed using
Here are some perfect examples of highly reusable, composable terraform modules:
terraform-aws-key-pair- Automatically Generate SSH Key Pairs (Public/Private Keys)
terraform-aws-rds- Provision an RDS instance along with subnets, security groups and hostname
terraform-aws-s3-log-storage- create an encrypted S3 bucket with log retention policies. It’s suitable for receiving logs from other AWS services such as S3, CloudFront, and CloudTrails.
countparameter cannot be used on modules
- Cannot pass modules as inputs to other modules