DevOps Architecture
Managing Multi-Region AWS Infrastructure with Terraform
Ryan•Lead Architect•
The Danger of ClickOps
Manually configuring cloud infrastructure via the AWS Console is a recipe for disaster. Environments drift, configurations are forgotten, and disaster recovery is impossible.
Infrastructure as Code (IaC) is the solution. At Slickrock, we define every cloud resource using Terraform.
Reusable Terraform Modules
We build reusable modules for common architecture patterns. For example, deploying a highly-available RDS database:
module "db" {
source = "terraform-aws-modules/rds/aws"
version = "~> 6.0"
identifier = "enterprise-prod-db"
engine = "postgres"
engine_version = "15"
instance_class = "db.t4g.large"
allocated_storage = 100
multi_az = true
vpc_security_group_ids = [aws_security_group.db.id]
subnet_ids = module.vpc.database_subnets
}
The Workflow
- Code: Infrastructure changes are submitted via Pull Request.
- Plan: CI runs
terraform planto show exactly what resources will be created/destroyed. - Apply: Upon approval,
terraform applyexecutes the changes.
This guarantees that our Staging and Production environments are 100% identical, eliminating "it works in staging" bugs.