This section presents the configuration steps for VPC, Target Group, ALB, and Security Group in the network layer.

lunchsync-vpc, use CIDR 10.0.0.0/16, and create 2 AZs, 2 public subnets, and 2 private subnets.
None, enable the S3 Gateway Endpoint, and keep Enable DNS hostnames / DNS resolution turned on so private subnets can still reach S3.


lunchsync-tg-backend, and use protocol HTTP on port 8080.
lunchsync-vpc, keep Protocol version = HTTP1, and set the health check path to /health.

HTTP:8080, health check on traffic-port, path /health, and success code 200.
lunchsync-tg-backend exists and currently has no registered targets.


lunchsyn-alb, choose Internet-facing, and keep IPv4.
lunchsync-vpc and attach the ALB to the two public subnets lunchsync-subnet-public1 and lunchsync-subnet-public2.
HTTP:80 with the action Redirect to HTTPS and status code 301.
HTTPS:443 and forward its default action to lunchsync-tg-backend.
lunchsync.space and keep the recommended security policy.

80 -> 443, and 443 -> lunchsync-tg-backend, then create the load balancer.
HTTP:80 redirects and HTTPS:443 forwards correctly.



backend-sg in lunchsync-vpc, allow inbound Custom TCP 8080 from the ALB/CloudFront security group, and keep outbound All traffic.
redis-sg and make sure it only allows TCP 6379 from backend-sg.
rds-sg and make sure it only allows PostgreSQL 5432 from backend-sg.
backend-sg, redis-sg, rds-sg, and the default groups inside the VPC.