@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:00:50.275Z") @Stability(value=Experimental) public class CloudFrontWebDistribution extends Resource implements IDistribution
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;
Object 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.
| Modifier and Type | Class and Description |
|---|---|
static class |
CloudFrontWebDistribution.Builder
(experimental) A fluent builder for
CloudFrontWebDistribution. |
software.amazon.jsii.JsiiObject.InitializationModeIDistribution.Jsii$Default, IDistribution.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
CloudFrontWebDistribution(software.constructs.Construct scope,
String id,
CloudFrontWebDistributionProps props) |
protected |
CloudFrontWebDistribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CloudFrontWebDistribution(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static IDistribution |
fromDistributionAttributes(software.constructs.Construct scope,
String id,
CloudFrontWebDistributionAttributes attrs)
(experimental) Creates a construct that represents an external (imported) distribution.
|
String |
getDistributionDomainName()
(experimental) The domain name created by CloudFront for this distribution.
|
String |
getDistributionId()
(experimental) The distribution ID for this distribution.
|
IBucket |
getLoggingBucket()
(experimental) The logging bucket for this CloudFront distribution.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected CloudFrontWebDistribution(software.amazon.jsii.JsiiObjectRef objRef)
protected CloudFrontWebDistribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public CloudFrontWebDistribution(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CloudFrontWebDistributionProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Experimental) @NotNull public static IDistribution fromDistributionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CloudFrontWebDistributionAttributes attrs)
scope - This parameter is required.id - This parameter is required.attrs - This parameter is required.@Stability(value=Experimental) @NotNull public String getDistributionDomainName()
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.)
getDistributionDomainName in interface IDistribution@Stability(value=Experimental) @NotNull public String getDistributionId()
getDistributionId in interface IDistribution@Stability(value=Experimental) @Nullable public IBucket getLoggingBucket()
If logging is not enabled for this distribution - this property will be undefined.
Copyright © 2021. All rights reserved.