Class ApplicationLoadBalancer

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IConstruct, IDependable, IResource, IConnectable, IApplicationLoadBalancer, ILoadBalancerV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:44.180Z") @Stability(Stable) public class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplicationLoadBalancer
Define an Application Load Balancer.

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();
 
  • 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 interface IApplicationLoadBalancer
      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

      @Stability(Stable) @NotNull public ApplicationListener addRedirect()
      Add a redirection listener to this load balancer.
    • addSecurityGroup

      @Stability(Stable) public void addSecurityGroup(@NotNull ISecurityGroup securityGroup)
      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

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric metricConsumedLCUs(@Nullable MetricOptions props)
      The number of load balancer capacity units (LCU) used by your load balancer.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricConsumedLCUs

      @Stability(Stable) @NotNull public Metric metricConsumedLCUs()
      The number of load balancer capacity units (LCU) used by your load balancer.

      Default: Sum over 5 minutes

    • metricElbAuthError

      @Stability(Stable) @NotNull public Metric metricElbAuthError(@Nullable MetricOptions props)
      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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric metricElbAuthFailure(@Nullable MetricOptions props)
      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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric metricElbAuthLatency(@Nullable MetricOptions props)
      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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric metricElbAuthSuccess(@Nullable MetricOptions props)
      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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric metricHttpCodeElb(@NotNull HttpCodeElb code)
      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

      @Stability(Stable) @NotNull public Metric metricHttpCodeTarget(@NotNull HttpCodeTarget code)
      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

      @Stability(Stable) @NotNull public Metric metricHttpFixedResponseCount()
      The number of fixed-response actions that were successful.

      Default: Sum over 5 minutes

    • metricHttpRedirectCount

      @Stability(Stable) @NotNull public Metric metricHttpRedirectCount(@Nullable MetricOptions props)
      The number of redirect actions that were successful.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricHttpRedirectCount

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric metricIpv6ProcessedBytes(@Nullable MetricOptions props)
      The total number of bytes processed by the load balancer over IPv6.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricIpv6ProcessedBytes

      @Stability(Stable) @NotNull public Metric metricIpv6ProcessedBytes()
      The total number of bytes processed by the load balancer over IPv6.

      Default: Sum over 5 minutes

    • metricIpv6RequestCount

      @Stability(Stable) @NotNull public Metric metricIpv6RequestCount(@Nullable MetricOptions props)
      The number of IPv6 requests received by the load balancer.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricIpv6RequestCount

      @Stability(Stable) @NotNull public Metric metricIpv6RequestCount()
      The number of IPv6 requests received by the load balancer.

      Default: Sum over 5 minutes

    • metricNewConnectionCount

      @Stability(Stable) @NotNull public Metric metricNewConnectionCount(@Nullable MetricOptions props)
      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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric metricProcessedBytes(@Nullable MetricOptions props)
      The total number of bytes processed by the load balancer over IPv4 and IPv6.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricProcessedBytes

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric metricRequestCount(@Nullable MetricOptions props)
      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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric metricRuleEvaluations(@Nullable MetricOptions props)
      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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric metricTargetConnectionErrorCount()
      The number of connections that were not successfully established between the load balancer and target.

      Default: Sum over 5 minutes

    • metricTargetResponseTime

      @Stability(Stable) @NotNull public Metric metricTargetResponseTime(@Nullable MetricOptions props)
      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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Metric 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

      @Stability(Stable) @NotNull public Connections getConnections()
      The network connections associated with this resource.
      Specified by:
      getConnections in interface IConnectable
    • getListeners

      @Stability(Stable) @NotNull public List<ApplicationListener> 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 interface IApplicationLoadBalancer
    • getIpAddressType

      @Stability(Stable) @Nullable public IpAddressType getIpAddressType()
      The IP Address Type for this load balancer.
      Specified by:
      getIpAddressType in interface IApplicationLoadBalancer