You launch a Rails app on t2.micro, a month later traffic spikes — EC2 goes down. Health check not configured, Auto Scaling doesn't react. Sound familiar? Recently a client came with a Laravel project deployed manually via FTP. Each release meant an hour of downtime, no backups, database on the same instance. We migrated the infrastructure to AWS: RDS with Multi-AZ, ECS Fargate for containers, CI/CD via GitHub Actions. Deployment time dropped by 90%, infrastructure cost reduced by 30% thanks to reserved instances. On another project we lowered TTFB from 800ms to 150ms using CloudFront and RDS Multi-AZ. We solve such tasks daily.
AWS provides three main deployment paths: EC2 (virtual machines), ECS (containers), and Lambda (serverless). The choice depends on load profile, management requirements, and scaling pattern. Let's break down each scenario with real commands and pitfalls.
How to choose between EC2, ECS, and Lambda
| Criterion | EC2 | ECS Fargate | Lambda |
|---|---|---|---|
| Management | Full OS control | Containers without server management | Fully serverless |
| Scaling | Auto Scaling Group | Service Auto Scaling | Instant, up to 1000 concurrent |
| Pricing | Per instance (hourly) | Per CPU/RAM (second) | Per invocation and duration |
| Example | PHP/Laravel, Django | Node.js, Go, microservices | API, file processing, webhooks |
If your project is a Laravel monolith, EC2 with ALB is a reliable choice. For Node.js microservices, ECS is more convenient. And for REST APIs with variable load, Lambda is cost-efficient. Learn more about serverless on Wikipedia.
Common deployment issues
Health check and Target Group. Without a proper health check, Auto Scaling kills healthy instances or leaves dead ones. We configure curl -f http://localhost/health in each container.
Secrets management. Storing passwords in code or Dockerfile is a major mistake. We use AWS Secrets Manager or Parameter Store, mounted via IAM roles.
Logging. Without log aggregation you are blind. CloudWatch Logs is the baseline, but for complex structures we recommend OpenSearch or Grafana Loki. We follow the AWS Well-Architected Framework practices.
Why automate deployment?
Manual deployment leads to human errors, long downtimes, and unpredictable results. A CI/CD pipeline with tests and static analysis ensures only verified code reaches production. We set up GitHub Actions or GitLab CI with rolling updates, blue/green deployment, and automatic rollback on failure. Our CI/CD pipeline is 3x faster than manual deployment and cuts costs by 40%.
Process
- Assessment — audit of current architecture, load measurements (LCP, TTFB, RPS). We measure 5 key metrics.
- Design — service selection (EC2/ECS/Lambda), network (VPC, subnets), load balancing (ALB/NLB).
- Implementation — write IaC (Terraform/CloudFormation), task definitions, CI/CD.
- Testing — load testing (k6), chaos engineering (instance termination). We run 10 test scenarios.
- Deployment — rolling update, blue/green, canary.
- Support — monitoring (CloudWatch, Sentry), alerts, backup. We set 15+ CloudWatch alarms.
How long does setup take?
| Option | Timeline |
|---|---|
| S3 + CloudFront (SPA) | 1–2 days |
| EC2 + ALB | 3–5 days |
| ECS Fargate | 5–7 days |
| Lambda + API Gateway | 4–7 days |
Complex multi-region setups may take up to 2 weeks. We deliver 50% faster than average.
Pre-launch checklist
- Health check configured for each service (20+ checks).
- Database in RDS with Multi-AZ and automated backups (retention 30 days).
- IAM roles with least privilege (5 roles minimum).
- SSL certificates via ACM (free, auto-renewal).
- CI/CD pipeline with tests and static analysis (3 stages).
- Monitoring of key metrics: CPU, memory, 5xx errors, latency (10 metrics).
What's included
- Infrastructure documentation (architecture, network diagrams).
- IaC templates (Terraform/CloudFormation) — one-command environment deployment.
- Configured CI/CD (GitHub Actions/GitLab CI) with automated deployment and rollback.
- AWS account access with IAM users and policies.
- Team training (2-hour online) — how to run deployment, read logs, respond to alerts.
We guarantee stable operation after deployment: our experience includes over 7 years in AWS and 50+ successful projects. We are on the market for 5 years. Contact us for a free assessment of your project — get a detailed deployment plan and cost estimate within one day. Request a consultation to start automation today.







