POC Overview

A production-grade Laravel application on AWS ECS Fargate — demonstrating cloud-native architecture, CI/CD pipelines, async processing, and multi-environment deployments.

🏷️ Version dev 🌍 Environment: staging ☁️ AWS ECS Fargate · us-west-2 🔒 HTTPS · poc-clust.kaiac.io
🏗️ Architecture

All services run as serverless containers on AWS ECS Fargate — no EC2 instances to manage. Traffic flows through an Application Load Balancer with HTTPS termination.

🌐

Web Application

  • Laravel 11 + PHP 8.3
  • nginx + php-fpm via supervisord
  • ECS Fargate (512 CPU / 1024 MB)
  • ALB → HTTPS → Route53 (kaiac.io)
🗄️

Database

  • MySQL 8.0 on ECS Fargate
  • Service Discovery DNS (mysql.laravel.local)
  • Private subnet, no public access
  • Credentials via SSM Parameter Store
📬

Async Worker

  • Dedicated ECS Fargate worker service
  • Consumes SQS queues (default + priority)
  • ProcessTaskJob dispatched on task creation
  • Updates processed_at on completion
🔒

Security

  • Secrets in AWS SSM Parameter Store
  • Private subnets + NAT Gateway
  • ACM certificate (TLS 1.3)
  • Trivy CVE scan on every build
🔄 CI/CD Pipelines

Three dedicated CodePipeline pipelines handle the full lifecycle — from code commit to production deployment. The staging image is promoted to production without rebuild.

Staging
📦 Push staging
🔨 Docker build
🛡️ Trivy scan
✅ Deploy staging
Tag
🖱️ Manual trigger
🏷️ Retag staging-sha → v1.x.x
📦 ECR v1.x.x
Production
🖱️ Manual (IMAGE_TAG=v1.x.x)
📋 New ECS task def
🚀 Deploy prod

Dashed borders = manual trigger. The release script scripts/release.sh v1.x.x automates the merge, Git tag, and tag pipeline launch.

🌍 Environments

Two fully isolated environments sharing the same ECS cluster and ECR repository, with separate ALBs, databases, SQS queues, and SSM parameters.

🚀

Production

  • poc-clust.kaiac.io
  • Image tags: v1.x.x (semver)
  • Deployed manually via pipeline
  • APP_ENV = production
🧪

Staging

  • poc-clust-staging.kaiac.io
  • Image tags: staging-<sha>
  • Auto-deployed on push to staging branch
  • APP_ENV = staging, APP_DEBUG = true
⚙️ Tech Stack

Every component chosen for reliability, observability, and developer experience.

Component Technology Category Details
Web frameworkLaravel 11AppPHP 8.3, Eloquent ORM, Queue system
Container runtimeAWS ECS FargateAWSServerless, awsvpc networking
Container registryAWS ECRAWSLifecycle policy: keep last 10 images
Load balancerAWS ALBAWSHTTPS, TLS 1.3, health checks on /up
DNS + TLSRoute53 + ACMAWSkaiac.io zone, DNS validation
DatabaseMySQL 8.0InfraECS Fargate + Service Discovery
Message queueAWS SQSAWSdefault + priority queues, long polling
SecretsAWS SSMSecurityAPP_KEY, DB_PASSWORD, SQS params
CI/CDAWS CodePipelineAWS3 pipelines: staging, tag, prod
BuildAWS CodeBuildAWSDocker multi-stage, composer update
Security scanTrivySecurityCVE scan, SARIF reports in S3
Source controlBitbucketInframain + staging branches, semver tags
Infrastructure as CodeTerraformInfra~10 .tf files, all resources managed
NetworkingAWS VPCAWSPublic/private subnets, NAT Gateway