Class CfnDistribution

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:59.733Z") @Stability(Stable) public class CfnDistribution extends CfnResource implements IInspectable
A CloudFormation AWS::Lightsail::Distribution.

The AWS::Lightsail::Distribution resource specifies a content delivery network (CDN) distribution. You can create distributions only in the us-east-1 AWS Region.

A distribution is a globally distributed network of caching servers that improve the performance of your website or web application hosted on a Lightsail instance, static content hosted on a Lightsail bucket, or through a Lightsail 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.*;
 CfnDistribution cfnDistribution = CfnDistribution.Builder.create(this, "MyCfnDistribution")
         .bundleId("bundleId")
         .defaultCacheBehavior(CacheBehaviorProperty.builder()
                 .behavior("behavior")
                 .build())
         .distributionName("distributionName")
         .origin(InputOriginProperty.builder()
                 .name("name")
                 .protocolPolicy("protocolPolicy")
                 .regionName("regionName")
                 .build())
         // the properties below are optional
         .cacheBehaviors(List.of(CacheBehaviorPerPathProperty.builder()
                 .behavior("behavior")
                 .path("path")
                 .build()))
         .cacheBehaviorSettings(CacheSettingsProperty.builder()
                 .allowedHttpMethods("allowedHttpMethods")
                 .cachedHttpMethods("cachedHttpMethods")
                 .defaultTtl(123)
                 .forwardedCookies(CookieObjectProperty.builder()
                         .cookiesAllowList(List.of("cookiesAllowList"))
                         .option("option")
                         .build())
                 .forwardedHeaders(HeaderObjectProperty.builder()
                         .headersAllowList(List.of("headersAllowList"))
                         .option("option")
                         .build())
                 .forwardedQueryStrings(QueryStringObjectProperty.builder()
                         .option(false)
                         .queryStringsAllowList(List.of("queryStringsAllowList"))
                         .build())
                 .maximumTtl(123)
                 .minimumTtl(123)
                 .build())
         .certificateName("certificateName")
         .ipAddressType("ipAddressType")
         .isEnabled(false)
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 
  • 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

    • CfnDistribution

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

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

      @Stability(Stable) public CfnDistribution(@NotNull Construct scope, @NotNull String id, @NotNull CfnDistributionProps props)
      Create a new AWS::Lightsail::Distribution.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      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.
    • getAttrAbleToUpdateBundle

      @Stability(Stable) @NotNull public IResolvable getAttrAbleToUpdateBundle()
      Indicates whether you can update the distribution’s current bundle to another bundle.
    • getAttrDistributionArn

      @Stability(Stable) @NotNull public String getAttrDistributionArn()
      The Amazon Resource Name (ARN) of the distribution.
    • getAttrStatus

      @Stability(Stable) @NotNull public String getAttrStatus()
      The status of the distribution.
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      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.

    • getBundleId

      @Stability(Stable) @NotNull public String getBundleId()
      The ID of the bundle applied to the distribution.
    • setBundleId

      @Stability(Stable) public void setBundleId(@NotNull String value)
      The ID of the bundle applied to the distribution.
    • getDefaultCacheBehavior

      @Stability(Stable) @NotNull public Object getDefaultCacheBehavior()
      An object that describes the default cache behavior of the distribution.
    • setDefaultCacheBehavior

      @Stability(Stable) public void setDefaultCacheBehavior(@NotNull IResolvable value)
      An object that describes the default cache behavior of the distribution.
    • setDefaultCacheBehavior

      @Stability(Stable) public void setDefaultCacheBehavior(@NotNull CfnDistribution.CacheBehaviorProperty value)
      An object that describes the default cache behavior of the distribution.
    • getDistributionName

      @Stability(Stable) @NotNull public String getDistributionName()
      The name of the distribution.
    • setDistributionName

      @Stability(Stable) public void setDistributionName(@NotNull String value)
      The name of the distribution.
    • getOrigin

      @Stability(Stable) @NotNull public Object getOrigin()
      An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.

      The distribution pulls, caches, and serves content from the origin.

    • setOrigin

      @Stability(Stable) public void setOrigin(@NotNull IResolvable value)
      An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.

      The distribution pulls, caches, and serves content from the origin.

    • setOrigin

      @Stability(Stable) public void setOrigin(@NotNull CfnDistribution.InputOriginProperty value)
      An object that describes the origin resource of the distribution, such as a Lightsail instance, bucket, or load balancer.

      The distribution pulls, caches, and serves content from the origin.

    • getCacheBehaviors

      @Stability(Stable) @Nullable public Object getCacheBehaviors()
      An array of objects that describe the per-path cache behavior of the distribution.
    • setCacheBehaviors

      @Stability(Stable) public void setCacheBehaviors(@Nullable IResolvable value)
      An array of objects that describe the per-path cache behavior of the distribution.
    • setCacheBehaviors

      @Stability(Stable) public void setCacheBehaviors(@Nullable List<Object> value)
      An array of objects that describe the per-path cache behavior of the distribution.
    • getCacheBehaviorSettings

      @Stability(Stable) @Nullable public Object getCacheBehaviorSettings()
      An object that describes the cache behavior settings of the distribution.
    • setCacheBehaviorSettings

      @Stability(Stable) public void setCacheBehaviorSettings(@Nullable IResolvable value)
      An object that describes the cache behavior settings of the distribution.
    • setCacheBehaviorSettings

      @Stability(Stable) public void setCacheBehaviorSettings(@Nullable CfnDistribution.CacheSettingsProperty value)
      An object that describes the cache behavior settings of the distribution.
    • getCertificateName

      @Stability(Stable) @Nullable public String getCertificateName()
      The name of the SSL/TLS certificate attached to the distribution.
    • setCertificateName

      @Stability(Stable) public void setCertificateName(@Nullable String value)
      The name of the SSL/TLS certificate attached to the distribution.
    • getIpAddressType

      @Stability(Stable) @Nullable public String getIpAddressType()
      The IP address type of the distribution.

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

    • setIpAddressType

      @Stability(Stable) public void setIpAddressType(@Nullable String value)
      The IP address type of the distribution.

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

    • getIsEnabled

      @Stability(Stable) @Nullable public Object getIsEnabled()
      A Boolean value indicating whether the distribution is enabled.
    • setIsEnabled

      @Stability(Stable) public void setIsEnabled(@Nullable Boolean value)
      A Boolean value indicating whether the distribution is enabled.
    • setIsEnabled

      @Stability(Stable) public void setIsEnabled(@Nullable IResolvable value)
      A Boolean value indicating whether the distribution is enabled.