AWS ECS Deployment Guide¶
Deploying IOSetu on AWS Elastic Container Service (ECS) using AWS Fargate is the recommended production setup.
1. Prerequisites¶
- AWS Account
- VPC with Public/Private subnets
- ECR Repository (or subscription to AWS Marketplace container)
2. Task Definition¶
Create a standard Fargate task definition.
iosetu-task-def.json
{
"family": "iosetu-prod",
"networkMode": "awsvpc",
"requiresCompatibilities": ["FARGATE"],
"cpu": "512",
"memory": "1024",
"executionRoleArn": "arn:aws:iam::709825985650:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"name": "iosetu",
"image": "709825985650.dkr.ecr.us-east-1.amazonaws.com/priyaiosystems/iosetu:latest",
"essential": true,
"portMappings": [
{
"containerPort": 8080,
"hostPort": 8080,
"protocol": "tcp"
}
],
"environment": [
{ "name": "IOSETU_LOG_LEVEL", "value": "info" },
{ "name": "OTEL_EXPORTER_OTLP_ENDPOINT", "value": "http://otel-collector:4318" }
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/iosetu",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "ecs"
}
}
}
]
}
3. Service Configuration¶
- Launch Type: Fargate
- Load Balancer: Application Load Balancer (ALB)
- Listener: HTTPS (443) -> Target Group (8080)
- Health Check Path:
/health - Auto Scaling:
- Target Tracking: CPU Utilization (70%)
- Min Tasks: 2
- Max Tasks: 10
4. Troubleshooting¶
"Task Stopped"¶
Check CloudWatch Logs for /ecs/iosetu. Common issues:
- IAM Role missing permissions to pull image.
- Memory limit exceeded (increase Task Memory).
"502 Bad Gateway" (ALB)¶
- Security Group: Ensure ALB SG allows traffic to ECS tasks SG on port 8080.
- Health Check: Verify health check path is
/health(not/).