Class ApplicationTargetGroup
Define an Application Target Group.
Inherited Members
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ApplicationTargetGroup : TargetGroupBase, IApplicationTargetGroup, ITargetGroup
Syntax (vb)
Public Class ApplicationTargetGroup
Inherits TargetGroupBase
Implements IApplicationTargetGroup, ITargetGroup
Remarks
ExampleMetadata: infused
Examples
ApplicationLoadBalancer alb;
var listener = alb.AddListener("Listener", new BaseApplicationListenerProps { Port = 80 });
var targetGroup = listener.AddTargets("Fleet", new AddApplicationTargetsProps { Port = 80 });
var deploymentGroup = new ServerDeploymentGroup(this, "DeploymentGroup", new ServerDeploymentGroupProps {
LoadBalancer = LoadBalancer.Application(targetGroup)
});
Synopsis
Constructors
ApplicationTargetGroup(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ApplicationTargetGroup(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
ApplicationTargetGroup(Construct, String, IApplicationTargetGroupProps) |
Properties
FirstLoadBalancerFullName | Full name of first load balancer. |
Metrics | All metrics available for this target group. |
Methods
AddTarget(IApplicationLoadBalancerTarget[]) | Add a load balancing target to this target group. |
EnableCookieStickiness(Duration, String) | Enable sticky routing via a cookie to members of this target group. |
FromTargetGroupAttributes(Construct, String, ITargetGroupAttributes) | Import an existing target group. |
Metric(String, IMetricOptions) | Return the given named metric for this Application Load Balancer Target Group. |
MetricHealthyHostCount(IMetricOptions) | (deprecated) The number of healthy hosts in the target group. |
MetricHttpCodeTarget(HttpCodeTarget, IMetricOptions) | (deprecated) The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in this target group. |
MetricIpv6RequestCount(IMetricOptions) | (deprecated) The number of IPv6 requests received by the target group. |
MetricRequestCount(IMetricOptions) | (deprecated) The number of requests processed over IPv4 and IPv6. |
MetricRequestCountPerTarget(IMetricOptions) | (deprecated) The average number of requests received by each target in a target group. |
MetricTargetConnectionErrorCount(IMetricOptions) | (deprecated) The number of connections that were not successfully established between the load balancer and target. |
MetricTargetResponseTime(IMetricOptions) | (deprecated) The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received. |
MetricTargetTLSNegotiationErrorCount(IMetricOptions) | (deprecated) The number of TLS connections initiated by the load balancer that did not establish a session with the target. |
MetricUnhealthyHostCount(IMetricOptions) | (deprecated) The number of unhealthy hosts in the target group. |
RegisterConnectable(IConnectable, Port) | Register a connectable as a member of this target group. |
RegisterListener(IApplicationListener, IConstruct) | Register a listener that is load balancing to this target group. |
ValidateTargetGroup() |
Constructors
ApplicationTargetGroup(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ApplicationTargetGroup(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ApplicationTargetGroup(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ApplicationTargetGroup(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
ApplicationTargetGroup(Construct, String, IApplicationTargetGroupProps)
public ApplicationTargetGroup(Construct scope, string id, IApplicationTargetGroupProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IApplicationTargetGroupProps
Properties
FirstLoadBalancerFullName
Full name of first load balancer.
public override string FirstLoadBalancerFullName { get; }
Property Value
System.String
Overrides
Metrics
All metrics available for this target group.
public virtual IApplicationTargetGroupMetrics Metrics { get; }
Property Value
IApplicationTargetGroupMetrics
Methods
AddTarget(IApplicationLoadBalancerTarget[])
Add a load balancing target to this target group.
public virtual void AddTarget(params IApplicationLoadBalancerTarget[] targets)
Parameters
- targets IApplicationLoadBalancerTarget[]
EnableCookieStickiness(Duration, String)
Enable sticky routing via a cookie to members of this target group.
public virtual void EnableCookieStickiness(Duration duration, string cookieName = null)
Parameters
- duration Duration
- cookieName System.String
Remarks
Note: If the cookieName
parameter is set, application-based stickiness will be applied,
otherwise it defaults to duration-based stickiness attributes (lb_cookie
).
See: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html
FromTargetGroupAttributes(Construct, String, ITargetGroupAttributes)
Import an existing target group.
public static IApplicationTargetGroup FromTargetGroupAttributes(Construct scope, string id, ITargetGroupAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs ITargetGroupAttributes
Returns
Metric(String, IMetricOptions)
Return the given named metric for this Application Load Balancer Target Group.
public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
- metricName System.String
- props IMetricOptions
Returns
Remarks
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
MetricHealthyHostCount(IMetricOptions)
(deprecated) The number of healthy hosts in the target group.
public virtual Metric MetricHealthyHostCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: Average over 5 minutes
Stability: Deprecated
MetricHttpCodeTarget(HttpCodeTarget, IMetricOptions)
(deprecated) The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in this target group.
public virtual Metric MetricHttpCodeTarget(HttpCodeTarget code, IMetricOptions props = null)
Parameters
- code HttpCodeTarget
- props IMetricOptions
Returns
Remarks
This does not include any response codes generated by the load balancer.
Default: Sum over 5 minutes
Stability: Deprecated
MetricIpv6RequestCount(IMetricOptions)
(deprecated) The number of IPv6 requests received by the target group.
public virtual Metric MetricIpv6RequestCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricRequestCount(IMetricOptions)
(deprecated) The number of requests processed over IPv4 and IPv6.
public virtual Metric MetricRequestCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
This count includes only the requests with a response generated by a target of the load balancer.
Default: Sum over 5 minutes
Stability: Deprecated
MetricRequestCountPerTarget(IMetricOptions)
(deprecated) The average number of requests received by each target in a target group.
public virtual Metric MetricRequestCountPerTarget(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
The only valid statistic is Sum. Note that this represents the average not the sum.
Default: Sum over 5 minutes
Stability: Deprecated
MetricTargetConnectionErrorCount(IMetricOptions)
(deprecated) The number of connections that were not successfully established between the load balancer and target.
public virtual Metric MetricTargetConnectionErrorCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricTargetResponseTime(IMetricOptions)
(deprecated) The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received.
public virtual Metric MetricTargetResponseTime(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: Average over 5 minutes
Stability: Deprecated
MetricTargetTLSNegotiationErrorCount(IMetricOptions)
(deprecated) The number of TLS connections initiated by the load balancer that did not establish a session with the target.
public virtual Metric MetricTargetTLSNegotiationErrorCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Possible causes include a mismatch of ciphers or protocols.
Default: Sum over 5 minutes
Stability: Deprecated
MetricUnhealthyHostCount(IMetricOptions)
(deprecated) The number of unhealthy hosts in the target group.
public virtual Metric MetricUnhealthyHostCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: Average over 5 minutes
Stability: Deprecated
RegisterConnectable(IConnectable, Port)
Register a connectable as a member of this target group.
public virtual void RegisterConnectable(IConnectable connectable, Port portRange = null)
Parameters
- connectable IConnectable
- portRange Port
Remarks
Don't call this directly. It will be called by load balancing targets.
RegisterListener(IApplicationListener, IConstruct)
Register a listener that is load balancing to this target group.
public virtual void RegisterListener(IApplicationListener listener, IConstruct associatingConstruct = null)
Parameters
- listener IApplicationListener
- associatingConstruct Constructs.IConstruct
Remarks
Don't call this directly. It will be called by listeners.
ValidateTargetGroup()
protected override string[] ValidateTargetGroup()
Returns
System.String[]