Class S3Origin
An Origin that is backed by an S3 bucket.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.CloudFront.Origins
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class S3Origin : DeputyBase, IOrigin
Syntax (vb)
Public Class S3Origin
Inherits DeputyBase
Implements IOrigin
Remarks
If the bucket is configured for website hosting, this origin will be configured to use the bucket as an HTTP server origin and will use the bucket's configured website redirects and error handling. Otherwise, the origin is created as a bucket origin and will use CloudFront's redirect and error handling.
ExampleMetadata: infused
Examples
// Adding an existing Lambda@Edge function created in a different stack
// to a CloudFront distribution.
Bucket s3Bucket;
var functionVersion = Version.FromVersionArn(this, "Version", "arn:aws:lambda:us-east-1:123456789012:function:functionName:1");
new Distribution(this, "distro", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = new S3Origin(s3Bucket),
EdgeLambdas = new [] { new EdgeLambda {
FunctionVersion = functionVersion,
EventType = LambdaEdgeEventType.VIEWER_REQUEST
} }
}
});
Synopsis
Constructors
S3Origin(IBucket, IS3OriginProps) | |
S3Origin(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
S3Origin(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(Construct, IOriginBindOptions) | The method called when a given Origin is added (for the first time) to a Distribution. |
Constructors
S3Origin(IBucket, IS3OriginProps)
public S3Origin(IBucket bucket, IS3OriginProps props = null)
Parameters
- bucket IBucket
- props IS3OriginProps
S3Origin(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected S3Origin(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
S3Origin(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected S3Origin(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(Construct, IOriginBindOptions)
The method called when a given Origin is added (for the first time) to a Distribution.
public virtual IOriginBindConfig Bind(Construct scope, IOriginBindOptions options)
Parameters
- scope Constructs.Construct
- options IOriginBindOptions
Returns