Skip to content

bryan-rhm/terraform-aws-alb-target-group

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform AWS Load Balancer Target group module

Basic Usage Example

module "target_group" {
  source      = "github.com/bryan-rhm/terraform-aws-alb-target-group?ref=v1.0.0"
  name        = "my-target"
  vpc_id      = var.vpc_id
  target_type = "ip"
  stickiness = {
    type = "lb_cookie"
  }
}

Requirements

Name Version
terraform >= 1.0.4
aws >= 3.43.0

Providers

Name Version
aws 3.71.0

Modules

No modules.

Resources

Name Type
aws_lb_target_group.this resource

Inputs

Name Description Type Default Required
health_check Health Check configuration block.
object({
path = string
timeout = number
matcher = optional(string)
interval = number
protocol = optional(string)
healthy_threshold = optional(number)
unhealthy_threshold = optional(number)
})
null no
name (Optional, Forces new resource) Name of the target group. If omitted, Terraform will assign a random, unique name. string null no
name_prefix (Optional, Forces new resource) Creates a unique name beginning with the specified prefix. Conflicts with name. Cannot be longer than 6 characters. string null no
port Port on which targets receive traffic, unless overridden when registering a specific target. number 80 no
protocol Should be one of GENEVE, HTTP, HTTPS, TCP, TCP_UDP, TLS, or UDP string "HTTP" no
stickiness Stickiness configuration block.
object({
type = string # The only current possible values are lb_cookie, app_cookie for ALBs, and source_ip for NLBs.
cookie_name = optional(string) # Only needed when type is app_cookie.
cookie_duration = optional(number) # Only used when the type is lb_cookie. Default value 86400
})
null no
tags A map of tags to assign to the target group. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. map(any) null no
target_type Type of target that you must specify when registering targets with this target group. Valid values: ip|instance|lambda string "instance" no
vpc_id Identifier of the VPC in which to create the target group. Required when target_type is instance or ip string null no

Outputs

Name Description
output Target group attributes