diff --git a/packages/@aws-cdk/aws-s3-deployment/README.md b/packages/@aws-cdk/aws-s3-deployment/README.md index e7f21b1f54b88..b0bb1e2d9ebd5 100644 --- a/packages/@aws-cdk/aws-s3-deployment/README.md +++ b/packages/@aws-cdk/aws-s3-deployment/README.md @@ -156,39 +156,15 @@ import * as origins from '@aws-cdk/aws-cloudfront-origins'; const bucket = new s3.Bucket(this, 'Destination'); -// Option 1 (Stable): Handles buckets whether or not they are configured for website hosting. +// Handles buckets whether or not they are configured for website hosting. const distribution = new cloudfront.Distribution(this, 'Distribution', { defaultBehavior: { origin: new origins.S3Origin(bucket) }, }); -// Option 2 (Stable): Use this if the bucket has website hosting enabled. -const distribution_for_website_bucket = new cloudfront.CloudFrontWebDistribution(this, 'DistributionForWebBucket', { - originConfigs: [ - { - customOriginSource: { - domainName: bucket.bucketWebsiteDomainName, - }, - behaviors : [ {isDefaultBehavior: true}] - } - ] -}); - -// Option 3 (Stable): Use this version if the bucket does not have website hosting enabled. -const distribution_for_bucket = new cloudfront.CloudFrontWebDistribution(this, 'DistributionForBucket', { - originConfigs: [ - { - s3OriginSource: { - s3BucketSource: bucket - }, - behaviors : [ {isDefaultBehavior: true}] - } - ] -}); - new s3deploy.BucketDeployment(this, 'DeployWithInvalidation', { sources: [s3deploy.Source.asset('./website-dist')], destinationBucket: bucket, - distribution, // or distribution_for_website_bucket or distribution_for_bucket + distribution, distributionPaths: ['/images/*.png'], }); ```