Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3341258
D13360.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13360.diff
View Options
diff --git a/services/terraform/remote/service_tunnelbroker.tf b/services/terraform/remote/service_tunnelbroker.tf
--- a/services/terraform/remote/service_tunnelbroker.tf
+++ b/services/terraform/remote/service_tunnelbroker.tf
@@ -186,10 +186,13 @@
}
# gRPC
- load_balancer {
- target_group_arn = aws_lb_target_group.tunnelbroker_grpc.arn
- container_name = local.tunnelbroker_config.container_name
- container_port = local.tunnelbroker_config.grpc_port
+ dynamic "load_balancer" {
+ for_each = aws_lb_listener.tunnelbroker_grpc
+ content {
+ target_group_arn = aws_lb_target_group.tunnelbroker_grpc.arn
+ container_name = local.tunnelbroker_config.container_name
+ container_port = local.tunnelbroker_config.grpc_port
+ }
}
deployment_circuit_breaker {
@@ -255,6 +258,17 @@
}
}
+
+/* This is generally a dead (empty) resource on prod, i.e. it should not have
+ * any targets registered. We have gRPC listener resource disabled on prod,
+ * which results in the following exception if any targets are registered here:
+ * "The target group "tunnelbroker-grpc-tg" does not have
+ * an associated load balancer."
+ *
+ * See also `aws_lb_listener.tunnelbroker_grpc` and the "dynamic" block in
+ * `aws_ecs_service.tunnelbroker` on how this is disabled.
+ * The `count` or `for_each` isn't added here to avoid complicating things more.
+ */
resource "aws_lb_target_group" "tunnelbroker_grpc" {
name = "tunnelbroker-grpc-tg"
port = local.tunnelbroker_config.grpc_port
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 10:45 PM (13 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2566154
Default Alt Text
D13360.diff (1 KB)
Attached To
Mode
D13360: [terraform] Make Tunnelbroker deployments more future-proof
Attached
Detach File
Event Timeline
Log In to Comment