-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs_service.tf
47 lines (40 loc) · 1.1 KB
/
ecs_service.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
/*
resource "aws_ecs_service" "nginx" {
name = "${var.product_id}-nginx"
cluster = "${aws_ecs_cluster.main.id}"
task_definition = "${aws_ecs_task_definition.main.arn}"
desired_count = 2
launch_type = "FARGATE"
deployment_maximum_percent = 300
deployment_minimum_healthy_percent = 100
network_configuration {
subnets = ["${module.vpc.public_subnets}"]
security_groups = ["${aws_security_group.nginx.id}"]
assign_public_ip = true
}
load_balancer {
target_group_arn = "${module.lb-tg.arn}"
container_name = "nginx"
container_port = 80
}
lifecycle {
ignore_changes = ["desired_count"]
}
}
resource "aws_security_group" "nginx" {
name = "${var.product_id}-nginx"
vpc_id = "${module.vpc.vpc_id}"
ingress {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
*/