@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-11T17:58:48.795Z") @Stability(value=Stable) 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
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)
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.
|
String |
getDistributionDomainName()
The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
|
String |
getDistributionId()
The distribution ID for this distribution.
|
String |
getDomainName()
The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcegetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackgetNodeprotected Distribution(software.amazon.jsii.JsiiObjectRef objRef)
protected Distribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
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=Stable) @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=Stable)
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=Stable)
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=Stable) @NotNull public String getDistributionDomainName()
getDistributionDomainName in interface IDistribution@Stability(value=Stable) @NotNull public String getDistributionId()
getDistributionId in interface IDistribution@Stability(value=Stable) @NotNull public String getDomainName()
getDomainName in interface IDistributionCopyright © 2022. All rights reserved.