0
0
AWScloud~10 mins

Task definitions in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the family name in an AWS ECS task definition.

AWS
{
  "family": "[1]"
}
Drag options to blanks, or click blank then click option'
Amy-task-family
Bcontainer-name
Ctask-role
Dexecution-role
Attempts:
3 left
💡 Hint
Common Mistakes
Using container names instead of family name
Confusing roles with family name
2fill in blank
medium

Complete the code to specify the container image in the task definition.

AWS
{
  "containerDefinitions": [
    {
      "image": "[1]"
    }
  ]
}
Drag options to blanks, or click blank then click option'
Amy-container
Bnginx:latest
Ctask-role
Dmy-task-family
Attempts:
3 left
💡 Hint
Common Mistakes
Using task family name instead of image
Using container name instead of image
3fill in blank
hard

Fix the error in the task definition to correctly specify the CPU units for the container.

AWS
{
  "containerDefinitions": [
    {
      "cpu": [1]
    }
  ]
}
Drag options to blanks, or click blank then click option'
A"256"
B"0.25"
C0.25
D256
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values instead of integers
Using decimal numbers instead of integers
4fill in blank
hard

Fill both blanks to define environment variables correctly in the container definition.

AWS
{
  "containerDefinitions": [
    {
      "environment": [
        {"name": "[1]", "value": "[2]"}
      ]
    }
  ]
}
Drag options to blanks, or click blank then click option'
AENV_VAR_NAME
Bproduction
CENV_VALUE
Ddev
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping name and value
Using non-string values
5fill in blank
hard

Fill all three blanks to correctly configure port mappings in the container definition.

AWS
{
  "containerDefinitions": [
    {
      "portMappings": [
        {
          "containerPort": [1],
          "hostPort": [2],
          "protocol": "[3]"
        }
      ]
    }
  ]
}
Drag options to blanks, or click blank then click option'
A80
B8080
Ctcp
Dudp
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings instead of integers for ports
Using invalid protocol names