class S3Origin
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudFront.Origins.S3Origin |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudfrontorigins#S3Origin |
![]() | software.amazon.awscdk.services.cloudfront.origins.S3Origin |
![]() | aws_cdk.aws_cloudfront_origins.S3Origin |
![]() | aws-cdk-lib » aws_cloudfront_origins » S3Origin |
⚠️ Deprecated: Use S3BucketOrigin
or S3StaticWebsiteOrigin
instead.
Implements
IOrigin
An Origin that is backed by an S3 bucket.
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.
Example
// Adding an existing Lambda@Edge function created in a different stack
// to a CloudFront distribution.
declare const s3Bucket: s3.Bucket;
const functionVersion = lambda.Version.fromVersionArn(this, 'Version', 'arn:aws:lambda:us-east-1:123456789012:function:functionName:1');
new cloudfront.Distribution(this, 'distro', {
defaultBehavior: {
origin: new origins.S3Origin(s3Bucket),
edgeLambdas: [
{
functionVersion,
eventType: cloudfront.LambdaEdgeEventType.VIEWER_REQUEST,
},
],
},
});
Initializer
new S3Origin(bucket: IBucket, props?: S3OriginProps)
⚠️ Deprecated: Use S3BucketOrigin
or S3StaticWebsiteOrigin
instead.
Parameters
- bucket
IBucket
- props
S3
Origin Props
Methods
Name | Description |
---|---|
bind(scope, options) | The method called when a given Origin is added (for the first time) to a Distribution. |
bind(scope, options)
public bind(scope: Construct, options: OriginBindOptions): OriginBindConfig
⚠️ Deprecated: Use S3BucketOrigin
or S3StaticWebsiteOrigin
instead.
Parameters
- scope
Construct
- options
Origin
Bind Options
Returns
The method called when a given Origin is added (for the first time) to a Distribution.