Skip to content
v2.274.0

TargetGroupBase ​

Define the target of a load balancer.

Initializer ​

ts
new TargetGroupBase(scope: Construct, id: string, baseProps: BaseTargetGroupProps, additionalProps: any)
python
TargetGroupBase(scope: Construct, id: str, base_props: BaseTargetGroupProps, additional_props: Any)
java
new TargetGroupBase(Construct scope, String id, BaseTargetGroupProps baseProps, Object additionalProps)
csharp
new TargetGroupBase(Construct scope, string id, BaseTargetGroupProps baseProps, object additionalProps)
go
NewTargetGroupBase(Scope Construct, Id *string, BaseProps BaseTargetGroupProps, AdditionalProps interface{})

Construct Props ​

crossZoneEnabledbooleancross_zone_enabledboolcrossZoneEnabledBooleanCrossZoneEnabledboolCrossZoneEnabled*bool#
Indicates whether cross zone load balancing is enabled.

Default: use load balancer configuration

deregistrationDelayDurationderegistration_delayDurationderegistrationDelayDurationDeregistrationDelayDurationDeregistrationDelayDuration= 300#
The amount of time for Elastic Load Balancing to wait before deregistering a target.

The range is 0-3600 seconds.

healthCheckHealthCheckhealth_checkHealthCheckhealthCheckHealthCheckHealthCheckHealthCheckHealthCheckHealthCheck#
Health check configuration.

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

The type of IP addresses of the targets registered with the target group.

Default: undefined - ELB defaults to IPv4

targetGroupHealthTargetGroupHealthtarget_group_healthTargetGroupHealthtargetGroupHealthTargetGroupHealthTargetGroupHealthTargetGroupHealthTargetGroupHealthTargetGroupHealth#
Configuring target group health.

Default: use default configuration

targetGroupNamestringtarget_group_namestrtargetGroupNameStringTargetGroupNamestringTargetGroupName*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.

targetTypeTargetTypetarget_typeTargetTypetargetTypeTargetTypeTargetTypeTargetTypeTargetTypeTargetType#
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.

vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpc= undefined#
The virtual private cloud (VPC).

only if TargetType is Ip or InstanceId

Properties ​

The environment this resource belongs to.
firstLoadBalancerFullNamestringfirst_load_balancer_full_namestrfirstLoadBalancerFullNameStringFirstLoadBalancerFullNamestringFirstLoadBalancerFullName*stringrequired#
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

healthCheckHealthCheckhealth_checkHealthCheckhealthCheckHealthCheckHealthCheckHealthCheckHealthCheckHealthCheckrequired#
Health check for the members of this target group.
loadBalancerArnsstringload_balancer_arnsstrloadBalancerArnsStringLoadBalancerArnsstringLoadBalancerArns*stringrequired#
A token representing a list of ARNs of the load balancers that route traffic to this target group.
loadBalancerAttachedIDependableload_balancer_attachedIDependableloadBalancerAttachedIDependableLoadBalancerAttachedIDependableLoadBalancerAttachedIDependablerequired#
List of constructs that need to be depended on to ensure the TargetGroup is associated to a load balancer.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
targetGroupArnstringtarget_group_arnstrtargetGroupArnStringTargetGroupArnstringTargetGroupArn*stringrequired#
The ARN of the target group.
targetGroupFullNamestringtarget_group_full_namestrtargetGroupFullNameStringTargetGroupFullNamestringTargetGroupFullName*stringrequired#
The full name of the target group.
targetGroupLoadBalancerArnsstring[]target_group_load_balancer_arnstyping.List[str]targetGroupLoadBalancerArnsList<String>TargetGroupLoadBalancerArnsstring[]TargetGroupLoadBalancerArns*[]*stringrequired#
ARNs of load balancers load balancing to this TargetGroup.
targetGroupNamestringtarget_group_namestrtargetGroupNameStringTargetGroupNamestringTargetGroupName*stringrequired#
The name of the target group.
targetGroupRefTargetGroupReferencetarget_group_refTargetGroupReferencetargetGroupRefTargetGroupReferenceTargetGroupRefTargetGroupReferenceTargetGroupRefTargetGroupReferencerequired#
A reference to this target group.

Methods ​

configureHealthCheck(healthCheck: HealthCheck): voiddef configure_health_check(self, health_check: HealthCheck) -> Nonepublic void configureHealthCheck(HealthCheck healthCheck)public void ConfigureHealthCheck(HealthCheck healthCheck)func ConfigureHealthCheck(HealthCheck HealthCheck)#
Set/replace the target group's health check.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

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

  • xxxxX — Any object.

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

setAttribute(key: string, value?: string): voiddef set_attribute(self, key: str, value: typing.Optional[str] = None) -> Nonepublic void setAttribute(String key, String value)public void SetAttribute(string key, string? value = null)func SetAttribute(Key *string, Value *string)#
Set a non-standard attribute on the target group.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func 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.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining