

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 6
click for more info
Not enough gems
Cost: 6 gems
1: VPC and Networking Setup
incomplete
2: Why ECS?
incomplete
3: Elastic Container Registry
incomplete
4: ECR Repo
incomplete
5: ECS Clusters
incomplete
6: ECS Permissions
incomplete
7: ECS Task Definitions
incomplete
8: ECS Security Groups
incomplete
9: Application Load Balancer
incomplete
10: Target Groups
incomplete
11: CloudWatch Log Groups
incomplete
12: ECS Services
incomplete
13: Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
We've got our image, now it's time to run it.
Enter the ECS Cluster. Think of it as a logical grouping of compute resources where containers can run. It doesn't cost anything by itself, but it provides the foundation for running ECS tasks.
A cluster can hold a number of capacity providers, which provide resources to our cluster on an as-needed basis. It's like the ECS version of EC2 Auto Scaling Groups.
So while we could spin up EC2 instances that are ready to run our container, AWS also provides Fargate and Fargate Spot capacity providers. Fargate is a "serverless" compute option provided by AWS that manages the underlying infrastructure for you.
Serverless gets a lot of hype and hate. But like many things, there's just a trade-off.
With serverless you typically pay a premium on the compute resources and lose a bit of control in exchange for making the management of those machines simpler. It makes sense for many jobs, but can be a financial catastrophe for others. YMMV.
AWS provides the Fargate capacity providers by default. When you configure a cluster, you can set Fargate as the default capacity provider, which means any tasks you create will automatically use Fargate unless you specify otherwise.
Create an ECS cluster named patientping-ecs and configure it to use Fargate.
Cost check: The ECS Cluster and the Fargate capacity provider don't cost anything until we start to use them.
aws ecs describe-capacity-providers --capacity-providers FARGATE FARGATE_SPOT
Run and submit the tests to verify that your cluster is configured correctly.
If you prefer to use the CLI:
aws ecs create-cluster --cluster-name "patientping-ecs"
aws ecs put-cluster-capacity-providers \
--cluster "patientping-ecs" \
--capacity-providers FARGATE \
--default-capacity-provider-strategy "capacityProvider=FARGATE,weight=1"