

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
Finally! Time to build the ECS Service that ties everything together, and answers these questions:
Once we create an ECS service with load balancer settings, ECS automatically registers tasks with the target group as they start.
Create an ECS service patientping-svc that runs your task definition and connects it to the load balancer (cluster patientping-ecs, ALB patientping-alb, target group patientping-tg).
Cost check: An ECS service creates the serverless containers (Fargate tasks). It costs about $0.012/hr for the task. The load balancer we created earlier costs about $0.0225/hr (~$16/mo). Combined, you're looking at roughly $0.0345/hr or about $25/mo total! Don't leave these up if you're going to step away from the lessons.
patientping-ecs.patientping-svc.Now you may wonder why we're using a public subnet. Well, when a new Fargate container starts, it needs to be able to interact with the container repository (ECR) and pull in a fresh container. Putting this in a public subnet means it can just leverage our internet gateway, and save us from setting up a specific endpoint to fetch them privately.
It may take a minute or two for the service to start tasks and register them with the load balancer. Once they're registered, your containers will be ready to receive traffic through the load balancer.
Remember, we set this service up with permissions to read the /CMO_NAME from SSM parameters!
Run and submit the tests to verify your ECS service is running correctly.