Class ApplicationTargetGroup
- All Implemented Interfaces:
IApplicationTargetGroup
,ITargetGroup
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
Example:
ApplicationLoadBalancer alb; ApplicationListener listener = alb.addListener("Listener", BaseApplicationListenerProps.builder().port(80).build()); ApplicationTargetGroup targetGroup = listener.addTargets("Fleet", AddApplicationTargetsProps.builder().port(80).build()); ServerDeploymentGroup deploymentGroup = ServerDeploymentGroup.Builder.create(this, "DeploymentGroup") .loadBalancer(LoadBalancer.application(targetGroup)) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.IApplicationTargetGroup
IApplicationTargetGroup.Jsii$Default, IApplicationTargetGroup.Jsii$Proxy
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.ITargetGroup
ITargetGroup.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
ApplicationTargetGroup
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
ApplicationTargetGroup
(software.amazon.jsii.JsiiObjectRef objRef) ApplicationTargetGroup
(software.constructs.Construct scope, String id) ApplicationTargetGroup
(software.constructs.Construct scope, String id, ApplicationTargetGroupProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTarget
(@NotNull IApplicationLoadBalancerTarget... targets) Add a load balancing target to this target group.void
enableCookieStickiness
(Duration duration) Enable sticky routing via a cookie to members of this target group.void
enableCookieStickiness
(Duration duration, String cookieName) Enable sticky routing via a cookie to members of this target group.static IApplicationTargetGroup
fromTargetGroupAttributes
(software.constructs.Construct scope, String id, TargetGroupAttributes attrs) Import an existing target group.Full name of first load balancer.All metrics available for this target group.Return the given named metric for this Application Load Balancer Target Group.metric
(String metricName, MetricOptions props) Return the given named metric for this Application Load Balancer Target Group.Deprecated.Deprecated.UseApplicationTargetGroup.metrics.healthyHostCount
insteadDeprecated.UseApplicationTargetGroup.metrics.httpCodeTarget
insteadmetricHttpCodeTarget
(HttpCodeTarget code, MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.httpCodeTarget
insteadDeprecated.UseApplicationTargetGroup.metrics.ipv6RequestCount
insteadDeprecated.UseApplicationTargetGroup.metrics.ipv6RequestCount
insteadDeprecated.UseApplicationTargetGroup.metrics.requestCount
insteadmetricRequestCount
(MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.requestCount
insteadDeprecated.UseApplicationTargetGroup.metrics.requestCountPerTarget
insteadDeprecated.UseApplicationTargetGroup.metrics.requestCountPerTarget
insteadDeprecated.UseApplicationTargetGroup.metrics.targetConnectionErrorCount
insteadDeprecated.UseApplicationTargetGroup.metrics.targetConnectionErrorCount
insteadDeprecated.UseApplicationTargetGroup.metrics.targetResponseTime
insteadDeprecated.UseApplicationTargetGroup.metrics.targetResponseTime
insteadDeprecated.UseApplicationTargetGroup.metrics.tlsNegotiationErrorCount
insteadDeprecated.UseApplicationTargetGroup.metrics.tlsNegotiationErrorCount
insteadDeprecated.UseApplicationTargetGroup.metrics.unhealthyHostCount
insteadDeprecated.UseApplicationTargetGroup.metrics.unhealthyHostCount
insteadvoid
registerConnectable
(IConnectable connectable) Register a connectable as a member of this target group.void
registerConnectable
(IConnectable connectable, Port portRange) Register a connectable as a member of this target group.void
registerListener
(IApplicationListener listener) Register a listener that is load balancing to this target group.void
registerListener
(IApplicationListener listener, software.constructs.IConstruct associatingConstruct) Register a listener that is load balancing to this target group.Methods inherited from class software.amazon.awscdk.services.elasticloadbalancingv2.TargetGroupBase
addLoadBalancerTarget, configureHealthCheck, getDefaultPort, getHealthCheck, getLoadBalancerArns, getLoadBalancerAttached, getLoadBalancerAttachedDependencies, getTargetGroupArn, getTargetGroupFullName, getTargetGroupLoadBalancerArns, getTargetGroupName, getTargetType, setAttribute, setAttribute, setHealthCheck, setTargetType, validateHealthCheck
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.ITargetGroup
getLoadBalancerArns, getLoadBalancerAttached, getTargetGroupArn, getTargetGroupName
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ApplicationTargetGroup
protected ApplicationTargetGroup(software.amazon.jsii.JsiiObjectRef objRef) -
ApplicationTargetGroup
protected ApplicationTargetGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ApplicationTargetGroup
@Stability(Stable) public ApplicationTargetGroup(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ApplicationTargetGroupProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
ApplicationTargetGroup
@Stability(Stable) public ApplicationTargetGroup(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Details
-
fromTargetGroupAttributes
@Stability(Stable) @NotNull public static IApplicationTargetGroup fromTargetGroupAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TargetGroupAttributes attrs) Import an existing target group.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
addTarget
@Stability(Stable) public void addTarget(@NotNull @NotNull IApplicationLoadBalancerTarget... targets) Add a load balancing target to this target group.- Specified by:
addTarget
in interfaceIApplicationTargetGroup
- Parameters:
targets
- This parameter is required.
-
enableCookieStickiness
@Stability(Stable) public void enableCookieStickiness(@NotNull Duration duration, @Nullable String cookieName) Enable sticky routing via a cookie to members of this target group.Note: If the
cookieName
parameter is set, application-based stickiness will be applied, otherwise it defaults to duration-based stickiness attributes (lb_cookie
).- Parameters:
duration
- This parameter is required.cookieName
-- See Also:
-
enableCookieStickiness
Enable sticky routing via a cookie to members of this target group.Note: If the
cookieName
parameter is set, application-based stickiness will be applied, otherwise it defaults to duration-based stickiness attributes (lb_cookie
).- Parameters:
duration
- This parameter is required.- See Also:
-
metric
@Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props) Return the given named metric for this Application Load Balancer Target Group.Returns the metric for this target group from the point of view of the first load balancer load balancing to it. If you have multiple load balancers load sending traffic to the same target group, you will have to override the dimensions on this metric.
Default: Average over 5 minutes
- Parameters:
metricName
- This parameter is required.props
-
-
metric
Return the given named metric for this Application Load Balancer Target Group.Returns the metric for this target group from the point of view of the first load balancer load balancing to it. If you have multiple load balancers load sending traffic to the same target group, you will have to override the dimensions on this metric.
Default: Average over 5 minutes
- Parameters:
metricName
- This parameter is required.
-
metricHealthyHostCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricHealthyHostCount(@Nullable MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.healthyHostCount
instead(deprecated) The number of healthy hosts in the target group.Default: Average over 5 minutes
- Parameters:
props
-
-
metricHealthyHostCount
Deprecated.UseApplicationTargetGroup.metrics.healthyHostCount
instead(deprecated) The number of healthy hosts in the target group.Default: Average over 5 minutes
-
metricHttpCodeTarget
@Stability(Deprecated) @Deprecated @NotNull public Metric metricHttpCodeTarget(@NotNull HttpCodeTarget code, @Nullable MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.httpCodeTarget
instead(deprecated) The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in this target group.This does not include any response codes generated by the load balancer.
Default: Sum over 5 minutes
- Parameters:
code
- This parameter is required.props
-
-
metricHttpCodeTarget
@Stability(Deprecated) @Deprecated @NotNull public Metric metricHttpCodeTarget(@NotNull HttpCodeTarget code) Deprecated.UseApplicationTargetGroup.metrics.httpCodeTarget
instead(deprecated) The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in this target group.This does not include any response codes generated by the load balancer.
Default: Sum over 5 minutes
- Parameters:
code
- This parameter is required.
-
metricIpv6RequestCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricIpv6RequestCount(@Nullable MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.ipv6RequestCount
instead(deprecated) The number of IPv6 requests received by the target group.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricIpv6RequestCount
Deprecated.UseApplicationTargetGroup.metrics.ipv6RequestCount
instead(deprecated) The number of IPv6 requests received by the target group.Default: Sum over 5 minutes
-
metricRequestCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricRequestCount(@Nullable MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.requestCount
instead(deprecated) The number of requests processed over IPv4 and IPv6.This count includes only the requests with a response generated by a target of the load balancer.
Default: Sum over 5 minutes
- Parameters:
props
-
-
metricRequestCount
Deprecated.UseApplicationTargetGroup.metrics.requestCount
instead(deprecated) The number of requests processed over IPv4 and IPv6.This count includes only the requests with a response generated by a target of the load balancer.
Default: Sum over 5 minutes
-
metricRequestCountPerTarget
@Stability(Deprecated) @Deprecated @NotNull public Metric metricRequestCountPerTarget(@Nullable MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.requestCountPerTarget
instead(deprecated) The average number of requests received by each target in a target group.The only valid statistic is Sum. Note that this represents the average not the sum.
Default: Sum over 5 minutes
- Parameters:
props
-
-
metricRequestCountPerTarget
Deprecated.UseApplicationTargetGroup.metrics.requestCountPerTarget
instead(deprecated) The average number of requests received by each target in a target group.The only valid statistic is Sum. Note that this represents the average not the sum.
Default: Sum over 5 minutes
-
metricTargetConnectionErrorCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricTargetConnectionErrorCount(@Nullable MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.targetConnectionErrorCount
instead(deprecated) The number of connections that were not successfully established between the load balancer and target.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricTargetConnectionErrorCount
Deprecated.UseApplicationTargetGroup.metrics.targetConnectionErrorCount
instead(deprecated) The number of connections that were not successfully established between the load balancer and target.Default: Sum over 5 minutes
-
metricTargetResponseTime
@Stability(Deprecated) @Deprecated @NotNull public Metric metricTargetResponseTime(@Nullable MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.targetResponseTime
instead(deprecated) The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received.Default: Average over 5 minutes
- Parameters:
props
-
-
metricTargetResponseTime
Deprecated.UseApplicationTargetGroup.metrics.targetResponseTime
instead(deprecated) The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received.Default: Average over 5 minutes
-
metricTargetTLSNegotiationErrorCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricTargetTLSNegotiationErrorCount(@Nullable MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.tlsNegotiationErrorCount
instead(deprecated) The number of TLS connections initiated by the load balancer that did not establish a session with the target.Possible causes include a mismatch of ciphers or protocols.
Default: Sum over 5 minutes
- Parameters:
props
-
-
metricTargetTLSNegotiationErrorCount
Deprecated.UseApplicationTargetGroup.metrics.tlsNegotiationErrorCount
instead(deprecated) The number of TLS connections initiated by the load balancer that did not establish a session with the target.Possible causes include a mismatch of ciphers or protocols.
Default: Sum over 5 minutes
-
metricUnhealthyHostCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricUnhealthyHostCount(@Nullable MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.unhealthyHostCount
instead(deprecated) The number of unhealthy hosts in the target group.Default: Average over 5 minutes
- Parameters:
props
-
-
metricUnhealthyHostCount
Deprecated.UseApplicationTargetGroup.metrics.unhealthyHostCount
instead(deprecated) The number of unhealthy hosts in the target group.Default: Average over 5 minutes
-
registerConnectable
@Stability(Stable) public void registerConnectable(@NotNull IConnectable connectable, @Nullable Port portRange) Register a connectable as a member of this target group.Don't call this directly. It will be called by load balancing targets.
- Specified by:
registerConnectable
in interfaceIApplicationTargetGroup
- Parameters:
connectable
- This parameter is required.portRange
-
-
registerConnectable
Register a connectable as a member of this target group.Don't call this directly. It will be called by load balancing targets.
- Specified by:
registerConnectable
in interfaceIApplicationTargetGroup
- Parameters:
connectable
- This parameter is required.
-
registerListener
@Stability(Stable) public void registerListener(@NotNull IApplicationListener listener, @Nullable software.constructs.IConstruct associatingConstruct) Register a listener that is load balancing to this target group.Don't call this directly. It will be called by listeners.
- Specified by:
registerListener
in interfaceIApplicationTargetGroup
- Parameters:
listener
- This parameter is required.associatingConstruct
-
-
registerListener
Register a listener that is load balancing to this target group.Don't call this directly. It will be called by listeners.
- Specified by:
registerListener
in interfaceIApplicationTargetGroup
- Parameters:
listener
- This parameter is required.
-
validateTargetGroup
- Overrides:
validateTargetGroup
in classTargetGroupBase
-
getFirstLoadBalancerFullName
Full name of first load balancer.- Specified by:
getFirstLoadBalancerFullName
in classTargetGroupBase
-
getMetrics
All metrics available for this target group.- Specified by:
getMetrics
in interfaceIApplicationTargetGroup
-
ApplicationTargetGroup.metrics.healthyHostCount
instead