Section 16: ECS, ECR & Fargate Flashcards

1
Q

Explain the difference between EC2 Instance Profile and ECS Task Role?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the Auto Scaling options for an ECS Service?

A
  • Target Tracking
  • Step Scaling
  • Scheduled Scaling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the 2 options you need to define for getting ECS Rolling Updates?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Amazon ECS Task Definitions?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where do you define an IAM Role for an ECS Task?

A

In the Task Definition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can containers in an ECS Task share data?

A

Define a Shared Storage. (For example /var/logs of the binded volume)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is dynamic host port mapping in ECS?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain ECS Task Placement Strategy Binpack

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain ECS Task Placement Strategy Spread

A

Places tasks evenly across AZs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly