ApplicationTargetGroup
- class aws_cdk.aws_elasticloadbalancingv2.ApplicationTargetGroup(scope, id, *, enable_anomaly_mitigation=None, load_balancing_algorithm_type=None, port=None, protocol=None, protocol_version=None, slow_start=None, stickiness_cookie_duration=None, stickiness_cookie_name=None, targets=None, deregistration_delay=None, health_check=None, target_group_name=None, target_type=None, vpc=None)
Bases:
TargetGroupBase
Define an Application Target Group.
- ExampleMetadata:
infused
Example:
# alb: elbv2.ApplicationLoadBalancer listener = alb.add_listener("Listener", port=80) target_group = listener.add_targets("Fleet", port=80) deployment_group = codedeploy.ServerDeploymentGroup(self, "DeploymentGroup", load_balancer=codedeploy.LoadBalancer.application(target_group) )
- Parameters:
scope (
Construct
) –id (
str
) –enable_anomaly_mitigation (
Optional
[bool
]) – Indicates whether anomaly mitigation is enabled. Only available whenloadBalancingAlgorithmType
isTargetGroupLoadBalancingAlgorithmType.WEIGHTED_RANDOM
Default: falseload_balancing_algorithm_type (
Optional
[TargetGroupLoadBalancingAlgorithmType
]) – The load balancing algorithm to select targets for routing requests. Default: TargetGroupLoadBalancingAlgorithmType.ROUND_ROBINport (
Union
[int
,float
,None
]) – The port on which the target receives traffic. This is not applicable for Lambda targets. Default: - Determined from protocol if knownprotocol (
Optional
[ApplicationProtocol
]) – The protocol used for communication with the target. This is not applicable for Lambda targets. Default: - Determined from port if knownprotocol_version (
Optional
[ApplicationProtocolVersion
]) – The protocol version to use. Default: ApplicationProtocolVersion.HTTP1slow_start (
Optional
[Duration
]) – The time period during which the load balancer sends a newly registered target a linearly increasing share of the traffic to the target group. The range is 30-900 seconds (15 minutes). Default: 0stickiness_cookie_duration (
Optional
[Duration
]) – The stickiness cookie expiration period. Setting this value enables load balancer stickiness. After this period, the cookie is considered stale. The minimum value is 1 second and the maximum value is 7 days (604800 seconds). Default: - Stickiness is disabledstickiness_cookie_name (
Optional
[str
]) – The name of an application-based stickiness cookie. Names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP, and AWSALBTG; they’re reserved for use by the load balancer. Note:stickinessCookieName
parameter depends on the presence ofstickinessCookieDuration
parameter. IfstickinessCookieDuration
is not set,stickinessCookieName
will be omitted. Default: - IfstickinessCookieDuration
is set, a load-balancer generated cookie is used. Otherwise, no stickiness is defined.targets (
Optional
[Sequence
[IApplicationLoadBalancerTarget
]]) – The targets to add to this target group. Can beInstance
,IPAddress
, or any self-registering load balancing target. If you use eitherInstance
orIPAddress
as targets, all target must be of the same type. Default: - No targets.deregistration_delay (
Optional
[Duration
]) – The amount of time for Elastic Load Balancing to wait before deregistering a target. The range is 0-3600 seconds. Default: 300health_check (
Union
[HealthCheck
,Dict
[str
,Any
],None
]) – Health check configuration. Default: - The default value for each property in this configuration varies depending on the target.target_group_name (
Optional
[str
]) – The name of the target group. 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. Default: - Automatically generated.target_type (
Optional
[TargetType
]) – The type of targets registered to this TargetGroup, either IP or Instance. 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. Default: - Determined automatically.vpc (
Optional
[IVpc
]) – The virtual private cloud (VPC). only ifTargetType
isIp
orInstanceId
Default: - undefined
Methods
- add_target(*targets)
Add a load balancing target to this target group.
- Parameters:
targets (
IApplicationLoadBalancerTarget
) –- Return type:
None
- configure_health_check(*, enabled=None, healthy_grpc_codes=None, healthy_http_codes=None, healthy_threshold_count=None, interval=None, path=None, port=None, protocol=None, timeout=None, unhealthy_threshold_count=None)
Set/replace the target group’s health check.
- Parameters:
enabled (
Optional
[bool
]) – Indicates whether health checks are enabled. If the target type is lambda, health checks are disabled by default but can be enabled. If the target type is instance or ip, health checks are always enabled and cannot be disabled. Default: - Determined automatically.healthy_grpc_codes (
Optional
[str
]) – GRPC code to use when checking for a successful response from a target. You can specify values between 0 and 99. You can specify multiple values (for example, “0,1”) or a range of values (for example, “0-5”). Default: - 12healthy_http_codes (
Optional
[str
]) – HTTP code to use when checking for a successful response from a target. For Application Load Balancers, you can specify values between 200 and 499, and the default value is 200. You can specify multiple values (for example, “200,202”) or a range of values (for example, “200-299”).healthy_threshold_count (
Union
[int
,float
,None
]) – The number of consecutive health checks successes required before considering an unhealthy target healthy. For Application Load Balancers, the default is 5. For Network Load Balancers, the default is 3. Default: 5 for ALBs, 3 for NLBsinterval (
Optional
[Duration
]) – The approximate number of seconds between health checks for an individual target. Must be 5 to 300 seconds Default: 10 seconds if protocol isGENEVE
, 35 seconds if target type islambda
, else 30 secondspath (
Optional
[str
]) – The ping path destination where Elastic Load Balancing sends health check requests. Default: /port (
Optional
[str
]) – The port that the load balancer uses when performing health checks on the targets. Default: ‘traffic-port’protocol (
Optional
[Protocol
]) – The protocol the load balancer uses when performing health checks on targets. The TCP protocol is supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols are not supported for health checks. Default: HTTP for ALBs, TCP for NLBstimeout (
Optional
[Duration
]) – The amount of time, in seconds, during which no response from a target means a failed health check. Must be 2 to 120 seconds. Default: 6 seconds if the protocol is HTTP, 5 seconds if protocol isGENEVE
, 30 seconds if target type islambda
, 10 seconds for TCP, TLS, or HTTPSunhealthy_threshold_count (
Union
[int
,float
,None
]) – The number of consecutive health check failures required before considering a target unhealthy. For Application Load Balancers, the default is 2. For Network Load Balancers, this value must be the same as the healthy threshold count. Default: 2
- Return type:
None
- enable_cookie_stickiness(duration, cookie_name=None)
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 (
Duration
) –cookie_name (
Optional
[str
]) –
- See:
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html
- Return type:
None
- metric(metric_name, *, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
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.
- Parameters:
metric_name (
str
) –account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) – Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No labelperiod (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Default:
Average over 5 minutes
- Return type:
- metric_healthy_host_count(*, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(deprecated) The number of healthy hosts in the target group.
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Default:
Average over 5 minutes
- Deprecated:
Use
ApplicationTargetGroup.metrics.healthyHostCount
instead- Stability:
deprecated
- Return type:
- metric_http_code_target(code, *, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(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.
- Parameters:
code (
HttpCodeTarget
) –account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Default:
Sum over 5 minutes
- Deprecated:
Use
ApplicationTargetGroup.metrics.httpCodeTarget
instead- Stability:
deprecated
- Return type:
- metric_ipv6_request_count(*, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(deprecated) The number of IPv6 requests received by the target group.
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Default:
Sum over 5 minutes
- Deprecated:
Use
ApplicationTargetGroup.metrics.ipv6RequestCount
instead- Stability:
deprecated
- Return type:
- metric_request_count(*, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(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.
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Default:
Sum over 5 minutes
- Deprecated:
Use
ApplicationTargetGroup.metrics.requestCount
instead- Stability:
deprecated
- Return type:
- metric_request_count_per_target(*, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(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.
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Default:
Sum over 5 minutes
- Deprecated:
Use
ApplicationTargetGroup.metrics.requestCountPerTarget
instead- Stability:
deprecated
- Return type:
- metric_target_connection_error_count(*, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(deprecated) The number of connections that were not successfully established between the load balancer and target.
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Default:
Sum over 5 minutes
- Deprecated:
Use
ApplicationTargetGroup.metrics.targetConnectionErrorCount
instead- Stability:
deprecated
- Return type:
- metric_target_response_time(*, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(deprecated) The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received.
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Default:
Average over 5 minutes
- Deprecated:
Use
ApplicationTargetGroup.metrics.targetResponseTime
instead- Stability:
deprecated
- Return type:
- metric_target_tls_negotiation_error_count(*, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(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.
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Default:
Sum over 5 minutes
- Deprecated:
Use
ApplicationTargetGroup.metrics.tlsNegotiationErrorCount
instead- Stability:
deprecated
- Return type:
- metric_unhealthy_host_count(*, account=None, color=None, dimensions_map=None, label=None, period=None, region=None, statistic=None, unit=None)
(deprecated) The number of unhealthy hosts in the target group.
- Parameters:
account (
Optional
[str
]) – Account which this metric comes from. Default: - Deployment account.color (
Optional
[str
]) – The hex color code, prefixed with ‘#’ (e.g. ‘#00ff00’), to use when this metric is rendered on a graph. TheColor
class has a set of standard colors that can be used here. Default: - Automatic colordimensions_map (
Optional
[Mapping
[str
,str
]]) – Dimensions of the metric. Default: - No dimensions.label (
Optional
[str
]) –Label for this metric when added to a Graph in a Dashboard. You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:: [max: ${MAX}] MyMetric As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph’s legend. Default: - No label
period (
Optional
[Duration
]) – The period over which the specified statistic is applied. Default: Duration.minutes(5)region (
Optional
[str
]) – Region which this metric comes from. Default: - Deployment region.statistic (
Optional
[str
]) – What function to use for aggregating. Use theaws_cloudwatch.Stats
helper class to construct valid input strings. Can be one of the following: - “Minimum” | “min” - “Maximum” | “max” - “Average” | “avg” - “Sum” | “sum” - “SampleCount | “n” - “pNN.NN” - “tmNN.NN” | “tm(NN.NN%:NN.NN%)” - “iqm” - “wmNN.NN” | “wm(NN.NN%:NN.NN%)” - “tcNN.NN” | “tc(NN.NN%:NN.NN%)” - “tsNN.NN” | “ts(NN.NN%:NN.NN%)” Default: Averageunit (
Optional
[Unit
]) – Unit used to filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases. CloudWatch does not honor this property for graphs. Default: - All metric datums in the given metric stream
- Default:
Average over 5 minutes
- Deprecated:
Use
ApplicationTargetGroup.metrics.unhealthyHostCount
instead- Stability:
deprecated
- Return type:
- register_connectable(connectable, port_range=None)
Register a connectable as a member of this target group.
Don’t call this directly. It will be called by load balancing targets.
- Parameters:
connectable (
IConnectable
) –port_range (
Optional
[Port
]) –
- Return type:
None
- register_listener(listener, associating_construct=None)
Register a listener that is load balancing to this target group.
Don’t call this directly. It will be called by listeners.
- Parameters:
listener (
IApplicationListener
) –associating_construct (
Optional
[IConstruct
]) –
- Return type:
None
- set_attribute(key, value=None)
Set a non-standard attribute on the target group.
- Parameters:
key (
str
) –value (
Optional
[str
]) –
- See:
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- first_load_balancer_full_name
Full name of first load balancer.
- health_check
Health check for the members of this target group.
- load_balancer_arns
A token representing a list of ARNs of the load balancers that route traffic to this target group.
- load_balancer_attached
List of constructs that need to be depended on to ensure the TargetGroup is associated to a load balancer.
- metrics
All metrics available for this target group.
- node
The tree node.
- target_group_arn
The ARN of the target group.
- target_group_full_name
The full name of the target group.
- target_group_load_balancer_arns
ARNs of load balancers load balancing to this TargetGroup.
- target_group_name
The name of the target group.
Static Methods
- classmethod from_target_group_attributes(scope, id, *, target_group_arn, load_balancer_arns=None)
Import an existing target group.
- Parameters:
scope (
Construct
) –id (
str
) –target_group_arn (
str
) – ARN of the target group.load_balancer_arns (
Optional
[str
]) – A Token representing the list of ARNs for the load balancer routing to this target group.
- Return type:
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
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 classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
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 theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.