Lightpress manages all of its AWS infrastructure as code using AWS CloudFormation. Every resource the platform depends on — VPCs, load balancers, ECS clusters, RDS databases, S3 buckets — is declared in YAML templates stored inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/reds-skywalker/Lightpress/llms.txt
Use this file to discover all available pages before exploring further.
infraestructure/cloudformation/. This means your infrastructure is reproducible, version-controlled, and reviewable in pull requests just like application code.
The directory name is spelled
infraestructure/ (matching the repository). This is intentional — keep this spelling consistent when referencing the path in scripts, CI pipelines, and documentation to avoid broken references.Directory structure
What CloudFormation manages
CloudFormation templates in Lightpress define the following resource categories:Networking (VPC, subnets, security groups)
Networking (VPC, subnets, security groups)
The
network.yml template creates:- A VPC with public and private subnets across two or three Availability Zones
- An Internet Gateway and NAT Gateways for outbound traffic from private subnets
- Security groups that enforce least-privilege access between tiers (ALB → ECS → RDS)
- VPC endpoints for S3 and other AWS services to avoid traffic traversing the public internet
Compute (ECS, ECR)
Compute (ECS, ECR)
The
ecs-cluster.yml and services.yml templates define:- An ECS cluster (Fargate launch type — no EC2 instances to manage)
- Task definitions for each microservice, including CPU/memory limits, container image URIs from ECR, environment variable injection from Secrets Manager, and the
awslogslog configuration - ECS services with desired task counts and auto-scaling policies
- ECR repositories where Docker images are pushed by the CI pipeline
Database (RDS)
Database (RDS)
The
database.yml template provisions:- An Amazon RDS instance (PostgreSQL) in a private subnet group
- A Multi-AZ standby for production environments
- Automated backups with a configurable retention period
- A Secrets Manager secret for the database credentials, rotated automatically
Storage (S3)
Storage (S3)
The
storage.yml template creates S3 buckets for:- Application file uploads (user avatars, documents)
- CloudFront origin for the static client build
- CodeBuild artefact storage for the CI/CD pipeline
Load balancing (ALB)
Load balancing (ALB)
The
alb.yml template defines:- An Application Load Balancer in the public subnets
- HTTPS listener with an ACM certificate
- Listener rules that route traffic to each microservice by path prefix (e.g.,
/auth/*→ auth service,/users/*→ users service) - A separate internal ALB for service-to-service traffic that never leaves the VPC
CI/CD pipeline (CodeBuild, CodePipeline)
CI/CD pipeline (CodeBuild, CodePipeline)
The
cicd.yml template provisions the build pipeline. The buildspec.yml in the repository root defines the build steps that CodeBuild executes. Together they automate image builds, ECR pushes, and ECS deployments on every merge to main.Infrastructure as code workflow
Edit a template
Make changes to the relevant YAML file in
infraestructure/cloudformation/. Use CloudFormation’s Ref and !Sub intrinsic functions to reference other resources rather than hard-coding IDs or ARNs.Preview changes with a change set
Create a change set to see exactly which resources will be added, modified, or replaced before you apply anything.
Environments
Lightpress supports three environments. Each environment is a separate set of CloudFormation stacks, deployed with different parameter values.Development
Runs locally via Docker Compose. No AWS infrastructure is required unless you are testing AWS-specific integrations (SQS, S3, etc.) — use LocalStack for those.
Staging
A full AWS deployment using the same CloudFormation templates as production, but with smaller instance sizes and a
staging parameter prefix. Deploy here first to validate infrastructure changes.Production
Multi-AZ, auto-scaling, with RDS Multi-AZ enabled and CloudWatch alarms configured. Only promoted artefacts from the staging pipeline reach production.
Environment parameter to the CloudFormation deploy command:
Useful AWS CLI commands
List all Lightpress stacks
List all Lightpress stacks
Describe stack events (for debugging a failed deploy)
Describe stack events (for debugging a failed deploy)
Get a stack output (e.g., ALB DNS name)
Get a stack output (e.g., ALB DNS name)
Delete a staging stack
Delete a staging stack
DeletionPolicy: Retain on critical resources will leave those resources in place after stack deletion.