# ApplicationTargetGroupProps

Properties for defining an Application Target Group.

Extends: ApplicationTargetGroupProps
Extends: BaseTargetGroupProps
Used as props by: ApplicationTargetGroup

- Source: [`aws-elasticloadbalancingv2/lib/alb/application-target-group.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts#L26)
- Type last changed: v2.196.0 · 16 May 2025

## Example

```ts
declare const vpc: ec2.Vpc;

const tg = new elbv2.ApplicationTargetGroup(this, 'TG', {
  targetType: elbv2.TargetType.IP,
  port: 50051,
  protocol: elbv2.ApplicationProtocol.HTTP,
  protocolVersion: elbv2.ApplicationProtocolVersion.GRPC,
  healthCheck: {
    enabled: true,
    healthyGrpcCodes: '0-99',
  },
  vpc,
});
```

## Properties

- `crossZoneEnabled`: boolean — Indicates whether cross zone load balancing is enabled.

  **Default:** use load balancer configuration

- `deregistrationDelay`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = 300 — The amount of time for Elastic Load Balancing to wait before deregistering a target.

  The range is 0-3600 seconds.

- `enableAnomalyMitigation`: boolean = false — Indicates whether anomaly mitigation is enabled.

  Only available when `loadBalancingAlgorithmType` is `TargetGroupLoadBalancingAlgorithmType.WEIGHTED_RANDOM`

- `healthCheck`: [HealthCheck](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.HealthCheck.html) — Health check configuration.

  **Default:** The default value for each property in this configuration varies depending on the target.

- `ipAddressType`: [TargetGroupIpAddressType](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.TargetGroupIpAddressType.html) — The type of IP addresses of the targets registered with the target group.

  **Default:** undefined - ELB defaults to IPv4

- `loadBalancingAlgorithmType`: [TargetGroupLoadBalancingAlgorithmType](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.TargetGroupLoadBalancingAlgorithmType.html) — The load balancing algorithm to select targets for routing requests.

  **Default:** TargetGroupLoadBalancingAlgorithmType.ROUND_ROBIN

- `multiValueHeadersEnabled`: boolean = false — Indicates whether the target group supports multi-value headers.

  If the value is true, the request and response headers exchanged between
  the load balancer and the Lambda function include arrays of values or strings.

  Only applicable for Lambda targets.

- `port`: number — The port on which the target receives traffic.

  **Default:** Determined from protocol if known

  This is not applicable for Lambda targets.

- `protocol`: [ApplicationProtocol](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationProtocol.html) — The protocol used for communication with the target.

  **Default:** Determined from port if known

  This is not applicable for Lambda targets.

- `protocolVersion`: [ApplicationProtocolVersion](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationProtocolVersion.html) = ApplicationProtocolVersion.HTTP1 — The protocol version to use.

- `slowStart`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = 0 — The time period during which the load balancer sends a newly registered target a linearly increasing share of the traffic to the target group.

  The range is 30-900 seconds (15 minutes).

- `stickinessCookieDuration`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — The stickiness cookie expiration period.

  **Default:** Stickiness is disabled

  Setting this value enables load balancer stickiness.

  After this period, the cookie is considered stale. The minimum value is
  1 second and the maximum value is 7 days (604800 seconds).

- `stickinessCookieName`: string — The name of an application-based stickiness cookie.

  **Default:** If `stickinessCookieDuration` is set, a load-balancer generated cookie is used. Otherwise, no stickiness is defined.

  Names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP,
  and AWSALBTG; they're reserved for use by the load balancer.

  Note: `stickinessCookieName` parameter depends on the presence of `stickinessCookieDuration` parameter.
  If `stickinessCookieDuration` is not set, `stickinessCookieName` will be omitted.

- `targetGroupHealth`: [TargetGroupHealth](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.TargetGroupHealth.html) — Configuring target group health.

  **Default:** use default configuration

- `targetGroupName`: string — The name of the target group.

  **Default:** Automatically generated.

  This name must be unique per region per account, can have a maximum of
  32 characters, must contain only alphanumeric characters or hyphens, and
  must not begin or end with a hyphen.

- `targets`: [IApplicationLoadBalancerTarget](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.IApplicationLoadBalancerTarget.html)[] — The targets to add to this target group.

  **Default:** No targets.

  Can be `Instance`, `IPAddress`, or any self-registering load balancing
  target. If you use either `Instance` or `IPAddress` as targets, all
  target must be of the same type.

- `targetType`: [TargetType](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.TargetType.html) — The type of targets registered to this TargetGroup, either IP or Instance.

  **Default:** Determined automatically.

  All targets registered into the group must be of this type. If you
  register targets to the TargetGroup in the CDK app, the TargetType is
  determined automatically.

- `vpc`: [IVpc](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html) = undefined — The virtual private cloud (VPC).

  only if `TargetType` is `Ip` or `InstanceId`
