All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.services.cloudfront.CloudFrontWebDistribution Maven / Gradle / Ivy

package software.amazon.awscdk.services.cloudfront;

/**
 * Amazon CloudFront is a global content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to your viewers with low latency and high transfer speeds.
 * 

* CloudFront fronts user provided content and caches it at edge locations across the world. *

* Here's how you can use this construct: *

*

 * // Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
 * import software.amazon.awscdk.services.cloudfront.CloudFrontWebDistribution;
 * var sourceBucket = new Bucket(this, "Bucket");
 * CloudFrontWebDistribution distribution = new CloudFrontWebDistribution(this, "MyDistribution", new CloudFrontWebDistributionProps()
 *         .originConfigs(asList(new SourceConfiguration()
 *                 .s3OriginSource(new S3OriginConfig()
 *                         .s3BucketSource(sourceBucket))
 *                 .behaviors(asList(new Behavior().isDefaultBehavior(true))))));
 * 
*

* This will create a CloudFront distribution that uses your S3Bucket as it's origin. *

* You can customize the distribution using additional properties from the CloudFrontWebDistributionProps interface. *

* EXPERIMENTAL */ @javax.annotation.Generated(value = "jsii-pacmak/0.22.0 (build 14afdde)", date = "2020-03-18T10:30:22.900Z") @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.cloudfront.$Module.class, fqn = "@aws-cdk/aws-cloudfront.CloudFrontWebDistribution") public class CloudFrontWebDistribution extends software.amazon.awscdk.core.Construct implements software.amazon.awscdk.services.cloudfront.IDistribution { protected CloudFrontWebDistribution(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); } protected CloudFrontWebDistribution(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { super(initializationMode); } /** * EXPERIMENTAL *

* @param scope This parameter is required. * @param id This parameter is required. * @param props This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public CloudFrontWebDistribution(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.cloudfront.CloudFrontWebDistributionProps props) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") }); } /** * The distribution ID for this distribution. *

* EXPERIMENTAL */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.lang.String getDistributionId() { return this.jsiiGet("distributionId", java.lang.String.class); } /** * The domain name created by CloudFront for this distribution. *

* If you are using aliases for your distribution, this is the domainName your DNS records should point to. * (In Route53, you could create an ALIAS record to this value, for example. ) *

* EXPERIMENTAL */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.lang.String getDomainName() { return this.jsiiGet("domainName", java.lang.String.class); } /** * The logging bucket for this CloudFront distribution. *

* If logging is not enabled for this distribution - this property will be undefined. *

* EXPERIMENTAL */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.s3.IBucket getLoggingBucket() { return this.jsiiGet("loggingBucket", software.amazon.awscdk.services.s3.IBucket.class); } /** * A fluent builder for {@link software.amazon.awscdk.services.cloudfront.CloudFrontWebDistribution}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder { /** * EXPERIMENTAL *

* @return a new instance of {@link Builder}. * @param scope This parameter is required. * @param id This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static Builder create(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) { return new Builder(scope, id); } private final software.amazon.awscdk.core.Construct scope; private final java.lang.String id; private final software.amazon.awscdk.services.cloudfront.CloudFrontWebDistributionProps.Builder props; private Builder(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) { this.scope = scope; this.id = id; this.props = new software.amazon.awscdk.services.cloudfront.CloudFrontWebDistributionProps.Builder(); } /** * The origin configurations for this distribution. *

* Behaviors are a part of the origin. *

* EXPERIMENTAL *

* @return {@code this} * @param originConfigs The origin configurations for this distribution. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder originConfigs(final java.util.List originConfigs) { this.props.originConfigs(originConfigs); return this; } /** * AliasConfiguration is used to configured CloudFront to respond to requests on custom domain names. *

* Default: - None. *

* @return {@code this} * @deprecated see {@link CloudFrontWebDistributionProps#viewerCertificate} with {@link ViewerCertificate#acmCertificate} * @param aliasConfiguration AliasConfiguration is used to configured CloudFront to respond to requests on custom domain names. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated) @Deprecated public Builder aliasConfiguration(final software.amazon.awscdk.services.cloudfront.AliasConfiguration aliasConfiguration) { this.props.aliasConfiguration(aliasConfiguration); return this; } /** * A comment for this distribution in the CloudFront console. *

* Default: - No comment is added to distribution. *

* EXPERIMENTAL *

* @return {@code this} * @param comment A comment for this distribution in the CloudFront console. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder comment(final java.lang.String comment) { this.props.comment(comment); return this; } /** * The default object to serve. *

* Default: - "index.html" is served. *

* EXPERIMENTAL *

* @return {@code this} * @param defaultRootObject The default object to serve. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder defaultRootObject(final java.lang.String defaultRootObject) { this.props.defaultRootObject(defaultRootObject); return this; } /** * If your distribution should have IPv6 enabled. *

* Default: true *

* EXPERIMENTAL *

* @return {@code this} * @param enableIpV6 If your distribution should have IPv6 enabled. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder enableIpV6(final java.lang.Boolean enableIpV6) { this.props.enableIpV6(enableIpV6); return this; } /** * How CloudFront should handle requests that are not successful (eg PageNotFound). *

* By default, CloudFront does not replace HTTP status codes in the 4xx and 5xx range * with custom error messages. CloudFront does not cache HTTP status codes. *

* Default: - No custom error configuration. *

* EXPERIMENTAL *

* @return {@code this} * @param errorConfigurations How CloudFront should handle requests that are not successful (eg PageNotFound). This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder errorConfigurations(final java.util.List errorConfigurations) { this.props.errorConfigurations(errorConfigurations); return this; } /** * The max supported HTTP Versions. *

* Default: HttpVersion.HTTP2 *

* EXPERIMENTAL *

* @return {@code this} * @param httpVersion The max supported HTTP Versions. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder httpVersion(final software.amazon.awscdk.services.cloudfront.HttpVersion httpVersion) { this.props.httpVersion(httpVersion); return this; } /** * Optional - if we should enable logging. *

* You can pass an empty object ({}) to have us auto create a bucket for logging. * Omission of this property indicates no logging is to be enabled. *

* Default: - no logging is enabled by default. *

* EXPERIMENTAL *

* @return {@code this} * @param loggingConfig Optional - if we should enable logging. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder loggingConfig(final software.amazon.awscdk.services.cloudfront.LoggingConfiguration loggingConfig) { this.props.loggingConfig(loggingConfig); return this; } /** * The price class for the distribution (this impacts how many locations CloudFront uses for your distribution, and billing). *

* Default: PriceClass.PriceClass100 the cheapest option for CloudFront is picked by default. *

* EXPERIMENTAL *

* @return {@code this} * @param priceClass The price class for the distribution (this impacts how many locations CloudFront uses for your distribution, and billing). This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder priceClass(final software.amazon.awscdk.services.cloudfront.PriceClass priceClass) { this.props.priceClass(priceClass); return this; } /** * Specifies whether you want viewers to use HTTP or HTTPS to request your objects, whether you're using an alternate domain name with HTTPS, and if so, if you're using AWS Certificate Manager (ACM) or a third-party certificate authority. *

* Default: ViewerCertificate.fromCloudFrontDefaultCertificate() *

* EXPERIMENTAL *

* @return {@code this} * @see https://aws.amazon.com/premiumsupport/knowledge-center/custom-ssl-certificate-cloudfront/ * @param viewerCertificate Specifies whether you want viewers to use HTTP or HTTPS to request your objects, whether you're using an alternate domain name with HTTPS, and if so, if you're using AWS Certificate Manager (ACM) or a third-party certificate authority. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder viewerCertificate(final software.amazon.awscdk.services.cloudfront.ViewerCertificate viewerCertificate) { this.props.viewerCertificate(viewerCertificate); return this; } /** * The default viewer policy for incoming clients. *

* Default: RedirectToHTTPs *

* EXPERIMENTAL *

* @return {@code this} * @param viewerProtocolPolicy The default viewer policy for incoming clients. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder viewerProtocolPolicy(final software.amazon.awscdk.services.cloudfront.ViewerProtocolPolicy viewerProtocolPolicy) { this.props.viewerProtocolPolicy(viewerProtocolPolicy); return this; } /** * Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution. *

* Default: - No AWS Web Application Firewall web access control list (web ACL). *

* EXPERIMENTAL *

* @return {@code this} * @see https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html * @param webAclId Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder webAclId(final java.lang.String webAclId) { this.props.webAclId(webAclId); return this; } /** * @returns a newly built instance of {@link software.amazon.awscdk.services.cloudfront.CloudFrontWebDistribution}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public software.amazon.awscdk.services.cloudfront.CloudFrontWebDistribution build() { return new software.amazon.awscdk.services.cloudfront.CloudFrontWebDistribution( this.scope, this.id, this.props.build() ); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy