Skip to content

Target Groups

Define target groups per VPC under vpcs.<vpc>.target_groups. These are consumed by ALB/NLB listeners and EC2 services (via keys).

Key fields:

  • name (optional) — explicit name; otherwise derived from prefixes/suffixes.
  • port (default: "443")
  • protocol (default: "HTTPS") — HTTP/HTTPS for ALB; TCP/UDP/TLS for NLB.
  • target_type (default: "ip") — ip or instance.
  • stickiness (optional, ALB only) — cookie_name and type (lb_cookie).
  • health_check (optional) — port/protocol; include path for HTTP/HTTPS.
  • target (optional) — attach static EC2s by tag (vm_tag { key, value }) and port.
  • tags (optional)

Examples

vpcs = {
  SharedInfra = {
    target_groups = {
            wss = {
                stickiness = {
                    cookie_name = "wss-affinitycookie"
                }
                health_check = {}
                target = {
                    vm_tag = {
                        key = "target_group"
                        value = "con"
                    }
                    port = 443
                }
            }
        }
  }
}