{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-vpc-lattice/json-schema/amazon-vpc-lattice-create-target-group-request-schema.json",
  "title": "CreateTargetGroupRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-vpc-lattice-createtargetgroup-api-openapi.yml#/components/schemas/CreateTargetGroupRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the target group. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen."
    },
    "type": {
      "type": "string",
      "description": "The type of target group."
    },
    "config": {
      "$ref": "#/$defs/TargetGroupConfig"
    },
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails."
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The tags for the target group."
    }
  },
  "required": [
    "name",
    "type"
  ],
  "$defs": {
    "HealthCheckConfig": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Indicates whether health checking is enabled."
        },
        "protocol": {
          "type": "string",
          "description": "The protocol used when performing health checks on targets. The possible protocols are HTTP and HTTPS. The default is HTTP."
        },
        "protocolVersion": {
          "type": "string",
          "description": "The protocol version used when performing health checks on targets. The possible protocol versions are HTTP1 and HTTP2."
        },
        "port": {
          "type": "integer",
          "description": "The port used when performing health checks on targets. The default setting is the port that a target receives traffic on."
        },
        "path": {
          "type": "string",
          "description": "The destination for health checks on the targets. If the protocol version is HTTP/1.1 or HTTP/2, specify a valid URI (for example, /path?query). The default path is /. Health checks are not supported if the protocol version is gRPC, however, you can choose HTTP/1.1 or HTTP/2 and specify a valid URI."
        },
        "healthCheckIntervalSeconds": {
          "type": "integer",
          "description": "The approximate amount of time, in seconds, between health checks of an individual target. The range is 5–300 seconds. The default is 30 seconds."
        },
        "healthCheckTimeoutSeconds": {
          "type": "integer",
          "description": "The amount of time, in seconds, to wait before reporting a target as unhealthy. The range is 1–120 seconds. The default is 5 seconds."
        },
        "healthyThresholdCount": {
          "type": "integer",
          "description": "The number of consecutive successful health checks required before considering an unhealthy target healthy. The range is 2–10. The default is 5."
        },
        "unhealthyThresholdCount": {
          "type": "integer",
          "description": "The number of consecutive failed health checks required before considering a target unhealthy. The range is 2–10. The default is 2."
        },
        "matcher": {
          "$ref": "#/$defs/Matcher"
        }
      }
    },
    "Matcher": {
      "type": "object",
      "properties": {
        "httpCode": {
          "type": "string",
          "description": "The HTTP code to use when checking for a successful response from a target."
        }
      },
      "description": "Exactly one member is set."
    },
    "TargetGroupConfig": {
      "type": "object",
      "properties": {
        "port": {
          "type": "integer",
          "description": "The port on which the targets are listening. For HTTP, the default is 80. For HTTPS, the default is 443. Not supported if the target group type is LAMBDA."
        },
        "protocol": {
          "type": "string",
          "description": "The protocol to use for routing traffic to the targets. The default is the protocol of the target group. Not supported if the target group type is LAMBDA."
        },
        "protocolVersion": {
          "type": "string",
          "description": "The protocol version. The default is HTTP1. Not supported if the target group type is LAMBDA."
        },
        "ipAddressType": {
          "type": "string",
          "description": "The type of IP address used for the target group. Supported only if the target group type is IP. The default is IPV4."
        },
        "vpcIdentifier": {
          "type": "string",
          "description": "The ID of the VPC. Not supported if the target group type is LAMBDA."
        },
        "healthCheck": {
          "$ref": "#/$defs/HealthCheckConfig"
        },
        "lambdaEventStructureVersion": {
          "type": "string",
          "description": "The version of the event structure that your Lambda function receives. Supported only if the target group type is LAMBDA. The default is V1."
        }
      }
    }
  }
}