AWS::ECS::Cluster
Container runtimeservice- Container applications run in the OS just as a process
- With ECS you must provision and maintain the underlying EC2 instances
- ECS is basically a scheduler! To decide to which instance the container will be provisioned

- A
ECS Clusteris a collection ofECS Container Instances - The
servicesrun in the ECS cluster. Each service is compose of one or moretasks - Services can be exposed by a Load Balancer

- Container: Container
- Task: Pod
- Service: Deployment
- Cluster: Cluster
Scaling
- A
CloudWatchalarm can be set in order to emit events based on theservice metrics Autoscalingcan be enabled based on the metrics- For EC2 Launch Type,
Scale ECS Capacity Providersto scale the ec2 instances
Properties
Type: AWS::ECS::Cluster
Properties:
CapacityProviders:
- String
ClusterName: String
ClusterSettings:
- ClusterSettings
Configuration:
ClusterConfiguration
DefaultCapacityProviderStrategy:
- CapacityProviderStrategyItem
ServiceConnectDefaults:
ServiceConnectDefaults
Tags:
- Tag
CapacityProviders
-
EC2 Launch Type
-
An
ECS Agentruns inside each EC2 instances - This agent
registersthe instance to theECS Cluster - Registered instances can receive
ECS Tasks, which are container workloads - Charged based on EC2 instances and EBS volumes


- In order to forward requests to the applications, dynamic port mapping is used

-
Fargate Launch Type
-
No need the provision the underlying infrastructure. Simpler! Serverless!
- Each
ECS Taskis associated with a newENIin theEC2 Cluster(needs a long range VPC) -
Charged based on vCPU and memory resources
-
For forwarding traffic, the Load Balancer forwards to each IP (each task has a unique ENI)
