Automated Terraform IaC Modules
Highly secure, modular Infrastructure as Code (IaC) architectures for AWS. Deploys standard multi-tier VPCs, Auto Scaling Groups, S3 buckets, and IAM roles using custom-built HCL modules with robust locking backends.
π‘ What We Will Learn in This Repo
-
Modular HCL Code structuring
Construct highly customizable Terraform modules exposing defined variables and output values for external compositions.
-
Encrypted Remote State backends
Learn to store resource state logs securely using KMS encrypted S3 buckets in AWS.
-
Dynamic DynamoDB State Locking
Assert DynamoDB tables to lock state maps during execution, preventing write conflicts across team deployments.
-
High-Availability Auto Scaling Groups
Provision VPC components alongside Auto Scaling groups to scale web applications dynamically across multiple zones.
π Step-by-Step Installation Guide
Fetch the repository to your local workspace:
git clone https://github.com/Pradeeptalari14/terraform-aws-modules.git
cd terraform-aws-modules
Before applying resources, deploy the state storage S3 and DynamoDB table (configurations inside `backend-bootstrap/` folder):
cd backend-bootstrap
terraform init
terraform apply -auto-approve
cd ..
Configure backend references and download provider binaries for modules:
terraform init
Assert syntactic correct mappings and deploy the resources:
terraform validate
terraform plan -out=tfplan
terraform apply tfplan
π Things You Need to Replace (Customization Checklist)
Adapt module parameters inside tfvars to target your specific deployment namespaces:
| Target Element | File Location | Placeholder / Parameter key |
|---|---|---|
| globally Unique S3 Bucket | providers.tf / backend-bootstrap/main.tf |
bucket = "your-tfstate-bucket-name" (must be unique) |
| DynamoDB Table Name | providers.tf / backend-bootstrap/main.tf |
dynamodb_table = "terraform-locks" (locking lock key) |
| VPC IP Range mappings | terraform.tfvars |
vpc_cidr = "10.0.0.0/16" (adjust subnets scope) |
| Allowed SSH IP scope | terraform.tfvars |
allowed_ssh_cidr = ["0.0.0.0/0"] (narrow for security) |
π Architectural Workflow
π οΈ Useful Commands (Project Reference)
Common CLI tasks for validating HCL infrastructure files:
# Format code stylings recursively:
terraform fmt -recursive
# Verify syntax configurations:
terraform validate
# Inspect resource states list:
terraform state list
# Cleanly tear down resources:
terraform destroy -auto-approve