Skip to content

Commit 6d98ec3

Browse files
author
Steven Nemetz
committed
Add output for target group IDs
1 parent eb9c2cc commit 6d98ec3

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

outputs.tf

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,23 @@ output "target_group_arns" {
8080
value = "${compact(concat(aws_lb_target_group.application-http.*.arn,aws_lb_target_group.application-https.*.arn,aws_lb_target_group.network.*.arn))}"
8181
}
8282

83-
# id
83+
output "target_group_http_ids" {
84+
description = "IDs of the HTTP target groups"
85+
value = "${aws_lb_target_group.application-http.*.id}"
86+
}
87+
output "target_group_https_ids" {
88+
description = "IDs of the HTTPS target groups"
89+
value = "${aws_lb_target_group.application-https.*.id}"
90+
}
91+
output "target_group_tcp_ids" {
92+
description = "IDs of the TCP target groups"
93+
value = "${aws_lb_target_group.network.*.id}"
94+
}
95+
output "target_group_ids" {
96+
description = "IDs of all the target groups"
97+
value = "${compact(concat(aws_lb_target_group.application-http.*.id,aws_lb_target_group.application-https.*.id,aws_lb_target_group.network.*.id))}"
98+
}
99+
84100
# arn_suffix
85101
# name
86102

test/outputs.tf

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,22 @@ output "target_group_arns" {
8484
description = "ARNs of all the target groups. Useful for passing to your Auto Scaling group module."
8585
value = "${module.lb.target_group_arns}"
8686
}
87-
88-
# id
87+
output "target_group_http_ids" {
88+
description = "IDs of the HTTP target groups"
89+
value = "${module.lb.target_group_http_ids}"
90+
}
91+
output "target_group_https_ids" {
92+
description = "IDs of the HTTPS target groups"
93+
value = "${module.lb.target_group_https_ids}"
94+
}
95+
output "target_group_tcp_ids" {
96+
description = "IDs of the TCP target groups"
97+
value = "${module.lb.target_group_tcp_ids}"
98+
}
99+
output "target_group_ids" {
100+
description = "IDs of all the target groups"
101+
value = "${module.lb.target_group_ids}"
102+
}
89103
# arn_suffix
90104
# name
91105

0 commit comments

Comments
 (0)