@Generated(value="jsii-pacmak/1.47.0 (build 86d2c33)", date="2021-12-22T10:27:16.279Z") @Stability(value=Stable) public class Distribution extends Resource implements IDistribution
Example:
Bucket s3Bucket;
// Add a cloudfront Function to a Distribution
Function cfFunction = Function.Builder.create(this, "Function")
.code(FunctionCode.fromInline("function handler(event) { return event.request }"))
.build();
Distribution.Builder.create(this, "distro")
.defaultBehavior(BehaviorOptions.builder()
.origin(new S3Origin(s3Bucket))
.functionAssociations(List.of(FunctionAssociation.builder()
.function(cfFunction)
.eventType(FunctionEventType.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, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackprotected 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()
Copyright © 2021. All rights reserved.