This template configures an AWS VPC Lattice Target Group with a detailed health check for IP type targets using HTTPS and HTTP protocols.

Terraform Template

resource "aws_vpclattice_target_group" "example" {

  config {

    health_check {
      enabled = true
      health_check_interval_seconds = 20
      health_check_timeout_seconds = 10
      healthy_threshold_count = 7

      matcher {
        value = "200-299"
      }
      path = "/instance"
      port = 80
      protocol = "HTTP"
      protocol_version = "HTTP1"
      unhealthy_threshold_count = 3
    }
    ip_address_type = "IPV4"
    port = 443
    protocol = "HTTPS"
    protocol_version = "HTTP1"
    vpc_identifier = "aws_vpc.example.id"
  }
  name = "example"
  type = "IP"
}