0
0
AWScloud~30 mins

Task definitions in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Create an AWS ECS Task Definition
📖 Scenario: You are setting up a containerized application on AWS ECS (Elastic Container Service). To run your containers, you need to create a task definition that describes the container settings.
🎯 Goal: Build a simple AWS ECS task definition JSON that specifies a container with a name, image, and resource limits.
📋 What You'll Learn
Create a task definition dictionary with the required fields
Add a container definition with a specific name and image
Set CPU and memory limits for the container
Include essential container properties for ECS
💡 Why This Matters
🌍 Real World
Task definitions are essential for running containerized applications on AWS ECS, defining how containers should run.
💼 Career
Understanding task definitions is important for cloud engineers and DevOps professionals managing container deployments on AWS.
Progress0 / 4 steps
1
Create the basic task definition dictionary
Create a dictionary called task_definition with the key family set to "my-task-family" and an empty list for the key containerDefinitions.
AWS
Need a hint?

Think of the task definition as a dictionary with keys for family and container definitions.

2
Add container configuration variables
Create a dictionary called container with keys name set to "my-container" and image set to "nginx:latest".
AWS
Need a hint?

The container dictionary holds the container's name and the Docker image to use.

3
Add CPU and memory limits to the container
Add the keys cpu with value 256 and memory with value 512 to the container dictionary.
AWS
Need a hint?

CPU and memory are numeric values representing resource limits for the container.

4
Add the container to the task definition
Append the container dictionary to the containerDefinitions list inside task_definition.
AWS
Need a hint?

Use the append method to add the container dictionary to the list inside task_definition.