AWS ECS — Container Service Guide
Advertisement
AWS ECS — Container Service Guide
AWS ECS provides container orchestration without managing Kubernetes complexity.
Task Definitions
{
"family": "my-app",
"networkMode": "awsvpc",
"requiresCompatibilities": ["FARGATE"],
"cpu": "256",
"memory": "512",
"containerDefinitions": [
{
"name": "my-container",
"image": "my-account.dkr.ecr.us-east-1.amazonaws.com/my-app:latest",
"portMappings": [
{
"containerPort": 3000,
"hostPort": 3000,
"protocol": "tcp"
}
],
"essential": true
}
]
}
Creating Services
# Register task definition
aws ecs register-task-definition --cli-input-json file://task.json
# Create service
aws ecs create-service \
--cluster my-cluster \
--service-name my-service \
--task-definition my-app \
--desired-count 2 \
--launch-type FARGATE
FAQ
Q: What's the difference between ECS and Kubernetes? A: ECS is simpler, AWS-native; Kubernetes is more portable and feature-rich.
Advertisement
← Previous
AWS CloudFormation vs Terraform