Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSS support #46

Open
katesclau opened this issue Jul 30, 2020 · 1 comment
Open

WSS support #46

katesclau opened this issue Jul 30, 2020 · 1 comment

Comments

@katesclau
Copy link

katesclau commented Jul 30, 2020

Hey 馃憢

This ALB module is awesome, but for our GraphQL server (with subscriptions 馃槑 ), it'd be essential to have WS target group & security group rule.

Describe the Feature

Add TLS target group & Security Group Rule for TCP access. A simple solution would use the same port for both HTTP and WS

Expected Behavior

Connections from both HTTP, HTTPS, and TCP allowed in through the ALB.

Use Case

Any service that requires both REST & Websocket support on the same endpoint

Describe Ideal Solution

variable "wss_enabled" {
  type        = bool
  description = "Enables WSS target group for ALB"
  default     = false
}

Using variable wss_enabled to add said target group and security group rule

resource "aws_lb_target_group" "wss" {
  count = var.wss_enabled ? 1 : 0

  name                 = var.target_group_name == "" ? module.default_target_group_label.id : var.target_group_name
  port                 = var.target_group_port
  protocol             = "TLS"
  vpc_id               = var.vpc_id
  target_type          = var.target_group_target_type
  deregistration_delay = var.deregistration_delay

  health_check {
    path                = var.health_check_path
  }

  dynamic "stickiness" {
    for_each = var.stickiness == null ? [] : [var.stickiness]
    content {
      type            = "lb_cookie"
      cookie_duration = stickiness.value.cookie_duration
      enabled         = var.target_group_protocol == "TCP" ? false : stickiness.value.enabled
    }
  }

  lifecycle {
    create_before_destroy = true
  }

  tags = merge(
    module.default_target_group_label.tags,
    var.target_group_additional_tags
  )
}

This is my first feature request on terraform modules, please advise if my request is not pertinent. 馃檱

Thanks 馃憢

@nitrocode
Copy link
Member

nitrocode commented Aug 2, 2021

Thanks for creating this issue.

Not sure I completely understand. Why can you not manipulate the current variables in the module to change the current target group ? Why does this request require a whole new aws_lb_target_group resource ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants