Cloud Formation Templates for Deploying Fargate Tasks in a VPC on a Public Subnet

I have built the below architecture using Cloud Formation Network and Fargate Service Stacks Templates

fargate.png

Step-00: Template Categories

I'm going to divide templates into two categories

  • Network Stack (Parent Stack)
  • Create VPC -- Create ECS Cluster & ECS Roles -- Create Load Balancer (ALB) -- Create Outputs
  • Fargate Service Stack -- Create Input Parameters -- Create Task Definition -- Create Load Balancer Target Group & Load Balancer Rule -- Create ECS Service

Step-01: Create Network Stack (Parent Stack)

I'm going to build the network stack in an incremental manner.

  • CreateVPC
  • ECSCluster-ECSRoles
  • SecurityGroups-LoadBalancers
  • Export Outputs

Step-02: Create Fargate Service Stack

I'm going to build the network stack in an incremental manner.

  • InputParameters
  • Task definition
  • ALB-TargetGroup-and-LoadBalancerRule
  • FECSService

Step-03: Clean-Up

blog

copyright©2021AkhilMovva all rights reserved