This is a small demo application for an ECS 101 talk that I gave @ AWSMeetupGroup. Here is the recorded video of the talk.
- The Demo Application code resides in
app/
and was originally copied from awesome-compose, specifically the React, Express, Mongo example. It has been slightly adapted for this example. - The Infrastructure as Code for this example has been written in Terraform and resides in
terraform/
. - The Task Definitions for the 3 services have been pulled down and shared in
task_definitions/
.
- Terraform v0.12.25
- Docker + Compose
- An AWS Account + AWS IAM Credentials
Execute the following commands and tasks to spin up this ECS project in your own AWS account:
cd ./terraform
- Update
root.auto.tfvars
with your own values terraform init
terraform plan -out=run.plan
- Check out this commands plan output to make sure it fits what you want to deploy
terraform apply run.plan
- Repeat the previous two steps until you don't have any apply errors (Terraform typically ain't perfect 😅)
- Copy down the two ECR endpoints that Terraform outputs
export FRONTEND_ECR_URL=$(terraform output frontend_repo_url)
export BACKEND_ECR_URL=$(terraform output backend_repo_url)
- Build and push the Frontend image:
cd ../app/frontend
docker build -tag $FRONTEND_ECR_URL:latest .
docker push $FRONTEND_ECR_URL
- Build and push the Backend image:
cd ../app/backend
docker build -tag $BACKEND_ECR_URL:latest .
docker push $BACKEND_ECR_URL
- Sign into the AWS console and check out the app running in ECS!
- Your app should also be running @
ecs101.${var.domain}