Devops-ecs-fargate-terraform
Published: 2021-06-11 11:14:33

# About
This workshop enables hands-on experience using Terraform with AWS Continuous Integration and Continuous Delivery (CI/CD) tools to deploy workloads to Amazon ECS and AWS Fargate.

Read more: https://devops-ecs-fargate.workshop.aws/en/

# Admin role created in IAM

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l83ixiqnqrqiu7gkdl5m.PNG)

# workshop-admin role attached to Cloud9 EC2 instance

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9h812u0ng89q11ezih8o.PNG)

# AWS managed temporary credentials disabled from Cloud9

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pk7237pcjy0l9u5eihxw.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jew46ow5cmcy5k2oiev1.PNG)

# Verified IAM role 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sb1sxynq0qgfx4lpcd6i.PNG)

# Download and unzip
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w0x9r5qnysqvswc6pmrc.PNG)

# Verified terraform path
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qmgc7qfegfno3om94kyl.PNG)

# Text utilities installed
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/00l8vsdfb4jzks6q8pfs.PNG)

# Configured the AWS cli with our current region as default
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lqseo5nv7wx4497v5qck.PNG)

# Setup environmeent variables for account Id
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6wrbx0s4tmic9wv4tyn.PNG)

# Downloaded workshop resources
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lt1anpbz004pe1002tx.PNG)

# Setup SSM parameter store password for DB
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7t6roa0dkza11cxnaewi.PNG)

# Edited terraform.tfvars
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/juc2r8k11adqmgi8p8bw.PNG)

# Terraform init
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lj90g23bgf03i2lgqtg.PNG)

# Built the infrastructure
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hlce1iy82crend9x66e5.PNG)

# ALB 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wy38m0ompel68jm45c97.PNG)

# ECS cluster
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fivz76jjcoi9b65winkd.PNG)

# ECR repository
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nic4kq0gnj7778izpu5h.PNG)

# CodeCommit Repo
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmng3a0ikbtuc2vj63lv.PNG)

# CodeBuild Repo
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w697n49pli4pnm1xj8ia.PNG)

# CodePipeline in failed state
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2tg44ja8cf2zkf4l9x6z.PNG)

# Local Git setup
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0rt55idj55elmmjyqct7.PNG)

# Setting remote repo
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6058or4c1r8w713d9th.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1mrycfv7kdzrv3w8lnyb.PNG)

# Code push to remote repo - pipeline started
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l72xxiemlrgu3x09bt8m.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/orp047w0yweiz9n7tfno.PNG)

# ALB address retrieved from Terraform
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3qe9su79qe5suqg849a.PNG)

# Pet clinic app viewed from browser with ALB address
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ewsvwvlwib9yk13jqw5.PNG)

# Welcome string changed
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/29ualzlb9cza8nt9yee6.PNG)

# Changed code pushed to pipeline
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ppex8329p8gqr621k6tg.PNG)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9ws61yyiyt4q0cnsucb.PNG)

# Cleanup

All resources terminated.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/85uakn1s061xnamyoia3.PNG)


# Bucket deleted
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zh22jswl9cffzfizjsgp.PNG)