Class ApplicationLoadBalancer
Define an Application Load Balancer.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ApplicationLoadBalancer : BaseLoadBalancer, IApplicationLoadBalancer, ILoadBalancerV2, IResource, IConnectable
Syntax (vb)
Public Class ApplicationLoadBalancer
Inherits BaseLoadBalancer
Implements IApplicationLoadBalancer, ILoadBalancerV2, IResource, IConnectable
Remarks
Resource: AWS::ElasticLoadBalancingV2::LoadBalancer
ExampleMetadata: infused
Examples
Vpc vpc;
var securityGroup1 = new SecurityGroup(this, "SecurityGroup1", new SecurityGroupProps { Vpc = vpc });
var lb = new ApplicationLoadBalancer(this, "LB", new ApplicationLoadBalancerProps {
Vpc = vpc,
InternetFacing = true,
SecurityGroup = securityGroup1
});
var securityGroup2 = new SecurityGroup(this, "SecurityGroup2", new SecurityGroupProps { Vpc = vpc });
lb.AddSecurityGroup(securityGroup2);
Synopsis
Constructors
Application |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Application |
Used by jsii to construct an instance of this class from DeputyProps |
Application |
Properties
Connections | The network connections associated with this resource. |
Ip |
The IP Address Type for this load balancer. |
Listeners | A list of listeners that have been added to the load balancer. |
Metrics | All metrics available for this load balancer. |
Methods
Add |
Add a new listener to this load balancer. |
Add |
Add a redirection listener to this load balancer. |
Add |
Add a security group to this load balancer. |
From |
Import an existing Application Load Balancer. |
From |
Look up an application load balancer. |
Log |
Enable access logging for this load balancer. |
Log |
Enable connection logging for this load balancer. |
Metric(String, IMetric |
(deprecated) Return the given named metric for this Application Load Balancer. |
Metric |
(deprecated) The total number of concurrent TCP connections active from clients to the load balancer and from the load balancer to targets. |
Metric |
(deprecated) The number of TLS connections initiated by the client that did not establish a session with the load balancer. |
Metric |
(deprecated) The number of load balancer capacity units (LCU) used by your load balancer. |
Metric |
(deprecated) The number of user authentications that could not be completed. |
Metric |
(deprecated) The number of user authentications that could not be completed because the IdP denied access to the user or an authorization code was used more than once. |
Metric |
(deprecated) The time elapsed, in milliseconds, to query the IdP for the ID token and user info. |
Metric |
(deprecated) The number of authenticate actions that were successful. |
Metric |
(deprecated) The number of HTTP 3xx/4xx/5xx codes that originate from the load balancer. |
Metric |
(deprecated) The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in the load balancer. |
Metric |
(deprecated) The number of fixed-response actions that were successful. |
Metric |
(deprecated) The number of redirect actions that were successful. |
Metric |
(deprecated) The number of redirect actions that couldn't be completed because the URL in the response location header is larger than 8K. |
Metric |
(deprecated) The total number of bytes processed by the load balancer over IPv6. |
Metric |
(deprecated) The number of IPv6 requests received by the load balancer. |
Metric |
(deprecated) The total number of new TCP connections established from clients to the load balancer and from the load balancer to targets. |
Metric |
(deprecated) The total number of bytes processed by the load balancer over IPv4 and IPv6. |
Metric |
(deprecated) The number of connections that were rejected because the load balancer had reached its maximum number of connections. |
Metric |
(deprecated) The number of requests processed over IPv4 and IPv6. |
Metric |
(deprecated) The number of rules processed by the load balancer given a request rate averaged over an hour. |
Metric |
(deprecated) The number of connections that were not successfully established between the load balancer and target. |
Metric |
(deprecated) The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received. |
Metric |
(deprecated) The number of TLS connections initiated by the load balancer that did not establish a session with the target. |
Constructors
ApplicationLoadBalancer(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ApplicationLoadBalancer(ByRefValue reference)
Parameters
- reference Amazon.
JSII. Runtime. Deputy. By Ref Value The Javascript-owned object reference
ApplicationLoadBalancer(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ApplicationLoadBalancer(DeputyBase.DeputyProps props)
Parameters
- props Amazon.
JSII. Runtime. Deputy. Deputy Base. Deputy Props The deputy props
ApplicationLoadBalancer(Construct, String, IApplicationLoadBalancerProps)
public ApplicationLoadBalancer(Construct scope, string id, IApplicationLoadBalancerProps props)
Parameters
- scope Constructs.
Construct - id System.
String - props IApplication
Load Balancer Props
Properties
Connections
The network connections associated with this resource.
public virtual Connections_ Connections { get; }
Property Value
IpAddressType
The IP Address Type for this load balancer.
public virtual Nullable<IpAddressType> IpAddressType { get; }
Property Value
System.
Remarks
If the @aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault
feature flag is set (the default for new projects), and addListener()
is called with open: true
,
the load balancer's security group will automatically include both IPv4 and IPv6 ingress rules
when using IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4
.
For existing projects that only have IPv4 rules, you can opt-in to IPv6 ingress rules by enabling the feature flag in your cdk.json file. Note that enabling this feature flag will modify existing security group rules.
Listeners
A list of listeners that have been added to the load balancer.
public virtual ApplicationListener[] Listeners { get; }
Property Value
Remarks
This list is only valid for owned constructs.
Metrics
All metrics available for this load balancer.
public virtual IApplicationLoadBalancerMetrics Metrics { get; }
Property Value
IApplication
Methods
AddListener(String, IBaseApplicationListenerProps)
Add a new listener to this load balancer.
public virtual ApplicationListener AddListener(string id, IBaseApplicationListenerProps props)
Parameters
- id System.
String - props IBase
Application Listener Props
Returns
AddRedirect(IApplicationLoadBalancerRedirectConfig)
Add a redirection listener to this load balancer.
public virtual ApplicationListener AddRedirect(IApplicationLoadBalancerRedirectConfig props = null)
Parameters
Returns
AddSecurityGroup(ISecurityGroup)
Add a security group to this load balancer.
public virtual void AddSecurityGroup(ISecurityGroup securityGroup)
Parameters
- securityGroup ISecurity
Group
FromApplicationLoadBalancerAttributes(Construct, String, IApplicationLoadBalancerAttributes)
Import an existing Application Load Balancer.
public static IApplicationLoadBalancer FromApplicationLoadBalancerAttributes(Construct scope, string id, IApplicationLoadBalancerAttributes attrs)
Parameters
- scope Constructs.
Construct - id System.
String - attrs IApplication
Load Balancer Attributes
Returns
FromLookup(Construct, String, IApplicationLoadBalancerLookupOptions)
Look up an application load balancer.
public static IApplicationLoadBalancer FromLookup(Construct scope, string id, IApplicationLoadBalancerLookupOptions options)
Parameters
- scope Constructs.
Construct - id System.
String - options IApplication
Load Balancer Lookup Options
Returns
LogAccessLogs(IBucket, String)
Enable access logging for this load balancer.
public override void LogAccessLogs(IBucket bucket, string prefix = null)
Parameters
- bucket IBucket
- prefix System.
String
Overrides
Remarks
A region must be specified on the stack containing the load balancer; you cannot enable logging on environment-agnostic stacks. See https://docs.aws.amazon.com/cdk/latest/guide/environments.html
LogConnectionLogs(IBucket, String)
Enable connection logging for this load balancer.
public virtual void LogConnectionLogs(IBucket bucket, string prefix = null)
Parameters
- bucket IBucket
- prefix System.
String
Remarks
A region must be specified on the stack containing the load balancer; you cannot enable logging on environment-agnostic stacks.
See: https://docs.aws.amazon.com/cdk/latest/guide/environments.html
Metric(String, IMetricOptions)
(deprecated) Return the given named metric for this Application Load Balancer.
public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
- metricName System.
String - props IMetric
Options
Returns
Remarks
Default: Average over 5 minutes
Stability: Deprecated
MetricActiveConnectionCount(IMetricOptions)
(deprecated) The total number of concurrent TCP connections active from clients to the load balancer and from the load balancer to targets.
public virtual Metric MetricActiveConnectionCount(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricClientTlsNegotiationErrorCount(IMetricOptions)
(deprecated) The number of TLS connections initiated by the client that did not establish a session with the load balancer.
public virtual Metric MetricClientTlsNegotiationErrorCount(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Possible causes include a mismatch of ciphers or protocols.
Default: Sum over 5 minutes
Stability: Deprecated
MetricConsumedLCUs(IMetricOptions)
(deprecated) The number of load balancer capacity units (LCU) used by your load balancer.
public virtual Metric MetricConsumedLCUs(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricElbAuthError(IMetricOptions)
(deprecated) The number of user authentications that could not be completed.
public virtual Metric MetricElbAuthError(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Because an authenticate action was misconfigured, the load balancer couldn't establish a connection with the IdP, or the load balancer couldn't complete the authentication flow due to an internal error.
Default: Sum over 5 minutes
Stability: Deprecated
MetricElbAuthFailure(IMetricOptions)
(deprecated) The number of user authentications that could not be completed because the IdP denied access to the user or an authorization code was used more than once.
public virtual Metric MetricElbAuthFailure(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricElbAuthLatency(IMetricOptions)
(deprecated) The time elapsed, in milliseconds, to query the IdP for the ID token and user info.
public virtual Metric MetricElbAuthLatency(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
If one or more of these operations fail, this is the time to failure.
Default: Average over 5 minutes
Stability: Deprecated
MetricElbAuthSuccess(IMetricOptions)
(deprecated) The number of authenticate actions that were successful.
public virtual Metric MetricElbAuthSuccess(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
This metric is incremented at the end of the authentication workflow, after the load balancer has retrieved the user claims from the IdP.
Default: Sum over 5 minutes
Stability: Deprecated
MetricHttpCodeElb(HttpCodeElb, IMetricOptions)
(deprecated) The number of HTTP 3xx/4xx/5xx codes that originate from the load balancer.
public virtual Metric MetricHttpCodeElb(HttpCodeElb code, IMetricOptions props = null)
Parameters
- code Http
Code Elb - props IMetric
Options
Returns
Remarks
This does not include any response codes generated by the targets.
Default: Sum over 5 minutes
Stability: Deprecated
MetricHttpCodeTarget(HttpCodeTarget, IMetricOptions)
(deprecated) The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in the load balancer.
public virtual Metric MetricHttpCodeTarget(HttpCodeTarget code, IMetricOptions props = null)
Parameters
- code Http
Code Target - props IMetric
Options
Returns
Remarks
This does not include any response codes generated by the load balancer.
Default: Sum over 5 minutes
Stability: Deprecated
MetricHttpFixedResponseCount(IMetricOptions)
(deprecated) The number of fixed-response actions that were successful.
public virtual Metric MetricHttpFixedResponseCount(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricHttpRedirectCount(IMetricOptions)
(deprecated) The number of redirect actions that were successful.
public virtual Metric MetricHttpRedirectCount(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricHttpRedirectUrlLimitExceededCount(IMetricOptions)
(deprecated) The number of redirect actions that couldn't be completed because the URL in the response location header is larger than 8K.
public virtual Metric MetricHttpRedirectUrlLimitExceededCount(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricIpv6ProcessedBytes(IMetricOptions)
(deprecated) The total number of bytes processed by the load balancer over IPv6.
public virtual Metric MetricIpv6ProcessedBytes(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricIpv6RequestCount(IMetricOptions)
(deprecated) The number of IPv6 requests received by the load balancer.
public virtual Metric MetricIpv6RequestCount(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricNewConnectionCount(IMetricOptions)
(deprecated) The total number of new TCP connections established from clients to the load balancer and from the load balancer to targets.
public virtual Metric MetricNewConnectionCount(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricProcessedBytes(IMetricOptions)
(deprecated) The total number of bytes processed by the load balancer over IPv4 and IPv6.
public virtual Metric MetricProcessedBytes(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricRejectedConnectionCount(IMetricOptions)
(deprecated) The number of connections that were rejected because the load balancer had reached its maximum number of connections.
public virtual Metric MetricRejectedConnectionCount(IMetricOptions props = null)
Parameters
- props IMetric
Options
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 IMetric
Options
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
MetricRuleEvaluations(IMetricOptions)
(deprecated) The number of rules processed by the load balancer given a request rate averaged over an hour.
public virtual Metric MetricRuleEvaluations(IMetricOptions props = null)
Parameters
- props IMetric
Options
Returns
Remarks
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 IMetric
Options
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 IMetric
Options
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 IMetric
Options
Returns
Remarks
Possible causes include a mismatch of ciphers or protocols.
Default: Sum over 5 minutes
Stability: Deprecated