Skip to content

abiydv/aws-cf-ecs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

AWS ECS Fargate Cluster

CodeFactor

cli cf iam as cwe ecsf elb cw

Use this template to create a ECS (Fargate backed) cluster with load balancer, IAM role, autoscaling policies etc.

Prerequisites

Create the VPC using vpc-stack template. This template reads the exported values from the vpc-stack. It launches the load balancer in public subnets and ECS Containers in the private subnets.

Architecture

A simplified view of the architecture is as follows - arch

How to use

Checkout the repository and execute from cli. Remember to select the correct profile

aws cloudformation validate-template --template-body file://ecs-stack.yaml \
  --profile aws-dev-account --region us-east-1 

This should display the parameters - validating the template syntax is fine. Next, create the stack

aws cloudformation create-stack --stack-name ecs-stack --template-body file://ecs-stack.yaml \
  --profile  aws-dev-account --region us-east-1

Or, copy the template and create the stack from Cloudformation console.

Alternative

You could also create the same set of resources using Terraform, if you prefer. Take a look at my Terraform repo

Contact

Drop me a note or open an issue if something doesn't work out.

Cheers! 👍