-
Notifications
You must be signed in to change notification settings - Fork 34
/
outputs.tf
100 lines (79 loc) · 2.54 KB
/
outputs.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#output "autoscaling_target" {
# value = local.autoscale != null ? { for k, v in aws_appautoscaling_target.default : k => v.id } : null
#}
# These local variables exist solely to make the output variables more readable.
locals {
autoscaling_alarm = merge({ "down" = aws_cloudwatch_metric_alarm.down }, { "up" = aws_cloudwatch_metric_alarm.up })
autoscaling_policy = merge({ "down" = aws_appautoscaling_policy.down }, { "up" = aws_appautoscaling_policy.up })
}
output "autoscaling_alarm" {
value = var.autoscale != null ? { for k, v in local.autoscaling_alarm : k => { for mk, mv in v : mk => mv.arn } } : null
}
output "autoscaling_policy" {
value = var.autoscale != null ? { for k, v in local.autoscaling_policy : k => { for mk, mv in v : mk => mv.arn } } : null
}
output "fqdn" {
value = var.alias != null ? aws_route53_record.default[0].fqdn : null
}
output "id" {
value = aws_ecs_service.default.id
}
output "security_group_id" {
value = one(aws_security_group.default.*.id)
}
output "service_discovery_registry_arn" {
value = try(one(aws_service_discovery_service.default.*.arn), null)
}
output "subnet_ids" {
value = local.all_subnets
}
output "target_group_arn" {
value = var.load_balancer != null ? aws_lb_target_group.default[0].arn : null
}
output "task_definition_arn" {
value = local.task_definition_arn
}
# Debug outputs.
output "_autoscale_metrics" {
value = (var._debug) ? local.autoscale_metrics : null
}
output "_container_definition_file" {
value = (var._debug) ? local.container_definition_file : null
}
output "_container_definitions" {
value = (var._debug) ? local.container_definitions : null
}
output "_health_check" {
value = (var._debug) ? var.health_check : null
}
output "_load_balancer" {
value = (var._debug) ? var.load_balancer : null
}
output "_network_configuration" {
value = (var._debug) ? var.network_configuration : null
}
output "_service_discovery" {
value = (var._debug) ? var.service_discovery : null
}
output "_task_definition" {
value = (var._debug) ? var.task_definition : null
}
#output "_aws_acm_certificate_arn" {
# value = try(data.aws_acm_certificate.default[0].arn, null)
#}
#
#output "_aws_acm_certificate_domain" {
# value = try(data.aws_acm_certificate.default[0].domain, null)
#}
#
#output "_aws_lb_listener_port" {
# value = try(data.aws_lb_listener.selected[0].port, null)
#}
#
#output "_aws_lb_listener_protocol" {
# value = try(data.aws_lb_listener.selected[0].protocol, null)
#}
#
#output "_manage_listener_certificate" {
# value = try(local.manage_listener_certificate, "null")
#}