Challenge - 5 Problems
Task Definition Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding Task Definition Components
Which part of an AWS ECS task definition specifies the Docker image to use for a container?
Attempts:
2 left
💡 Hint
Think about where you tell ECS what container to run.
✗ Incorrect
The containerDefinitions section includes the image property that specifies the Docker image for the container.
❓ Configuration
intermediate2:00remaining
Task Definition JSON Validation
Given the following partial task definition snippet, which option correctly specifies the network mode?
{
"family": "my-task",
"containerDefinitions": [
{
"name": "app",
"image": "myapp:latest",
"memory": 512,
"cpu": 256,
"portMappings": [
{"containerPort": 80, "hostPort": 80}
]
}
]
}
Options are possible values for "networkMode" to add at the root level.
Attempts:
2 left
💡 Hint
The default network mode for EC2 launch type is bridge.
✗ Incorrect
The networkMode must be a valid value. 'bridge' is the default and valid for EC2 tasks with port mappings.
❓ Architecture
advanced2:00remaining
Task Definition and IAM Roles
Which IAM role should be specified in a task definition to allow the ECS agent to pull container images from a private ECR repository?
Attempts:
2 left
💡 Hint
This role is used by ECS to perform actions on your behalf during task startup.
✗ Incorrect
The executionRoleArn grants permissions for ECS to pull images and manage logs during task startup.
❓ service_behavior
advanced2:00remaining
Effect of Task Definition Revision on Running Tasks
What happens to running ECS tasks when a new revision of a task definition is registered and a service is updated to use it?
Attempts:
2 left
💡 Hint
Consider how ECS handles rolling updates.
✗ Incorrect
ECS launches new tasks with the new revision and stops old tasks according to deployment strategy; old tasks do not update in place.
❓ security
expert2:00remaining
Least Privilege Principle in Task Role Assignment
You want to allow your ECS task to access only a specific S3 bucket. Which approach best follows the least privilege principle when assigning IAM roles in the task definition?
Attempts:
2 left
💡 Hint
Think about granting only the permissions the task needs.
✗ Incorrect
Assigning a taskRoleArn with a narrowly scoped policy limits permissions to only what the task requires, following least privilege.