@Generated(value="jsii-pacmak/1.46.0 (build cd08c55)", date="2021-11-25T20:11:05.341Z") @Stability(value=Experimental) public class Distribution extends Resource implements IDistribution
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
Distribution.Builder
(experimental) A fluent builder for
Distribution. |
software.amazon.jsii.JsiiObject.InitializationModeIDistribution.Jsii$Default, IDistribution.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
Distribution(software.constructs.Construct scope,
String id,
DistributionProps props) |
protected |
Distribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Distribution(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBehavior(String pathPattern,
IOrigin origin)
(experimental) Adds a new behavior to this distribution for the given pathPattern.
|
void |
addBehavior(String pathPattern,
IOrigin origin,
AddBehaviorOptions behaviorOptions)
(experimental) Adds a new behavior to this distribution for the given pathPattern.
|
static IDistribution |
fromDistributionAttributes(software.constructs.Construct scope,
String id,
DistributionAttributes attrs)
(experimental) Creates a Distribution construct that represents an external (imported) distribution.
|
String |
getDistributionDomainName()
(experimental) The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
|
String |
getDistributionId()
(experimental) The distribution ID for this distribution.
|
String |
getDomainName()
(experimental) The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Distribution(software.amazon.jsii.JsiiObjectRef objRef)
protected Distribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public Distribution(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
DistributionProps 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 DistributionAttributes attrs)
scope - This parameter is required.id - This parameter is required.attrs - This parameter is required.@Stability(value=Experimental)
public void addBehavior(@NotNull
String pathPattern,
@NotNull
IOrigin origin,
@Nullable
AddBehaviorOptions behaviorOptions)
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.@Stability(value=Experimental)
public void addBehavior(@NotNull
String pathPattern,
@NotNull
IOrigin origin)
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.@Stability(value=Experimental) @NotNull public String getDistributionDomainName()
getDistributionDomainName in interface IDistribution@Stability(value=Experimental) @NotNull public String getDistributionId()
getDistributionId in interface IDistribution@Stability(value=Experimental) @NotNull public String getDomainName()
Copyright © 2021. All rights reserved.