Class CloudFrontWebDistribution
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.cloudfront.CloudFrontWebDistribution
- All Implemented Interfaces:
IEnvironmentAware,IResource,IDistribution,IDistributionRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)",
date="2025-11-10T13:40:00.173Z")
@Stability(Deprecated)
@Deprecated
public class CloudFrontWebDistribution
extends Resource
implements IDistribution
Deprecated.
(deprecated) 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:
Bucket sourceBucket = new Bucket(this, "Bucket");
CloudFrontWebDistribution distribution = CloudFrontWebDistribution.Builder.create(this, "MyDistribution")
.originConfigs(List.of(SourceConfiguration.builder()
.s3OriginSource(S3OriginConfig.builder()
.s3BucketSource(sourceBucket)
.build())
.behaviors(List.of(Behavior.builder().isDefaultBehavior(true).build()))
.build()))
.build();
This will create a CloudFront distribution that uses your S3Bucket as its origin.
You can customize the distribution using additional properties from the CloudFrontWebDistributionProps interface.
Example:
Bucket sourceBucket;
ViewerCertificate viewerCertificate = ViewerCertificate.fromIamCertificate("MYIAMROLEIDENTIFIER", ViewerCertificateOptions.builder()
.aliases(List.of("MYALIAS"))
.build());
CloudFrontWebDistribution.Builder.create(this, "MyCfWebDistribution")
.originConfigs(List.of(SourceConfiguration.builder()
.s3OriginSource(S3OriginConfig.builder()
.s3BucketSource(sourceBucket)
.build())
.behaviors(List.of(Behavior.builder().isDefaultBehavior(true).build()))
.build()))
.viewerCertificate(viewerCertificate)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDeprecated.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.cloudfront.IDistribution
IDistribution.Jsii$Default, IDistribution.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCloudFrontWebDistribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) Deprecated.protectedCloudFrontWebDistribution(software.amazon.jsii.JsiiObjectRef objRef) Deprecated.CloudFrontWebDistribution(software.constructs.Construct scope, String id, CloudFrontWebDistributionProps props) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic IDistributionfromDistributionAttributes(software.constructs.Construct scope, String id, CloudFrontWebDistributionAttributes attrs) Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.grant(IGrantable identity, String... actions) Deprecated.grantCreateInvalidation(IGrantable identity) Deprecated.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.services.cloudfront.IDistribution
getEnv, getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Deprecated.(deprecated) Uniquely identifies this class.
-
-
Constructor Details
-
CloudFrontWebDistribution
protected CloudFrontWebDistribution(software.amazon.jsii.JsiiObjectRef objRef) Deprecated. -
CloudFrontWebDistribution
protected CloudFrontWebDistribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) Deprecated. -
CloudFrontWebDistribution
@Stability(Deprecated) @Deprecated public CloudFrontWebDistribution(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CloudFrontWebDistributionProps props) Deprecated.- Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromDistributionAttributes
@Stability(Deprecated) @Deprecated @NotNull public static IDistribution fromDistributionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CloudFrontWebDistributionAttributes attrs) Deprecated.(deprecated) Creates a construct that represents an external (imported) distribution.- Parameters:
scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
-
grant
@Stability(Deprecated) @Deprecated @NotNull public Grant grant(@NotNull IGrantable identity, @NotNull String... actions) Deprecated.(deprecated) Adds an IAM policy statement associated with this distribution to an IAM principal's policy.- Specified by:
grantin interfaceIDistribution- Parameters:
identity- The principal. This parameter is required.actions- The set of actions to allow (i.e. "cloudfront:ListInvalidations"). This parameter is required.
-
grantCreateInvalidation
@Stability(Deprecated) @Deprecated @NotNull public Grant grantCreateInvalidation(@NotNull IGrantable identity) Deprecated.(deprecated) Grant to create invalidations for this bucket to an IAM principal (Role/Group/User).- Specified by:
grantCreateInvalidationin interfaceIDistribution- Parameters:
identity- The principal. This parameter is required.
-
getDistributionArn
Deprecated.(deprecated) The distribution ARN for this distribution.- Specified by:
getDistributionArnin interfaceIDistribution
-
getDistributionDomainName
Deprecated.(deprecated) 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.)
- Specified by:
getDistributionDomainNamein interfaceIDistribution
-
getDistributionId
Deprecated.(deprecated) The distribution ID for this distribution.- Specified by:
getDistributionIdin interfaceIDistribution
-
getDistributionRef
Deprecated.(deprecated) A reference to a Distribution resource.- Specified by:
getDistributionRefin interfaceIDistributionRef
-
getLoggingBucket
Deprecated.(deprecated) The logging bucket for this CloudFront distribution.If logging is not enabled for this distribution - this property will be undefined.
-
Distributioninstead