Automate ECS Blue/Green Deployments with GitHub Actions and OIDC

In this build session, I connect the ECS blue/green deployment setup from the previous video with a GitHub Actions CI/CD pipeline using OIDC federation — no AWS access keys. In the last video, we built native ECS blue/green deployments on Fargate with Terraform — dual ALB listeners, a bake period, and zero-downtime traffic shifting. But triggering a deploy meant building the image locally, updating tfvars, and running terraform apply by hand. In this session, a push to main handles everything automatically. 🧱 What We're Building A GitHub Actions pipeline that builds, pushes, and deploys on every push to main: ➜ OIDC federation — short-lived AWS credentials, no stored secrets ➜ Docker image built and pushed to ECR with commit SHA tag ➜ terraform apply triggers the ECS blue/green deployment ➜ services-stable wait confirms deployment completes before pipeline exits ➜ S3 backend for Terraform state with native locking git push → GitHub Actions → OIDC → AWS STS → ECR push → terraform apply → Blue/Green deploy 🔍 What We Covered ✅ S3 backend with use_lockfile for Terraform state in CI ✅ OIDC provider + trust policy scoped to a single repo and branch ✅ GitHub Actions workflow: build, push to ECR, terraform apply ✅ Passing container_image as a -var to Terraform from CI ✅ aws ecs wait services-stable for deployment confirmation ✅ Lifecycle ignore_changes to prevent CI from reverting listener targets ✅ Full cleanup: OIDC role, ECS infra, S3 state bucket 🧩 Why This Matters ➜ No access keys stored in GitHub — OIDC handles auth at runtime ➜ App changes and infra changes flow through the same pipeline ➜ Commit SHA tags give full traceability from Git to running container ➜ Rollback = git revert + push — the pipeline handles the rest ➜ Same blue/green, fully automated Full blog + code walkthrough: https://brainyl.cloud/ecs-blue-green-... — Build with Brainyl

Read The Korea Economic Daily in 30 Minutes | 20260511🌞#MorningRoutine
▶︎

Read The Korea Economic Daily in 30 Minutes | 20260511🌞#MorningRoutine

Internship 1 Project | IITG | Aryan Chauhan
▶︎

Internship 1 Project | IITG | Aryan Chauhan

Complete GitHub Actions Course - From BEGINNER to PRO
▶︎

Complete GitHub Actions Course - From BEGINNER to PRO

Serve ECS Fargate Traffic Through CloudFront with a Custom Domain, TLS, and Route 53
▶︎

Serve ECS Fargate Traffic Through CloudFront with a Custom Domain, TLS, and Route 53

DAY 1 Morning Session: Roadmap to Data Science & AI | Python Programming
▶︎

DAY 1 Morning Session: Roadmap to Data Science & AI | Python Programming

How To Think SO CLEARLY People Assume You're A Genius
▶︎

How To Think SO CLEARLY People Assume You're A Genius

Improve Developer Workflow with ECS Multi-Service Deployment Using AppConfig and GitHub Actions
▶︎

Improve Developer Workflow with ECS Multi-Service Deployment Using AppConfig and GitHub Actions

Build and Validate a Production-Ready AWS VPC with IPAM, Regional NAT Gateway, and Elastic Beanstalk
▶︎

Build and Validate a Production-Ready AWS VPC with IPAM, Regional NAT Gateway, and Elastic Beanstalk

Keynote: After the AI Hype – What’s Real, and What’s Next - Richard Campbell - 2026
▶︎

Keynote: After the AI Hype – What’s Real, and What’s Next - Richard Campbell - 2026

GitHub Actions - Environments
▶︎

GitHub Actions - Environments

Billionaire's WARNING: I'm SELLING. The Crash Is Already Here!
▶︎

Billionaire's WARNING: I'm SELLING. The Crash Is Already Here!

Inside Anthropic, the $965 Billion AI Juggernaut | The Circuit
▶︎

Inside Anthropic, the $965 Billion AI Juggernaut | The Circuit

ASMR Addictive Fast Tapping Collection For Deep Sleep & Anxiety Relief (No Talking) — 2.5 Hours
▶︎

ASMR Addictive Fast Tapping Collection For Deep Sleep & Anxiety Relief (No Talking) — 2.5 Hours

تلاوة القرآن للدراسة والتركيز 📚🕛 | راحة وطمأنينة | Peaceful Focus Quran | محمد هشام
▶︎

تلاوة القرآن للدراسة والتركيز 📚🕛 | راحة وطمأنينة | Peaceful Focus Quran | محمد هشام

Backend web development - a complete overview
▶︎

Backend web development - a complete overview

But what is the Fourier Transform?  A visual introduction.
▶︎

But what is the Fourier Transform? A visual introduction.

Build & Deploy ML Churn model with FastAPI, MLFlow, Docker, & AWS
▶︎

Build & Deploy ML Churn model with FastAPI, MLFlow, Docker, & AWS

Multi-Service ECS: Split Ghost and Webhooks with Cloud Map and Route 53 Service Discovery
▶︎

Multi-Service ECS: Split Ghost and Webhooks with Cloud Map and Route 53 Service Discovery

NestJS Full Course for Beginners in 2026 | Build a Production-Ready API
▶︎

NestJS Full Course for Beginners in 2026 | Build a Production-Ready API

Andrej Karpathy: From Vibe Coding to Agentic Engineering w/ Stephanie Zhan
▶︎

Andrej Karpathy: From Vibe Coding to Agentic Engineering w/ Stephanie Zhan