Demo cats and dogs
Tags: aws
Published: 2021-06-21 19:44:05

# About
We will manage Docker images of cats and dogs in Amazon ECR.
Create Amazon ECS cluster, task definitions, and services.Choose right launch type either EC2 or Fargate for each service. Deploy simple containerized application cats and dogs path-routed through ALB. Monitor ECS cluster and services in Amazon CloudWatch Container Insights. Centralize container logs using AWS FireLens and Amazon CloudWatch Logs. Scale ECS services and cluster automatically.
Read more:https://ecs-cats-dogs.workshop.aws/en/01_intro.html

# IAM role created - Administrator access.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o24s5ih8wflazl8ssfrw.PNG
) 

# Cloudformation stack created.
Region: ap-northeast-2
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/71x9w4ufx6vedses0eyu.PNG)

# What we will do.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3vhuw3fyiyrp80vispwp.PNG)

Create Amazon ECR cats, dogs repositories.
build and tag cats, dogs docker images from AWS Cloud9 IDE.
Push the images to Amazon ECR.


# AmazonEC2ContainerRegistryFullAccess policy attached to ecs-demogo
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/acrekt6crqy84wx1au4f.PNG)

# Cloud9 instance attached ecs-demogo IAM role.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdw15v74n0wy3d6363fw.PNG)

# AWS managed credentials turned off in Cloud9.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t3g1fp3xrso1kz44gcrd.PNG)

# GetCallerIdentity command ran.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ri39q42t48samhct0b8t.PNG)

# Updated and installed CLI tools
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7s4iv6ieocus7d11l2p.PNG)

# Current region set as default.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oqikzicf5nvnberqv8oe.PNG)

# Cats, Dogs repository created in ECR.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5s5m4fgl6i8xk1iyo2sh.PNG)

# cats image built with Dockerfile.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/byrovshalc1ypovsxr0h.PNG)

# dogs image built with Dockerfile.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kt781i82ipkcv98p7ot9.PNG)

# cats image pushed to ECR repository.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5o7vsccdsj4lhtjkhyjn.PNG)

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

# Cats image in ECR.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vxnf409ha5czkv89f82f.PNG)

# Dogs image in ECR.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5182la1wzfbg2j5z5rj7.PNG)

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

# IAM policy attached to ecsInstancerole
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zadhqbkyviuxp8jo54s1.PNG)

# Task definition created.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qqaltsmu2zryrf76goph.PNG)

# catsdef,dogsdef created.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/01iicrjghkpscqf1xd7x.PNG)

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

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

# Cats services created.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59i7qpypu17uu2drr6io.PNG)

# Dogs service created.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bsovu56vnijieyklm7cm.PNG)

# Failed to load application
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6o45jjvs2g6srcfsin2a.PNG)

# Failure reason
Task did not run properly.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/drnbzni2a47bjd44m30j.PNG)