Bird
0
0

Which of the following JSON snippets correctly specifies the container name in an ECS task definition?

easy📝 Syntax Q3 of 15
AWS - ECS and Fargate
Which of the following JSON snippets correctly specifies the container name in an ECS task definition?
A{"containerDefinitions": [{"containerName": "backend"}]}
B{"containerDefinitions": [{"name": "backend"}]}
C{"containers": [{"name": "backend"}]}
D{"containerDefinitions": [{"container": "backend"}]}
Step-by-Step Solution
Solution:
  1. Step 1: Check ECS task definition syntax

    The correct key for container name is "name" inside "containerDefinitions" array.
  2. Step 2: Validate options

    {"containerDefinitions": [{"name": "backend"}]} uses correct keys and structure; others use invalid keys or structure.
  3. Final Answer:

    {"containerDefinitions": [{"name": "backend"}]} -> Option B
  4. Quick Check:

    Container name key is "name" inside "containerDefinitions" [OK]
Quick Trick: Container name key is always "name" in containerDefinitions [OK]
Common Mistakes:
  • Using incorrect keys like containerName or container
  • Misplacing container definitions outside containerDefinitions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes