@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-13T01:13:36.008Z") 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 . |
IDistribution.Jsii$Default, IDistribution.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
Distribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Distribution(software.amazon.jsii.JsiiObjectRef objRef) |
|
Distribution(software.constructs.Construct scope,
java.lang.String id,
DistributionProps props) |
Modifier and Type | Method and Description |
---|---|
void |
addBehavior(java.lang.String pathPattern,
IOrigin origin)
Adds a new behavior to this distribution for the given pathPattern.
|
void |
addBehavior(java.lang.String pathPattern,
IOrigin origin,
AddBehaviorOptions behaviorOptions)
Adds a new behavior to this distribution for the given pathPattern.
|
static IDistribution |
fromDistributionAttributes(software.constructs.Construct scope,
java.lang.String id,
DistributionAttributes attrs)
Creates a Distribution construct that represents an external (imported) distribution.
|
java.lang.String |
getDistributionDomainName()
The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
|
java.lang.String |
getDistributionId()
The distribution ID for this distribution.
|
java.lang.String |
getDomainName()
The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected Distribution(software.amazon.jsii.JsiiObjectRef objRef)
protected Distribution(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public Distribution(software.constructs.Construct scope, java.lang.String id, DistributionProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public static IDistribution fromDistributionAttributes(software.constructs.Construct scope, java.lang.String id, DistributionAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public void addBehavior(java.lang.String pathPattern, IOrigin origin, 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.public void addBehavior(java.lang.String pathPattern, 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.public java.lang.String getDistributionDomainName()
getDistributionDomainName
in interface IDistribution
public java.lang.String getDistributionId()
getDistributionId
in interface IDistribution
public java.lang.String getDomainName()
getDomainName
in interface IDistribution