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:
IResource
,IDistribution
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.109.0 (build c221850)",
date="2025-03-14T03:24:54.778Z")
@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 class
Deprecated.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.cloudfront.IDistribution
IDistribution.Jsii$Default, IDistribution.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CloudFrontWebDistribution
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) Deprecated.protected
CloudFrontWebDistribution
(software.amazon.jsii.JsiiObjectRef objRef) Deprecated.CloudFrontWebDistribution
(software.constructs.Construct scope, String id, CloudFrontWebDistributionProps props) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic IDistribution
fromDistributionAttributes
(software.constructs.Construct scope, String id, CloudFrontWebDistributionAttributes attrs) Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.grant
(IGrantable identity, @NotNull String... actions) Deprecated.grantCreateInvalidation
(IGrantable identity) Deprecated.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
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 @NotNull String... actions) Deprecated.(deprecated) Adds an IAM policy statement associated with this distribution to an IAM principal's policy.- Specified by:
grant
in 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:
grantCreateInvalidation
in interfaceIDistribution
- Parameters:
identity
- The principal. This parameter is required.
-
getDistributionArn
Deprecated.(deprecated) The distribution ARN for this distribution.- Specified by:
getDistributionArn
in 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:
getDistributionDomainName
in interfaceIDistribution
-
getDistributionId
Deprecated.(deprecated) The distribution ID for this distribution.- Specified by:
getDistributionId
in interfaceIDistribution
-
getLoggingBucket
Deprecated.(deprecated) The logging bucket for this CloudFront distribution.If logging is not enabled for this distribution - this property will be undefined.
-
Distribution
instead