-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs.tf
31 lines (27 loc) · 952 Bytes
/
ecs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
resource "aws_ecs_cluster" "packy-v2-ecs-cluster" {
name = "packy-v2-cluster"
}
resource "aws_ecs_task_definition" "packy-v2-dev-api-task" {
family = "packy-v2-dev-api-task"
network_mode = "bridge"
requires_compatibilities = [ "EC2" ]
container_definitions = jsonencode([{
name = "packy-v2-dev-api-server"
image = "881490131558.dkr.ecr.ap-northeast-2.amazonaws.com/packy-v2-dev:latest"
cpu = 256 # 0.25 vCPU
memory = 384 # 384MB
essential = true
portMappings = [{
containerPort = 80
hostPort = 80
}]
}])
}
# resource "aws_ecs_service" "packy-v2-dev-api-service" {
# name = "packy-v2-dev-api-service"
# cluster = aws_ecs_cluster.packy-v2-ecs-cluster.id
# task_definition = aws_ecs_task_definition.packy-v2-dev-api-task.arn
# desired_count = 1
# launch_type = "EC2"
# depends_on = [ aws_instance.packy-v2-ecs-dev-ec2 ]
# }