-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathoutputs.tf
166 lines (138 loc) · 5.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#------------------------------------------------------------------------------
# APPLICATION LOAD BALANCER
#------------------------------------------------------------------------------
output "aws_lb_lb_id" {
description = "The ARN of the load balancer (matches arn)."
value = aws_lb.lb.id
}
output "aws_lb_lb_arn" {
description = "The ARN of the load balancer (matches id)."
value = aws_lb.lb.arn
}
output "aws_lb_lb_arn_suffix" {
description = "The ARN suffix for use with CloudWatch Metrics."
value = aws_lb.lb.arn_suffix
}
output "aws_lb_lb_dns_name" {
description = "The DNS name of the load balancer."
value = aws_lb.lb.dns_name
}
output "aws_lb_lb_zone_id" {
description = "The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record)."
value = aws_lb.lb.zone_id
}
#------------------------------------------------------------------------------
# ACCESS CONTROL TO APPLICATION LOAD BALANCER
#------------------------------------------------------------------------------
output "aws_security_group_lb_access_sg_id" {
description = "The ID of the security group"
value = aws_security_group.lb_access_sg.id
}
output "aws_security_group_lb_access_sg_arn" {
description = "The ARN of the security group"
value = aws_security_group.lb_access_sg.arn
}
output "aws_security_group_lb_access_sg_vpc_id" {
description = "The VPC ID."
value = aws_security_group.lb_access_sg.vpc_id
}
output "aws_security_group_lb_access_sg_owner_id" {
description = "The owner ID."
value = aws_security_group.lb_access_sg.owner_id
}
output "aws_security_group_lb_access_sg_name" {
description = "The name of the security group"
value = aws_security_group.lb_access_sg.name
}
output "aws_security_group_lb_access_sg_description" {
description = "The description of the security group"
value = aws_security_group.lb_access_sg.description
}
output "aws_security_group_lb_access_sg_ingress" {
description = "The ingress rules."
value = aws_security_group.lb_access_sg.ingress
}
output "aws_security_group_lb_access_sg_egress" {
description = "The egress rules."
value = aws_security_group.lb_access_sg.egress
}
#------------------------------------------------------------------------------
# AWS LOAD BALANCER - Target Groups
#------------------------------------------------------------------------------
output "lb_http_tgs_ids" {
description = "List of HTTP Target Groups IDs"
value = [for tg in aws_lb_target_group.lb_http_tgs : tg.id]
}
output "lb_http_tgs_arns" {
description = "List of HTTP Target Groups ARNs"
value = [for tg in aws_lb_target_group.lb_http_tgs : tg.arn]
}
output "lb_http_tgs_names" {
description = "List of HTTP Target Groups Names"
value = [for tg in aws_lb_target_group.lb_http_tgs : tg.name]
}
output "lb_http_tgs_ports" {
description = "List of HTTP Target Groups ports"
value = [for tg in aws_lb_target_group.lb_http_tgs : tostring(tg.port)]
}
output "lb_http_tgs_map_arn_port" {
value = zipmap(
[for tg in aws_lb_target_group.lb_http_tgs : tg.arn],
[for tg in aws_lb_target_group.lb_http_tgs : tostring(tg.port)]
)
}
output "lb_https_tgs_ids" {
description = "List of HTTPS Target Groups IDs"
value = [for tg in aws_lb_target_group.lb_https_tgs : tg.id]
}
output "lb_https_tgs_arns" {
description = "List of HTTPS Target Groups ARNs"
value = [for tg in aws_lb_target_group.lb_https_tgs : tg.arn]
}
output "lb_https_tgs_names" {
description = "List of HTTPS Target Groups Names"
value = [for tg in aws_lb_target_group.lb_https_tgs : tg.name]
}
output "lb_https_tgs_ports" {
description = "List of HTTPS Target Groups ports"
value = [for tg in aws_lb_target_group.lb_https_tgs : tostring(tg.port)]
}
output "lb_https_tgs_map_arn_port" {
value = zipmap(
[for tg in aws_lb_target_group.lb_https_tgs : tg.arn],
[for tg in aws_lb_target_group.lb_https_tgs : tostring(tg.port)]
)
}
#------------------------------------------------------------------------------
# AWS LOAD BALANCER - Listeners
#------------------------------------------------------------------------------
output "lb_http_listeners_ids" {
description = "List of HTTP Listeners IDs"
value = [for listener in aws_lb_listener.lb_http_listeners : listener.id]
}
output "lb_http_listeners_arns" {
description = "List of HTTP Listeners ARNs"
value = [for listener in aws_lb_listener.lb_http_listeners : listener.arn]
}
output "lb_https_listeners_ids" {
description = "List of HTTPS Listeners IDs"
value = [for listener in aws_lb_listener.lb_https_listeners : listener.id]
}
output "lb_https_listeners_arns" {
description = "List of HTTPS Listeners ARNs"
value = [for listener in aws_lb_listener.lb_https_listeners : listener.arn]
}
#------------------------------------------------------------------------------
# S3 LB Logging Bucket
# Bucket ID and ARN are not emitted if you "bring your own bucket" by providing
# a var.log_bucket_id to this module because the caller already knows the ID (and,
# presumably, the ARN)
#------------------------------------------------------------------------------
output "lb_logs_s3_bucket_id" {
description = "LB Logging S3 Bucket ID"
value = (var.enable_s3_logs && var.log_bucket_id == null) ? module.lb_logs_s3[0].s3_bucket_id : null
}
output "lb_logs_s3_bucket_arn" {
description = "LB Logging S3 Bucket ARN"
value = (var.enable_s3_logs && var.log_bucket_id == null) ? module.lb_logs_s3[0].s3_bucket_arn : null
}