@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:46.995Z") public class ApplicationTargetGroup extends TargetGroupBase implements IApplicationTargetGroup
Example:
Vpc vpc; // Target group with duration-based stickiness with load-balancer generated cookie ApplicationTargetGroup tg1 = ApplicationTargetGroup.Builder.create(this, "TG1") .targetType(TargetType.INSTANCE) .port(80) .stickinessCookieDuration(Duration.minutes(5)) .vpc(vpc) .build(); // Target group with application-based stickiness ApplicationTargetGroup tg2 = ApplicationTargetGroup.Builder.create(this, "TG2") .targetType(TargetType.INSTANCE) .port(80) .stickinessCookieDuration(Duration.minutes(5)) .stickinessCookieName("MyDeliciousCookie") .vpc(vpc) .build();
Modifier and Type | Class and Description |
---|---|
static class |
ApplicationTargetGroup.Builder
A fluent builder for
ApplicationTargetGroup . |
IApplicationTargetGroup.Jsii$Default, IApplicationTargetGroup.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
ApplicationTargetGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ApplicationTargetGroup(software.amazon.jsii.JsiiObjectRef objRef) |
|
ApplicationTargetGroup(software.constructs.Construct scope,
java.lang.String id) |
|
ApplicationTargetGroup(software.constructs.Construct scope,
java.lang.String id,
ApplicationTargetGroupProps props) |
Modifier and Type | Method and Description |
---|---|
void |
addTarget(IApplicationLoadBalancerTarget... targets)
Add a load balancing target to this target group.
|
static IApplicationTargetGroup |
doImport(software.constructs.Construct scope,
java.lang.String id,
TargetGroupImportProps props)
Deprecated.
Use `fromTargetGroupAttributes` instead
|
void |
enableCookieStickiness(Duration duration)
Enable sticky routing via a cookie to members of this target group.
|
void |
enableCookieStickiness(Duration duration,
java.lang.String cookieName)
Enable sticky routing via a cookie to members of this target group.
|
static IApplicationTargetGroup |
fromTargetGroupAttributes(software.constructs.Construct scope,
java.lang.String id,
TargetGroupAttributes attrs)
Import an existing target group.
|
java.lang.String |
getFirstLoadBalancerFullName()
Full name of first load balancer.
|
Metric |
metric(java.lang.String metricName)
Return the given named metric for this Application Load Balancer Target Group.
|
Metric |
metric(java.lang.String metricName,
MetricOptions props)
Return the given named metric for this Application Load Balancer Target Group.
|
Metric |
metricHealthyHostCount()
The number of healthy hosts in the target group.
|
Metric |
metricHealthyHostCount(MetricOptions props)
The number of healthy hosts in the target group.
|
Metric |
metricHttpCodeTarget(HttpCodeTarget code)
The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in this target group.
|
Metric |
metricHttpCodeTarget(HttpCodeTarget code,
MetricOptions props)
The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in this target group.
|
Metric |
metricIpv6RequestCount()
The number of IPv6 requests received by the target group.
|
Metric |
metricIpv6RequestCount(MetricOptions props)
The number of IPv6 requests received by the target group.
|
Metric |
metricRequestCount()
The number of requests processed over IPv4 and IPv6.
|
Metric |
metricRequestCount(MetricOptions props)
The number of requests processed over IPv4 and IPv6.
|
Metric |
metricRequestCountPerTarget()
The average number of requests received by each target in a target group.
|
Metric |
metricRequestCountPerTarget(MetricOptions props)
The average number of requests received by each target in a target group.
|
Metric |
metricTargetConnectionErrorCount()
The number of connections that were not successfully established between the load balancer and target.
|
Metric |
metricTargetConnectionErrorCount(MetricOptions props)
The number of connections that were not successfully established between the load balancer and target.
|
Metric |
metricTargetResponseTime()
The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received.
|
Metric |
metricTargetResponseTime(MetricOptions props)
The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received.
|
Metric |
metricTargetTLSNegotiationErrorCount()
The number of TLS connections initiated by the load balancer that did not establish a session with the target.
|
Metric |
metricTargetTLSNegotiationErrorCount(MetricOptions props)
The number of TLS connections initiated by the load balancer that did not establish a session with the target.
|
Metric |
metricUnhealthyHostCount()
The number of unhealthy hosts in the target group.
|
Metric |
metricUnhealthyHostCount(MetricOptions props)
The number of unhealthy hosts in the target group.
|
void |
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.
|
protected java.util.List<java.lang.String> |
validate()
Validate the current construct.
|
addLoadBalancerTarget, configureHealthCheck, getDefaultPort, getHealthCheck, getLoadBalancerArns, getLoadBalancerAttached, getLoadBalancerAttachedDependencies, getTargetGroupArn, getTargetGroupFullName, getTargetGroupLoadBalancerArns, getTargetGroupName, getTargetType, setAttribute, setAttribute, setHealthCheck, setTargetType
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLoadBalancerArns, getLoadBalancerAttached, getTargetGroupArn, getTargetGroupName
getNode
protected ApplicationTargetGroup(software.amazon.jsii.JsiiObjectRef objRef)
protected ApplicationTargetGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public ApplicationTargetGroup(software.constructs.Construct scope, java.lang.String id, ApplicationTargetGroupProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public ApplicationTargetGroup(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public static IApplicationTargetGroup fromTargetGroupAttributes(software.constructs.Construct scope, java.lang.String id, TargetGroupAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.@Deprecated public static IApplicationTargetGroup doImport(software.constructs.Construct scope, java.lang.String id, TargetGroupImportProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public void addTarget(IApplicationLoadBalancerTarget... targets)
addTarget
in interface IApplicationTargetGroup
targets
- This parameter is required.public void enableCookieStickiness(Duration duration, java.lang.String cookieName)
Note: If the cookieName
parameter is set, application-based stickiness will be applied,
otherwise it defaults to duration-based stickiness attributes (lb_cookie
).
duration
- This parameter is required.cookieName
- public void enableCookieStickiness(Duration duration)
Note: If the cookieName
parameter is set, application-based stickiness will be applied,
otherwise it defaults to duration-based stickiness attributes (lb_cookie
).
duration
- This parameter is required.public Metric metric(java.lang.String metricName, MetricOptions props)
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
metricName
- This parameter is required.props
- public Metric metric(java.lang.String metricName)
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
metricName
- This parameter is required.public Metric metricHealthyHostCount(MetricOptions props)
Default: Average over 5 minutes
props
- public Metric metricHealthyHostCount()
Default: Average over 5 minutes
public Metric metricHttpCodeTarget(HttpCodeTarget code, MetricOptions props)
This does not include any response codes generated by the load balancer.
Default: Sum over 5 minutes
code
- This parameter is required.props
- public Metric metricHttpCodeTarget(HttpCodeTarget code)
This does not include any response codes generated by the load balancer.
Default: Sum over 5 minutes
code
- This parameter is required.public Metric metricIpv6RequestCount(MetricOptions props)
Default: Sum over 5 minutes
props
- public Metric metricIpv6RequestCount()
Default: Sum over 5 minutes
public Metric metricRequestCount(MetricOptions props)
This count includes only the requests with a response generated by a target of the load balancer.
Default: Sum over 5 minutes
props
- public Metric metricRequestCount()
This count includes only the requests with a response generated by a target of the load balancer.
Default: Sum over 5 minutes
public Metric metricRequestCountPerTarget(MetricOptions props)
The only valid statistic is Sum. Note that this represents the average not the sum.
Default: Sum over 5 minutes
props
- public Metric metricRequestCountPerTarget()
The only valid statistic is Sum. Note that this represents the average not the sum.
Default: Sum over 5 minutes
public Metric metricTargetConnectionErrorCount(MetricOptions props)
Default: Sum over 5 minutes
props
- public Metric metricTargetConnectionErrorCount()
Default: Sum over 5 minutes
public Metric metricTargetResponseTime(MetricOptions props)
Default: Average over 5 minutes
props
- public Metric metricTargetResponseTime()
Default: Average over 5 minutes
public Metric metricTargetTLSNegotiationErrorCount(MetricOptions props)
Possible causes include a mismatch of ciphers or protocols.
Default: Sum over 5 minutes
props
- public Metric metricTargetTLSNegotiationErrorCount()
Possible causes include a mismatch of ciphers or protocols.
Default: Sum over 5 minutes
public Metric metricUnhealthyHostCount(MetricOptions props)
Default: Average over 5 minutes
props
- public Metric metricUnhealthyHostCount()
Default: Average over 5 minutes
public void registerConnectable(IConnectable connectable, Port portRange)
Don't call this directly. It will be called by load balancing targets.
registerConnectable
in interface IApplicationTargetGroup
connectable
- This parameter is required.portRange
- public void registerConnectable(IConnectable connectable)
Don't call this directly. It will be called by load balancing targets.
registerConnectable
in interface IApplicationTargetGroup
connectable
- This parameter is required.public void registerListener(IApplicationListener listener, software.constructs.IConstruct associatingConstruct)
Don't call this directly. It will be called by listeners.
registerListener
in interface IApplicationTargetGroup
listener
- This parameter is required.associatingConstruct
- public void registerListener(IApplicationListener listener)
Don't call this directly. It will be called by listeners.
registerListener
in interface IApplicationTargetGroup
listener
- This parameter is required.protected java.util.List<java.lang.String> validate()
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
validate
in class TargetGroupBase
public java.lang.String getFirstLoadBalancerFullName()
getFirstLoadBalancerFullName
in class TargetGroupBase