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 ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.IApplicationTargetGroup
IApplicationTargetGroup.Jsii$Default, IApplicationTargetGroup.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.ITargetGroup
ITargetGroup.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedApplicationTargetGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedApplicationTargetGroup(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 TypeMethodDescriptionvoidaddTarget(IApplicationLoadBalancerTarget... targets) Add a load balancing target to this target group.voidenableCookieStickiness(Duration duration) Enable sticky routing via a cookie to members of this target group.voidenableCookieStickiness(Duration duration, String cookieName) Enable sticky routing via a cookie to members of this target group.static IApplicationTargetGroupfromTargetGroupAttributes(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.healthyHostCountinsteadDeprecated.UseApplicationTargetGroup.metrics.httpCodeTargetinsteadmetricHttpCodeTarget(HttpCodeTarget code, MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.httpCodeTargetinsteadDeprecated.UseApplicationTargetGroup.metrics.ipv6RequestCountinsteadDeprecated.UseApplicationTargetGroup.metrics.ipv6RequestCountinsteadDeprecated.UseApplicationTargetGroup.metrics.requestCountinsteadmetricRequestCount(MetricOptions props) Deprecated.UseApplicationTargetGroup.metrics.requestCountinsteadDeprecated.UseApplicationTargetGroup.metrics.requestCountPerTargetinsteadDeprecated.UseApplicationTargetGroup.metrics.requestCountPerTargetinsteadDeprecated.UseApplicationTargetGroup.metrics.targetConnectionErrorCountinsteadDeprecated.UseApplicationTargetGroup.metrics.targetConnectionErrorCountinsteadDeprecated.UseApplicationTargetGroup.metrics.targetResponseTimeinsteadDeprecated.UseApplicationTargetGroup.metrics.targetResponseTimeinsteadDeprecated.UseApplicationTargetGroup.metrics.tlsNegotiationErrorCountinsteadDeprecated.UseApplicationTargetGroup.metrics.tlsNegotiationErrorCountinsteadDeprecated.UseApplicationTargetGroup.metrics.unhealthyHostCountinsteadDeprecated.UseApplicationTargetGroup.metrics.unhealthyHostCountinsteadvoidregisterConnectable(IConnectable connectable) Register a connectable as a member of this target group.voidregisterConnectable(IConnectable connectable, Port portRange) Register a connectable as a member of this target group.voidregisterListener(IApplicationListener listener) Register a listener that is load balancing to this target group.voidregisterListener(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, validateHealthCheckMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.ITargetGroup
getLoadBalancerArns, getLoadBalancerAttached, getTargetGroupArn, getTargetGroupNameMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
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
Add a load balancing target to this target group.- Specified by:
addTargetin 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
cookieNameparameter 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
cookieNameparameter 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.healthyHostCountinstead(deprecated) The number of healthy hosts in the target group.Default: Average over 5 minutes
- Parameters:
props-
-
metricHealthyHostCount
Deprecated.UseApplicationTargetGroup.metrics.healthyHostCountinstead(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.httpCodeTargetinstead(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.httpCodeTargetinstead(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.ipv6RequestCountinstead(deprecated) The number of IPv6 requests received by the target group.Default: Sum over 5 minutes
- Parameters:
props-
-
metricIpv6RequestCount
Deprecated.UseApplicationTargetGroup.metrics.ipv6RequestCountinstead(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.requestCountinstead(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.requestCountinstead(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.requestCountPerTargetinstead(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.requestCountPerTargetinstead(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.targetConnectionErrorCountinstead(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.targetConnectionErrorCountinstead(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.targetResponseTimeinstead(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.targetResponseTimeinstead(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.tlsNegotiationErrorCountinstead(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.tlsNegotiationErrorCountinstead(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.unhealthyHostCountinstead(deprecated) The number of unhealthy hosts in the target group.Default: Average over 5 minutes
- Parameters:
props-
-
metricUnhealthyHostCount
Deprecated.UseApplicationTargetGroup.metrics.unhealthyHostCountinstead(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:
registerConnectablein 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:
registerConnectablein 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:
registerListenerin 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:
registerListenerin interfaceIApplicationTargetGroup- Parameters:
listener- This parameter is required.
-
validateTargetGroup
- Overrides:
validateTargetGroupin classTargetGroupBase
-
getFirstLoadBalancerFullName
Full name of first load balancer.- Specified by:
getFirstLoadBalancerFullNamein classTargetGroupBase
-
getMetrics
All metrics available for this target group.- Specified by:
getMetricsin interfaceIApplicationTargetGroup
-
ApplicationTargetGroup.metrics.healthyHostCountinstead