This repository was archived by the owner on Jan 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathservice-default.tf
More file actions
76 lines (61 loc) · 1.71 KB
/
service-default.tf
File metadata and controls
76 lines (61 loc) · 1.71 KB
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
73
74
75
resource "aws_security_group" "awsvpc_sg" {
name = "${var.environment}-awsvpc-sg"
vpc_id = module.vpc.vpc_id
ingress {
protocol = "tcp"
from_port = 80
to_port = 80
cidr_blocks = [
"${module.vpc.vpc_cidr}",
]
}
egress {
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
Name = "${var.environment}-awsvpc-sg"
Environment = "${var.environment}"
}
}
module "service" {
source = "../../"
environment = var.environment
project = var.project
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.public_subnets
ecs_cluster_id = aws_ecs_cluster.cluster.id
ecs_cluster_name = aws_ecs_cluster.cluster.name
docker_image = "nginx"
service_name = "service-default"
container_ports = ["80"]
container_cpu = 256
container_memory = 512
// DNS specifc settings for the ALB, disalbed
enable_dns = false
// Monitoring settings, disabled
enable_monitoring = false
// Enables logging to other targets (default is STDOUT)
// For CloudWatch logging, make sure the awslogs-group exists
docker_logging_config = <<EOF
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "${var.environment}",
"awslogs-region": "${var.aws_region}",
"awslogs-stream-prefix": "service-default"
}
}
EOF
launch_type = "FARGATE"
awsvpc_service_security_groups = ["${aws_security_group.awsvpc_sg.id}"]
awsvpc_service_subnetids = module.vpc.private_subnets
}