# TargetGroupBase

Define the target of a load balancer.

Extends: Construct › TargetGroupBase
Implements: ITargetGroup, IEnvironmentAware, ITargetGroupRef, IConstruct, IDependable
Superclass of: ApplicationTargetGroup, NetworkTargetGroup

- Source: [`aws-elasticloadbalancingv2/lib/shared/base-target-group.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts#L241)
- Type last changed: v2.234.0 · 8 Jan 2026

## Initializer

```ts
new TargetGroupBase(scope: Construct, id: string, baseProps: BaseTargetGroupProps, additionalProps: any)
```

## Construct Props

- `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.

- `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

- `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.

- `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`

## Properties

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) — The environment this resource belongs to.

- `firstLoadBalancerFullName`: string — Full name of first load balancer.

  This identifier is emitted as a dimensions of the metrics of this target
  group.

  Example value: `app/my-load-balancer/123456789`

- `healthCheck`: [HealthCheck](/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.HealthCheck.html) — Health check for the members of this target group.

- `loadBalancerArns`: string — A token representing a list of ARNs of the load balancers that route traffic to this target group.

- `loadBalancerAttached`: [IDependable](/cdk/api/v2/docs/constructs.IDependable.html) — List of constructs that need to be depended on to ensure the TargetGroup is associated to a load balancer.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `targetGroupArn`: string — The ARN of the target group.

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

- `targetGroupLoadBalancerArns`: string[] — ARNs of load balancers load balancing to this TargetGroup.

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

- `targetGroupRef`: [TargetGroupReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_elasticloadbalancingv2.TargetGroupReference.html) — A reference to this target group.

## Methods

- `configureHealthCheck(healthCheck: HealthCheck): void` — Set/replace the target group's health check.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `setAttribute(key: string, value?: string): void` — Set a non-standard attribute on the target group.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
