This document will provide you all the details how to configure the github actions to deploy the ECS Service using terraform
In this workflow, we will deploy an ECS service using following AWS resources
- VPC
- Security Groups
- ECS Cluster
- ECS Service
- Application Load Balancer
- IAM Role
- Task Definition for ECS Service
- Target Groups for ALB
- Get the loadbalancer DNS name
- Open it in the browser `http://DNSName/LoginWebApp-1
To have basic understanding of Github actions, please follow Github Action Basic Video
To have basic understanding of terraform Deployment using Github actions, please follow Terraform Deployment using Github Actions
- Use a build matrix if you want your workflow to run tests across multiple combinations of operating systems, platforms, and languages.
- Use of matrix to run the workflow for different environments or even you can set different variables as per the environment if needed
- Connect to AWS account using Github secrets
- Use of
workflow-dispatch
to trigger the workflow manually - Use of
max-parallel
to run the job for both the environments in parallel - Set working directory to any of your subfolder
- Use of Environments in the workflow to approve the changes for higher environments if needed.
We will be applying the changes only when there is a push in the main branch.