-
Notifications
You must be signed in to change notification settings - Fork 1
/
ecs-service-order.tf
70 lines (68 loc) · 1.9 KB
/
ecs-service-order.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
## ECS Fargate
module "ecs_fargate_order" {
source = "brunordias/ecs-fargate/aws"
version = "~> 8.0.0"
name = "order"
ecs_cluster = module.ecs_cluster.id
image_uri = "public.ecr.aws/x7i4o2g4/community/order:latest"
platform_version = "1.4.0"
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
fargate_cpu = 256
fargate_memory = 512
cpu_architecture = "X86_64"
ecs_service_desired_count = 1
app_port = 7070
load_balancer = false
ecs_service = true
deployment_circuit_breaker = true
service_discovery = true
service_discovery_namespace_id = aws_service_discovery_private_dns_namespace.local.id
policies = [aws_iam_policy.policy.arn]
assign_public_ip = false
capacity_provider_strategy = [
{
capacity_provider = "FARGATE_SPOT"
weight = 1
base = 0
}
]
app_environment = [
{
name = "DATABASE_HOST"
value = module.documentdb_cluster.endpoint
},
{
name = "DATABASE_PORT"
value = "27017"
},
{
name = "DATABASE_USER"
value = module.documentdb_cluster.master_username
},
{
name = "DATABASE_NAME"
value = var.name
},
{
name = "SERVICE_DEPLOY"
value = "dev"
}
]
app_secrets = [
{
name = "DATABASE_PASSWORD"
valueFrom = aws_secretsmanager_secret_version.docdb.arn
}
]
autoscaling = true
autoscaling_settings = {
max_capacity = 10
min_capacity = 1
target_cpu_value = 65
target_memory_value = 65
scale_in_cooldown = 300
scale_out_cooldown = 300
}
tags = var.tags
}