This repository provides a single, well-tested Bash script (`ecs-deploy`) that automates blue/green deployments on AWS ECS. It fetches the current task definition, creates a new revision with an updated Docker image tag, registers it, updates the ECS service (or directly runs a task), and waits for the deployment to complete. The script handles various edge cases: image name parsing (including domain, port, repository, tag, digest, and ECR-style URLs), role assumption, rollback, and cleaning up old task definition revisions. It is packaging-ready as a Docker image and includes a GitHub Action for CI/CD pipelines. The codebase is in maintenance-only mode but remains fully functional and widely used. Its primary reuse pattern is the standalone shell script itself—downloadable and integrable into any deployment pipeline. A hidden gem is the `parseImageName` function, which implements robust Docker image name parsing via regex and environment variable overrides, and the test suite (`test.bats`) demonstrates a clean pattern for unit-testing Bash functions while mocking external dependencies.
This repository contains a full-stack web application deployed on AWS ECS with a CI/CD pipeline. The frontend is a Vue.js application that retrieves product data from a backend Node.js/Express API. The backend scans a DynamoDB table and returns product information, including image URLs stored in S3. Infrastructure is provisioned via Terraform, including networking, ECS cluster/services, ECR repositories, IAM roles, CodePipeline/CodeBuild/CodeDeploy for Blue/Green deployments, autoscaling, and supporting resources (S3, DynamoDB, SNS). The architecture separates concerns with modular Terraform modules and implements production-grade practices like health checks, Swagger documentation, and stress testing.