Section 16: ECS, ECR & Fargate Flashcards
Explain the difference between EC2 Instance Profile and ECS Task Role?
An EC2 Instance Profile is an IAM role that can be assigned to an EC2 instance, allowing the instance to access AWS services and resources. An ECS Task Role is an IAM role that can be assigned to an ECS task, allowing the task to access AWS services and resources. The key difference between them is the level of granularity: EC2 Instance Profiles are applied at the instance level, while ECS Task Roles are applied at the task level.
What are the Auto Scaling options for an ECS Service?
- Target Tracking
- Step Scaling
- Scheduled Scaling
What are the 2 options you need to define for getting ECS Rolling Updates?
Minimum healthy percent and Maximum percent.
The tasks will increase up until the max with the new version of the task, then terminate tasks back to the min, and maybe do it again until all tasks are updated to the new version.
What are Amazon ECS Task Definitions?
- Task definitions are metadata in JSON form to tell ECS how to run a Docker container
- It contains crucial information, such as:
- Image Name
- Port Binding for Container and Host
- Memory and CPU required
- Environment variables
- Networking information
- IAM Role
- Logging configuration (ex CloudWatch)
- Can define up to 10 containers in a Task Definition
Where do you define an IAM Role for an ECS Task?
In the Task Definition
How can containers in an ECS Task share data?
Define a Shared Storage. (For example /var/logs of the binded volume)
What is dynamic host port mapping in ECS?
Dynamic host port mapping in ECS is a feature that assigns available host ports to container ports in a task. It simplifies port management, avoids conflicts, and enables easy access to containerized applications running on EC2 instances.
An Application Load Balancer can find the assigned ports automatically.
Explain ECS Task Placement Strategy Binpack
New containers will be started on the running EC2 instance up until there’s no more space/ram/cpu available, then it will start the new container on another EC2 instance.
Explain ECS Task Placement Strategy Spread
Places tasks evenly across AZs