0
0
AWScloud~30 mins

Fargate serverless containers in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Fargate Serverless Containers
📖 Scenario: You are working for a small company that wants to run a simple web application without managing servers. AWS Fargate lets you run containers without worrying about the underlying servers.In this project, you will create a basic AWS ECS Fargate task definition and service configuration to run a containerized web app.
🎯 Goal: Build a minimal AWS ECS Fargate task definition and service configuration using JSON format. This will define a container running a simple web server image and configure it to run serverless on Fargate.
📋 What You'll Learn
Create an ECS task definition JSON with one container named webapp
Set the container image to nginx:latest
Specify CPU and memory requirements for the task
Configure the network mode to awsvpc
Add a service configuration referencing the task definition
Set the desired count of tasks to 1
💡 Why This Matters
🌍 Real World
Many companies use AWS Fargate to run containerized applications without managing servers, making deployment easier and scalable.
💼 Career
Understanding how to define ECS Fargate tasks and services is essential for cloud engineers and DevOps professionals working with containerized applications on AWS.
Progress0 / 4 steps
1
Create ECS Task Definition Basic Structure
Create a JSON object called task_definition with keys family set to fargate-webapp and networkMode set to awsvpc. Also add requiresCompatibilities as a list containing FARGATE.
AWS
Need a hint?

Use the keys exactly as family, networkMode, and requiresCompatibilities.

2
Add Container Definitions with Image and Resources
Add a key containerDefinitions with a list containing one container object. The container object must have name set to webapp, image set to nginx:latest, cpu set to 256, and memory set to 512.
AWS
Need a hint?

Remember to put the container details inside a list under containerDefinitions.

3
Add Task CPU and Memory Requirements
Add keys cpu set to 256 and memory set to 512 at the root level of the task_definition JSON.
AWS
Need a hint?

Task-level CPU and memory must be strings, not numbers.

4
Create ECS Service Configuration
Create a JSON object called service_definition with keys name set to webapp-service, taskDefinition set to fargate-webapp, desiredCount set to 1, and launchType set to FARGATE.
AWS
Need a hint?

Use exact key names and values as specified.