Class CfnLoadBalancer.Builder

java.lang.Object
software.amazon.awscdk.services.lightsail.CfnLoadBalancer.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnLoadBalancer>
Enclosing class:
CfnLoadBalancer

@Stability(Stable) public static final class CfnLoadBalancer.Builder extends Object implements software.amazon.jsii.Builder<CfnLoadBalancer>
A fluent builder for CfnLoadBalancer.
  • Method Details

    • create

      @Stability(Stable) public static CfnLoadBalancer.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnLoadBalancer.Builder.
    • instancePort

      @Stability(Stable) public CfnLoadBalancer.Builder instancePort(Number instancePort)
      The port that the load balancer uses to direct traffic to your Lightsail instances.

      For HTTP traffic, specify port 80 . For HTTPS traffic, specify port 443 .

      Parameters:
      instancePort - The port that the load balancer uses to direct traffic to your Lightsail instances. This parameter is required.
      Returns:
      this
    • loadBalancerName

      @Stability(Stable) public CfnLoadBalancer.Builder loadBalancerName(String loadBalancerName)
      The name of the load balancer.

      Parameters:
      loadBalancerName - The name of the load balancer. This parameter is required.
      Returns:
      this
    • attachedInstances

      @Stability(Stable) public CfnLoadBalancer.Builder attachedInstances(List<String> attachedInstances)
      The Lightsail instances to attach to the load balancer.

      Parameters:
      attachedInstances - The Lightsail instances to attach to the load balancer. This parameter is required.
      Returns:
      this
    • healthCheckPath

      @Stability(Stable) public CfnLoadBalancer.Builder healthCheckPath(String healthCheckPath)
      The path on the attached instance where the health check will be performed.

      If no path is specified, the load balancer tries to make a request to the default (root) page ( /index.html ).

      Parameters:
      healthCheckPath - The path on the attached instance where the health check will be performed. This parameter is required.
      Returns:
      this
    • ipAddressType

      @Stability(Stable) public CfnLoadBalancer.Builder ipAddressType(String ipAddressType)
      The IP address type of the load balancer.

      The possible values are ipv4 for IPv4 only, and dualstack for both IPv4 and IPv6.

      Parameters:
      ipAddressType - The IP address type of the load balancer. This parameter is required.
      Returns:
      this
    • sessionStickinessEnabled

      @Stability(Stable) public CfnLoadBalancer.Builder sessionStickinessEnabled(Boolean sessionStickinessEnabled)
      A Boolean value indicating whether session stickiness is enabled.

      Enable session stickiness (also known as session affinity ) to bind a user's session to a specific instance. This ensures that all requests from the user during the session are sent to the same instance.

      Parameters:
      sessionStickinessEnabled - A Boolean value indicating whether session stickiness is enabled. This parameter is required.
      Returns:
      this
    • sessionStickinessEnabled

      @Stability(Stable) public CfnLoadBalancer.Builder sessionStickinessEnabled(IResolvable sessionStickinessEnabled)
      A Boolean value indicating whether session stickiness is enabled.

      Enable session stickiness (also known as session affinity ) to bind a user's session to a specific instance. This ensures that all requests from the user during the session are sent to the same instance.

      Parameters:
      sessionStickinessEnabled - A Boolean value indicating whether session stickiness is enabled. This parameter is required.
      Returns:
      this
    • sessionStickinessLbCookieDurationSeconds

      @Stability(Stable) public CfnLoadBalancer.Builder sessionStickinessLbCookieDurationSeconds(String sessionStickinessLbCookieDurationSeconds)
      The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.

      If you do not specify this parameter, the default value is 0, which indicates that the sticky session should last for the duration of the browser session.

      Parameters:
      sessionStickinessLbCookieDurationSeconds - The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale. This parameter is required.
      Returns:
      this
    • tags

      @Stability(Stable) public CfnLoadBalancer.Builder tags(List<? extends CfnTag> tags)
      An array of key-value pairs to apply to this resource.

      For more information, see Tag in the AWS CloudFormation User Guide .

      The Value of Tags is optional for Lightsail resources.

      Parameters:
      tags - An array of key-value pairs to apply to this resource. This parameter is required.
      Returns:
      this
    • tlsPolicyName

      @Stability(Stable) public CfnLoadBalancer.Builder tlsPolicyName(String tlsPolicyName)
      The name of the TLS security policy for the load balancer.

      Parameters:
      tlsPolicyName - The name of the TLS security policy for the load balancer. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CfnLoadBalancer build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnLoadBalancer>
      Returns:
      a newly built instance of CfnLoadBalancer.