-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal-ecs-task-defination.tf
72 lines (69 loc) · 2.01 KB
/
global-ecs-task-defination.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
resource "aws_ecs_task_definition" "task_definition" {
execution_role_arn = aws_iam_role.ecs_tasks_execution_role.arn
family = "default"
network_mode = "bridge"
requires_compatibilities = ["EC2"]
task_role_arn = aws_iam_role.ecs_tasks_execution_role.arn
container_definitions = jsonencode([
{
name = "Nginx"
image = "${aws_ecr_repository.ecr-default.repository_url}"
cpu = 8
memory = 8
essential = true
workingDirectory = "/usr/src/wordpress"
portMappings = [
{
containerPort = 8888
hostPort = 8888
}
],
"logConfiguration" : {
"logDriver" : "awslogs",
"secretOptions" : null,
"options" : {
"awslogs-group" : "/default",
"awslogs-region" : "us-east-1",
"awslogs-stream-prefix" : "ecs"
}
}
}
])
}
resource "aws_ecs_task_definition" "pma_task_definition" {
execution_role_arn = aws_iam_role.ecs_tasks_execution_role.arn
family = "phpmyadmin"
network_mode = "bridge"
requires_compatibilities = ["EC2"]
task_role_arn = aws_iam_role.ecs_tasks_execution_role.arn
container_definitions = jsonencode([
{
name = "phpmyadmin"
image = "${aws_ecr_repository.ecr-pma.repository_url}"
cpu = 128
memory = 128
essential = true
"environment" : [
{
"name" : "PMA_HOST",
"value" : "${aws_db_instance.rds.endpoint}"
}
]
portMappings = [
{
containerPort = 80
hostPort = 0
}
],
"logConfiguration" : {
"logDriver" : "awslogs",
"secretOptions" : null,
"options" : {
"awslogs-group" : "/pma",
"awslogs-region" : "us-east-1",
"awslogs-stream-prefix" : "ecs"
}
}
}
])
}