Class CfnLoadBalancer

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:04.740Z") @Stability(Stable) public class CfnLoadBalancer extends CfnResource implements IInspectable, ITaggable
The AWS::Lightsail::LoadBalancer resource specifies a load balancer that can be used with Lightsail instances.

You cannot attach a TLS certificate to a load balancer using the AWS::Lightsail::LoadBalancer resource type. Instead, use the AWS::Lightsail::LoadBalancerTlsCertificate resource type to create a certificate and attach it to a load balancer.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lightsail.*;
 CfnLoadBalancer cfnLoadBalancer = CfnLoadBalancer.Builder.create(this, "MyCfnLoadBalancer")
         .instancePort(123)
         .loadBalancerName("loadBalancerName")
         // the properties below are optional
         .attachedInstances(List.of("attachedInstances"))
         .healthCheckPath("healthCheckPath")
         .ipAddressType("ipAddressType")
         .sessionStickinessEnabled(false)
         .sessionStickinessLbCookieDurationSeconds("sessionStickinessLbCookieDurationSeconds")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .tlsPolicyName("tlsPolicyName")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnLoadBalancer

      protected CfnLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnLoadBalancer

      protected CfnLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnLoadBalancer

      @Stability(Stable) public CfnLoadBalancer(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnLoadBalancerProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrLoadBalancerArn

      @Stability(Stable) @NotNull public String getAttrLoadBalancerArn()
      The Amazon Resource Name (ARN) of the load balancer.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getInstancePort

      @Stability(Stable) @NotNull public Number getInstancePort()
      The port that the load balancer uses to direct traffic to your Lightsail instances.
    • setInstancePort

      @Stability(Stable) public void setInstancePort(@NotNull Number value)
      The port that the load balancer uses to direct traffic to your Lightsail instances.
    • getLoadBalancerName

      @Stability(Stable) @NotNull public String getLoadBalancerName()
      The name of the load balancer.
    • setLoadBalancerName

      @Stability(Stable) public void setLoadBalancerName(@NotNull String value)
      The name of the load balancer.
    • getAttachedInstances

      @Stability(Stable) @Nullable public List<String> getAttachedInstances()
      The Lightsail instances to attach to the load balancer.
    • setAttachedInstances

      @Stability(Stable) public void setAttachedInstances(@Nullable List<String> value)
      The Lightsail instances to attach to the load balancer.
    • getHealthCheckPath

      @Stability(Stable) @Nullable public String getHealthCheckPath()
      The path on the attached instance where the health check will be performed.
    • setHealthCheckPath

      @Stability(Stable) public void setHealthCheckPath(@Nullable String value)
      The path on the attached instance where the health check will be performed.
    • getIpAddressType

      @Stability(Stable) @Nullable public String getIpAddressType()
      The IP address type of the load balancer.
    • setIpAddressType

      @Stability(Stable) public void setIpAddressType(@Nullable String value)
      The IP address type of the load balancer.
    • getSessionStickinessEnabled

      @Stability(Stable) @Nullable public Object getSessionStickinessEnabled()
      A Boolean value indicating whether session stickiness is enabled.
    • setSessionStickinessEnabled

      @Stability(Stable) public void setSessionStickinessEnabled(@Nullable Boolean value)
      A Boolean value indicating whether session stickiness is enabled.
    • setSessionStickinessEnabled

      @Stability(Stable) public void setSessionStickinessEnabled(@Nullable IResolvable value)
      A Boolean value indicating whether session stickiness is enabled.
    • getSessionStickinessLbCookieDurationSeconds

      @Stability(Stable) @Nullable public String getSessionStickinessLbCookieDurationSeconds()
      The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.
    • setSessionStickinessLbCookieDurationSeconds

      @Stability(Stable) public void setSessionStickinessLbCookieDurationSeconds(@Nullable String value)
      The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      An array of key-value pairs to apply to this resource.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      An array of key-value pairs to apply to this resource.
    • getTlsPolicyName

      @Stability(Stable) @Nullable public String getTlsPolicyName()
      The name of the TLS security policy for the load balancer.
    • setTlsPolicyName

      @Stability(Stable) public void setTlsPolicyName(@Nullable String value)
      The name of the TLS security policy for the load balancer.