Class Distribution
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.cloudfront.Distribution
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IDistribution
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:43.673Z")
@Stability(Stable)
public class Distribution
extends Resource
implements IDistribution
A CloudFront distribution with associated origin(s) and caching behavior(s).
Example:
// Adding an existing Lambda@Edge function created in a different stack // to a CloudFront distribution. Bucket s3Bucket; IVersion functionVersion = Version.fromVersionArn(this, "Version", "arn:aws:lambda:us-east-1:123456789012:function:functionName:1"); Distribution.Builder.create(this, "distro") .defaultBehavior(BehaviorOptions.builder() .origin(new S3Origin(s3Bucket)) .edgeLambdas(List.of(EdgeLambda.builder() .functionVersion(functionVersion) .eventType(LambdaEdgeEventType.VIEWER_REQUEST) .build())) .build()) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
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.core.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
Distribution
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
Distribution
(software.amazon.jsii.JsiiObjectRef objRef) Distribution
(software.constructs.Construct scope, String id, DistributionProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBehavior
(String pathPattern, IOrigin origin) Adds a new behavior to this distribution for the given pathPattern.void
addBehavior
(String pathPattern, IOrigin origin, AddBehaviorOptions behaviorOptions) Adds a new behavior to this distribution for the given pathPattern.static IDistribution
fromDistributionAttributes
(software.constructs.Construct scope, String id, DistributionAttributes attrs) Creates a Distribution construct that represents an external (imported) distribution.The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.rproxy.goskope.com.The distribution ID for this distribution.The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.rproxy.goskope.com.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
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.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Distribution
protected Distribution(software.amazon.jsii.JsiiObjectRef objRef) -
Distribution
protected Distribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Distribution
@Stability(Stable) public Distribution(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DistributionProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromDistributionAttributes
@Stability(Stable) @NotNull public static IDistribution fromDistributionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DistributionAttributes attrs) Creates a Distribution construct that represents an external (imported) distribution.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
addBehavior
@Stability(Stable) public void addBehavior(@NotNull String pathPattern, @NotNull IOrigin origin, @Nullable AddBehaviorOptions behaviorOptions) Adds a new behavior to this distribution for the given pathPattern.- Parameters:
pathPattern
- the path pattern (e.g., 'images/*') that specifies which requests to apply the behavior to. This parameter is required.origin
- the origin to use for this behavior. This parameter is required.behaviorOptions
- the options for the behavior at this path.
-
addBehavior
Adds a new behavior to this distribution for the given pathPattern.- Parameters:
pathPattern
- the path pattern (e.g., 'images/*') that specifies which requests to apply the behavior to. This parameter is required.origin
- the origin to use for this behavior. This parameter is required.
-
getDistributionDomainName
The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.- Specified by:
getDistributionDomainName
in interfaceIDistribution
-
getDistributionId
The distribution ID for this distribution.- Specified by:
getDistributionId
in interfaceIDistribution
-
getDomainName
The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.- Specified by:
getDomainName
in interfaceIDistribution
-