Three-Tier Architecture Security
Step 1: Create Web Tier Security Group
module "web_sg" {
source = "registry.patterneddesigns.ca/patterneddesigns/security-group/aws"
version = "1.2.0"
name = "web-tier"
vpc_id = module.vpc.vpc_id
ingress_rules = [
{
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
]
}
Step 2: Create Application Tier
Allow traffic only from the web tier.
Step 3: Create Database Tier
Allow traffic only from the application tier.