forked from appleboy/drone-terraform-in-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs-drone-agent.tf
31 lines (27 loc) · 1.05 KB
/
ecs-drone-agent.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
data "template_file" "drone_agent_task_definition" {
template = "${file("task-definitions/drone-agent.json")}"
vars {
log_group_region = "${var.aws_region}"
log_group_drone_agent = "${aws_cloudwatch_log_group.drone_agent.name}"
drone_server = "server.drone.local"
drone_secret = "${var.drone_secret}"
drone_version = "${var.drone_version}"
drone_agent_port = "${var.drone_agent_port}"
container_cpu = "${var.container_cpu}"
container_memory = "${var.container_memory}"
}
}
resource "aws_ecs_task_definition" "drone_agent" {
family = "drone-agent"
container_definitions = "${data.template_file.drone_agent_task_definition.rendered}"
volume {
name = "dockersock"
host_path = "/var/run/docker.sock"
}
}
resource "aws_ecs_service" "drone_agent" {
name = "drone-agent"
cluster = "${aws_ecs_cluster.drone.id}"
desired_count = "${var.drone_desired_count_agent}"
task_definition = "${aws_ecs_task_definition.drone_agent.arn}"
}