This project leverages Terragrunt, Terraform, and GitHub Actions to deploy a basic web app (dockerized JS frontend and dockerized Python API) to AWS ECS.
See this article for more information: https://camillovisini.com/article/terragrunt-github-actions-aws-ecs/
Ensure the following secrets are provided in the repository settings:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION
~/terragrunt-ecs$ make
Usage:
make
Development
dev Run docker-compose
git-hooks Set git hooks path to ./hooks
Manual Terragrunt Operations
init Run terragrunt init
apply Run terragrunt apply
destroy Run terragrunt destroy
push-images Build and push images to ECR
Helpers
help Display this help
# make git-hooks
make dev
make init
make push-images
Subsequent push to branch will trigger deployment via GitHub Actions:
- Branch
dev
will deploy tostage
environment - Branch
main
will deploy toprod
environment
Besides GitHub Actions, deployments can be managed manually. Configure additional Makefile targets to manually manage deployments as your application scales across environments, regions, accounts, or includes additional services or data providers. For this repository, common targets are listed below.
Change infrastructure:
# after changes in ./terraform/*
make apply
Change codebase and deploy to infrastructure:
# after changes in ./containers/*
make push-images
make apply
Destroy infrastructure:
# after infrastructure is no longer required
make destroy