Skip to content

Commit b7fcdb5

Browse files
authored
docs(cloudfront): update Distribution example to use S3BucketOrigin instead of deprecated S3Origin (#34525)
### Issue # (if applicable) Closes #34469. ### Reason for this change The [Distribution](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.Distribution.html#example) documentation still uses the deprecate [origins.S3Origin](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront_origins.S3Origin.html) api. ### Description of changes Use [S3BucketOrigin.withOriginAccessControl(bucket, props?)](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront_origins.S3BucketOrigin.html#static-withwbroriginwbraccesswbrcontrolbucket-props) instead of [origins.S3Origin](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront_origins.S3Origin.html). ### Describe any new or updated permissions being added None ### Description of how you validated changes This is an example code in documentation. No tests are required. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 65d8424 commit b7fcdb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/aws-cdk-lib/aws-cloudfront/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ const functionVersion = lambda.Version.fromVersionArn(this, 'Version', 'arn:aws:
839839

840840
new cloudfront.Distribution(this, 'distro', {
841841
defaultBehavior: {
842-
origin: new origins.S3Origin(s3Bucket),
842+
origin: origins.S3BucketOrigin.withOriginAccessControl(s3Bucket),
843843
edgeLambdas: [
844844
{
845845
functionVersion,

0 commit comments

Comments
 (0)