Class ApplicationLoadBalancer
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IConnectable
,IApplicationLoadBalancer
,ILoadBalancerV2
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
Example:
import software.amazon.awscdk.services.apigatewayv2.integrations.HttpAlbIntegration; Vpc vpc = new Vpc(this, "VPC"); ApplicationLoadBalancer lb = ApplicationLoadBalancer.Builder.create(this, "lb").vpc(vpc).build(); ApplicationListener listener = lb.addListener("listener", BaseApplicationListenerProps.builder().port(80).build()); listener.addTargets("target", AddApplicationTargetsProps.builder() .port(80) .build()); HttpApi httpEndpoint = HttpApi.Builder.create(this, "HttpProxyPrivateApi") .defaultIntegration(new HttpAlbIntegration("DefaultIntegration", listener)) .build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A fluent builder forApplicationLoadBalancer
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.IApplicationLoadBalancer
IApplicationLoadBalancer.Jsii$Default, IApplicationLoadBalancer.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ApplicationLoadBalancer
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
ApplicationLoadBalancer
(software.amazon.jsii.JsiiObjectRef objRef) ApplicationLoadBalancer
(software.constructs.Construct scope, String id, ApplicationLoadBalancerProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddListener
(String id, BaseApplicationListenerProps props) Add a new listener to this load balancer.Add a redirection listener to this load balancer.Add a redirection listener to this load balancer.void
addSecurityGroup
(ISecurityGroup securityGroup) Add a security group to this load balancer.static IApplicationLoadBalancer
fromApplicationLoadBalancerAttributes
(software.constructs.Construct scope, String id, ApplicationLoadBalancerAttributes attrs) Import an existing Application Load Balancer.static IApplicationLoadBalancer
fromLookup
(software.constructs.Construct scope, String id, ApplicationLoadBalancerLookupOptions options) Look up an application load balancer.The network connections associated with this resource.The IP Address Type for this load balancer.A list of listeners that have been added to the load balancer.Return the given named metric for this Application Load Balancer.metric
(String metricName, MetricOptions props) Return the given named metric for this Application Load Balancer.The total number of concurrent TCP connections active from clients to the load balancer and from the load balancer to targets.The total number of concurrent TCP connections active from clients to the load balancer and from the load balancer to targets.The number of TLS connections initiated by the client that did not establish a session with the load balancer.The number of TLS connections initiated by the client that did not establish a session with the load balancer.The number of load balancer capacity units (LCU) used by your load balancer.metricConsumedLCUs
(MetricOptions props) The number of load balancer capacity units (LCU) used by your load balancer.The number of user authentications that could not be completed.metricElbAuthError
(MetricOptions props) The number of user authentications that could not be completed.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.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.The time elapsed, in milliseconds, to query the IdP for the ID token and user info.The time elapsed, in milliseconds, to query the IdP for the ID token and user info.The number of authenticate actions that were successful.The number of authenticate actions that were successful.metricHttpCodeElb
(HttpCodeElb code) The number of HTTP 3xx/4xx/5xx codes that originate from the load balancer.metricHttpCodeElb
(HttpCodeElb code, MetricOptions props) The number of HTTP 3xx/4xx/5xx codes that originate from the load balancer.The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in the load balancer.metricHttpCodeTarget
(HttpCodeTarget code, MetricOptions props) The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in the load balancer.The number of fixed-response actions that were successful.The number of fixed-response actions that were successful.The number of redirect actions that were successful.The number of redirect actions that were successful.The number of redirect actions that couldn't be completed because the URL in the response location header is larger than 8K.The number of redirect actions that couldn't be completed because the URL in the response location header is larger than 8K.The total number of bytes processed by the load balancer over IPv6.The total number of bytes processed by the load balancer over IPv6.The number of IPv6 requests received by the load balancer.The number of IPv6 requests received by the load balancer.The total number of new TCP connections established from clients to the load balancer and from the load balancer to targets.The total number of new TCP connections established from clients to the load balancer and from the load balancer to targets.The total number of bytes processed by the load balancer over IPv4 and IPv6.The total number of bytes processed by the load balancer over IPv4 and IPv6.The number of connections that were rejected because the load balancer had reached its maximum number of connections.The number of connections that were rejected because the load balancer had reached its maximum number of connections.The number of requests processed over IPv4 and IPv6.metricRequestCount
(MetricOptions props) The number of requests processed over IPv4 and IPv6.The number of rules processed by the load balancer given a request rate averaged over an hour.The number of rules processed by the load balancer given a request rate averaged over an hour.The number of connections that were not successfully established between the load balancer and target.The number of connections that were not successfully established between the load balancer and target.The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received.The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received.The number of TLS connections initiated by the load balancer that did not establish a session with the target.The number of TLS connections initiated by the load balancer that did not establish a session with the target.Methods inherited from class software.amazon.awscdk.services.elasticloadbalancingv2.BaseLoadBalancer
getLoadBalancerArn, getLoadBalancerCanonicalHostedZoneId, getLoadBalancerDnsName, getLoadBalancerFullName, getLoadBalancerName, getLoadBalancerSecurityGroups, getVpc, logAccessLogs, logAccessLogs, removeAttribute, setAttribute, setAttribute, validate
Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.IApplicationLoadBalancer
getLoadBalancerArn, getVpc
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.ILoadBalancerV2
getLoadBalancerCanonicalHostedZoneId, getLoadBalancerDnsName
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ApplicationLoadBalancer
protected ApplicationLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef) -
ApplicationLoadBalancer
protected ApplicationLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ApplicationLoadBalancer
@Stability(Stable) public ApplicationLoadBalancer(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ApplicationLoadBalancerProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromApplicationLoadBalancerAttributes
@Stability(Stable) @NotNull public static IApplicationLoadBalancer fromApplicationLoadBalancerAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ApplicationLoadBalancerAttributes attrs) Import an existing Application Load Balancer.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
fromLookup
@Stability(Stable) @NotNull public static IApplicationLoadBalancer fromLookup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ApplicationLoadBalancerLookupOptions options) Look up an application load balancer.- Parameters:
scope
- This parameter is required.id
- This parameter is required.options
- This parameter is required.
-
addListener
@Stability(Stable) @NotNull public ApplicationListener addListener(@NotNull String id, @NotNull BaseApplicationListenerProps props) Add a new listener to this load balancer.- Specified by:
addListener
in interfaceIApplicationLoadBalancer
- Parameters:
id
- This parameter is required.props
- This parameter is required.
-
addRedirect
@Stability(Stable) @NotNull public ApplicationListener addRedirect(@Nullable ApplicationLoadBalancerRedirectConfig props) Add a redirection listener to this load balancer.- Parameters:
props
-
-
addRedirect
Add a redirection listener to this load balancer. -
addSecurityGroup
Add a security group to this load balancer.- Parameters:
securityGroup
- This parameter is required.
-
metric
@Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props) Return the given named metric for this Application Load Balancer.Default: Average over 5 minutes
- Parameters:
metricName
- This parameter is required.props
-
-
metric
Return the given named metric for this Application Load Balancer.Default: Average over 5 minutes
- Parameters:
metricName
- This parameter is required.
-
metricActiveConnectionCount
@Stability(Stable) @NotNull public Metric metricActiveConnectionCount(@Nullable MetricOptions props) The total number of concurrent TCP connections active from clients to the load balancer and from the load balancer to targets.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricActiveConnectionCount
The total number of concurrent TCP connections active from clients to the load balancer and from the load balancer to targets.Default: Sum over 5 minutes
-
metricClientTlsNegotiationErrorCount
@Stability(Stable) @NotNull public Metric metricClientTlsNegotiationErrorCount(@Nullable MetricOptions props) The number of TLS connections initiated by the client that did not establish a session with the load balancer.Possible causes include a mismatch of ciphers or protocols.
Default: Sum over 5 minutes
- Parameters:
props
-
-
metricClientTlsNegotiationErrorCount
The number of TLS connections initiated by the client that did not establish a session with the load balancer.Possible causes include a mismatch of ciphers or protocols.
Default: Sum over 5 minutes
-
metricConsumedLCUs
The number of load balancer capacity units (LCU) used by your load balancer.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricConsumedLCUs
The number of load balancer capacity units (LCU) used by your load balancer.Default: Sum over 5 minutes
-
metricElbAuthError
The number of user authentications that could not be completed.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
- Parameters:
props
-
-
metricElbAuthError
The number of user authentications that could not be completed.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
-
metricElbAuthFailure
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.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricElbAuthFailure
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.Default: Sum over 5 minutes
-
metricElbAuthLatency
The time elapsed, in milliseconds, to query the IdP for the ID token and user info.If one or more of these operations fail, this is the time to failure.
Default: Average over 5 minutes
- Parameters:
props
-
-
metricElbAuthLatency
The time elapsed, in milliseconds, to query the IdP for the ID token and user info.If one or more of these operations fail, this is the time to failure.
Default: Average over 5 minutes
-
metricElbAuthSuccess
The number of authenticate actions that were successful.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
- Parameters:
props
-
-
metricElbAuthSuccess
The number of authenticate actions that were successful.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
-
metricHttpCodeElb
@Stability(Stable) @NotNull public Metric metricHttpCodeElb(@NotNull HttpCodeElb code, @Nullable MetricOptions props) The number of HTTP 3xx/4xx/5xx codes that originate from the load balancer.This does not include any response codes generated by the targets.
Default: Sum over 5 minutes
- Parameters:
code
- This parameter is required.props
-
-
metricHttpCodeElb
The number of HTTP 3xx/4xx/5xx codes that originate from the load balancer.This does not include any response codes generated by the targets.
Default: Sum over 5 minutes
- Parameters:
code
- This parameter is required.
-
metricHttpCodeTarget
@Stability(Stable) @NotNull public Metric metricHttpCodeTarget(@NotNull HttpCodeTarget code, @Nullable MetricOptions props) The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in the load balancer.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
The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in the load balancer.This does not include any response codes generated by the load balancer.
Default: Sum over 5 minutes
- Parameters:
code
- This parameter is required.
-
metricHttpFixedResponseCount
@Stability(Stable) @NotNull public Metric metricHttpFixedResponseCount(@Nullable MetricOptions props) The number of fixed-response actions that were successful.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricHttpFixedResponseCount
The number of fixed-response actions that were successful.Default: Sum over 5 minutes
-
metricHttpRedirectCount
The number of redirect actions that were successful.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricHttpRedirectCount
The number of redirect actions that were successful.Default: Sum over 5 minutes
-
metricHttpRedirectUrlLimitExceededCount
@Stability(Stable) @NotNull public Metric metricHttpRedirectUrlLimitExceededCount(@Nullable MetricOptions props) The number of redirect actions that couldn't be completed because the URL in the response location header is larger than 8K.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricHttpRedirectUrlLimitExceededCount
The number of redirect actions that couldn't be completed because the URL in the response location header is larger than 8K.Default: Sum over 5 minutes
-
metricIpv6ProcessedBytes
The total number of bytes processed by the load balancer over IPv6.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricIpv6ProcessedBytes
The total number of bytes processed by the load balancer over IPv6.Default: Sum over 5 minutes
-
metricIpv6RequestCount
The number of IPv6 requests received by the load balancer.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricIpv6RequestCount
The number of IPv6 requests received by the load balancer.Default: Sum over 5 minutes
-
metricNewConnectionCount
The total number of new TCP connections established from clients to the load balancer and from the load balancer to targets.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricNewConnectionCount
The total number of new TCP connections established from clients to the load balancer and from the load balancer to targets.Default: Sum over 5 minutes
-
metricProcessedBytes
The total number of bytes processed by the load balancer over IPv4 and IPv6.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricProcessedBytes
The total number of bytes processed by the load balancer over IPv4 and IPv6.Default: Sum over 5 minutes
-
metricRejectedConnectionCount
@Stability(Stable) @NotNull public Metric metricRejectedConnectionCount(@Nullable MetricOptions props) The number of connections that were rejected because the load balancer had reached its maximum number of connections.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricRejectedConnectionCount
The number of connections that were rejected because the load balancer had reached its maximum number of connections.Default: Sum over 5 minutes
-
metricRequestCount
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
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
-
metricRuleEvaluations
The number of rules processed by the load balancer given a request rate averaged over an hour.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricRuleEvaluations
The number of rules processed by the load balancer given a request rate averaged over an hour.Default: Sum over 5 minutes
-
metricTargetConnectionErrorCount
@Stability(Stable) @NotNull public Metric metricTargetConnectionErrorCount(@Nullable MetricOptions props) The number of connections that were not successfully established between the load balancer and target.Default: Sum over 5 minutes
- Parameters:
props
-
-
metricTargetConnectionErrorCount
The number of connections that were not successfully established between the load balancer and target.Default: Sum over 5 minutes
-
metricTargetResponseTime
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
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(Stable) @NotNull public Metric metricTargetTLSNegotiationErrorCount(@Nullable MetricOptions props) 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
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
-
getConnections
The network connections associated with this resource.- Specified by:
getConnections
in interfaceIConnectable
-
getListeners
A list of listeners that have been added to the load balancer.This list is only valid for owned constructs.
- Specified by:
getListeners
in interfaceIApplicationLoadBalancer
-
getIpAddressType
The IP Address Type for this load balancer.- Specified by:
getIpAddressType
in interfaceIApplicationLoadBalancer
-