-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
52 lines (39 loc) · 1.02 KB
/
main.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
resource "aws_ecs_cluster" "cluster" {
name = "example-ecs-cluster"
capacity_providers = ["FARGATE_SPOT", "FARGATE"]
default_capacity_provider_strategy {
capacity_provider = "FARGATE_SPOT"
}
setting {
name = "containerInsights"
value = "disabled"
}
}
module "ecs-fargate" {
source = "umotif-public/ecs-fargate/aws"
version = "~> 6.1.0"
name_prefix = "ecs-fargate-example"
vpc_id = aws_vpc.ecs_vpc.id
private_subnet_ids = [aws_subnet.private_subnet_1.id, aws_subnet.private_subnet_2.id]
cluster_id = aws_ecs_cluster.cluster.id
task_container_image = "centos"
task_definition_cpu = 256
task_definition_memory = 512
task_container_port = 80
task_container_assign_public_ip = true
load_balanced = false
target_groups = [
{
target_group_name = "tg-fargate-example"
container_port = 80
}
]
health_check = {
port = "traffic-port"
path = "/"
}
tags = {
Environment = "test"
Project = "Test"
}
}