From ac09b9654d166dec5a38e71c7d36b7cbb3275317 Mon Sep 17 00:00:00 2001 From: Blake Price Date: Fri, 28 Sep 2018 10:10:04 -0700 Subject: [PATCH 01/10] fix(aws-cloudfront): Fix loggingConfig being ignored feat(aws-s3): Add support for domainName on BucketRef instead of just Bucket LoggingConfiguration now requires bucket instead of it being optional. There is no point to including a LoggingConfiguration without a bucket (no-breaking). Fixes #721 --- .../aws-cloudfront/lib/web_distribution.ts | 10 ++- ...eg.cloudfront-bucket-logging.expected.json | 70 +++++++++++++++++++ .../test/integ.cloudfront-bucket-logging.ts | 34 +++++++++ packages/@aws-cdk/aws-s3/lib/bucket.ts | 17 +++++ .../integ.bucket.domain-name.expected.json | 24 +++++++ .../aws-s3/test/integ.bucket.domain-name.ts | 22 ++++++ 6 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json create mode 100644 packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts create mode 100644 packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.expected.json create mode 100644 packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts index cd12299bb3e57..77a294b17bdce 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts @@ -74,7 +74,7 @@ export enum SSLMethod { * @default prefix: no prefix is set by default. */ export interface LoggingConfiguration { - readonly bucket?: s3.BucketRef, + readonly bucket: s3.BucketRef, readonly includeCookies?: boolean, readonly prefix?: string } @@ -561,6 +561,14 @@ export class CloudFrontWebDistribution extends cdk.Construct { }; } + if (props.loggingConfig) { + distributionConfig.logging = { + bucket: props.loggingConfig.bucket.domainName, + includeCookies: props.loggingConfig.includeCookies || false, + prefix: props.loggingConfig.prefix + }; + } + const distribution = new cloudformation.DistributionResource(this, 'CFDistribution', {distributionConfig}); this.domainName = distribution.distributionDomainName; diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json new file mode 100644 index 0000000000000..3347ce330a67e --- /dev/null +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json @@ -0,0 +1,70 @@ +{ + "Resources": { + "Bucket83908E77": { + "Type": "AWS::S3::Bucket" + }, + "AnAmazingWebsiteProbablyCFDistribution47E3983B": { + "Type": "AWS::CloudFront::Distribution", + "Properties": { + "DistributionConfig": { + "CacheBehaviors": [], + "DefaultCacheBehavior": { + "AllowedMethods": [ + "GET", + "HEAD" + ], + "CachedMethods": [ + "GET", + "HEAD" + ], + "ForwardedValues": { + "Cookies": { + "Forward": "none" + }, + "QueryString": false + }, + "TargetOriginId": "origin1", + "ViewerProtocolPolicy": "redirect-to-https" + }, + "DefaultRootObject": "index.html", + "Enabled": true, + "HttpVersion": "http2", + "IPV6Enabled": true, + "Origins": [ + { + "CustomOriginConfig": { + "HTTPPort": 80, + "HTTPSPort": 443, + "OriginKeepaliveTimeout": 5, + "OriginProtocolPolicy": "https-only", + "OriginReadTimeout": 30, + "OriginSSLProtocols": [ + "TLSv1.2" + ] + }, + "DomainName": "brelandm.a2z.com", + "Id": "origin1", + "OriginCustomHeaders": [ + { + "HeaderName": "X-Custom-Header", + "HeaderValue": "somevalue" + } + ] + } + ], + "PriceClass": "PriceClass_100", + "ViewerCertificate": { + "CloudFrontDefaultCertificate": true + }, + "Logging": { + "Bucket": { + "Fn::GetAtt":["Bucket83908E77","DomainName"] + }, + "IncludeCookies": true, + "Prefix": "test-prefix" + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts new file mode 100644 index 0000000000000..e2250f5d9f6b7 --- /dev/null +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts @@ -0,0 +1,34 @@ +import s3 = require('@aws-cdk/aws-s3'); +import cdk = require('@aws-cdk/cdk'); +import cloudfront = require('../lib'); + +const app = new cdk.App(process.argv); + +const stack = new cdk.Stack(app, 'aws-cdk-cloudfront-custom'); + +const loggingBucket = new s3.Bucket(stack, 'Bucket'); + +new cloudfront.CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', { + originConfigs: [ + { + originHeaders: { + "X-Custom-Header": "somevalue", + }, + customOriginSource: { + domainName: "brelandm.a2z.com", + }, + behaviors: [ + { + isDefaultBehavior: true, + } + ] + } + ], + loggingConfig: { + bucket: loggingBucket, + includeCookies: true, + prefix: 'test-prefix' + } +}); + +process.stdout.write(app.run()); diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index 1a55df6afd323..7751b447c5410 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -30,6 +30,12 @@ export interface BucketRefProps { * policy, won't work. */ bucketName?: string; + + /** + * The domain of the bucket. This is not required and will be infered from + * the bucket name. + */ + bucketDomainName?: string; } /** @@ -72,6 +78,11 @@ export abstract class BucketRef extends cdk.Construct { */ public abstract readonly bucketName: string; + /** + * The domain of the bucket. + */ + public abstract readonly domainName: string; + /** * Optional KMS encryption key associated with this bucket. */ @@ -701,6 +712,7 @@ export interface NotificationKeyFilter { class ImportedBucketRef extends BucketRef { public readonly bucketArn: string; public readonly bucketName: string; + public readonly domainName: string; public readonly encryptionKey?: kms.EncryptionKey; protected policy?: BucketPolicy; @@ -716,7 +728,12 @@ class ImportedBucketRef extends BucketRef { this.bucketArn = parseBucketArn(props); this.bucketName = bucketName; + this.domainName = props.bucketDomainName || this.generateDomainName(); this.autoCreatePolicy = false; this.policy = undefined; } + + private generateDomainName() { + return `${this.bucketName}.s3.amazonaws.com`; + } } diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.expected.json b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.expected.json new file mode 100644 index 0000000000000..01c6536296847 --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.expected.json @@ -0,0 +1,24 @@ +{ + "Resources": { + "MyBucketF68F3FF0": { + "Type": "AWS::S3::Bucket" + } + }, + "Outputs": { + "RealBucketDomain": { + "Value": { + "Fn::GetAtt":["MyBucketF68F3FF0","DomainName"] + }, + "Export": { + "Name": "aws-cdk-s3-urls:RealBucketDomain" + } + }, + "ImportedBucketDomain": { + "Value": "my-bucket-test.s3.amazonaws.com", + "Export": { + "Name": "aws-cdk-s3-urls:ImportedBucketDomain" + } + } + } +} + diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts new file mode 100644 index 0000000000000..469c22b27b4be --- /dev/null +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts @@ -0,0 +1,22 @@ +import cdk = require('@aws-cdk/cdk'); +import s3 = require('../lib'); + +class TestStack extends cdk.Stack { + constructor(parent: cdk.App, id: string) { + super(parent, id); + + /// !show + const bucket = new s3.Bucket(this, 'MyBucket'); + const bucket2 = s3.Bucket.import(this, "MyBucket2", { + bucketArn: "arn:aws:s3:::my-bucket-test" + }); + + new cdk.Output(this, 'RealBucketDomain', { value: bucket.domainName }); + new cdk.Output(this, 'ImportedBucketDomain', { value: bucket2.domainName }); + /// !hide + } +} + +const app = new cdk.App(process.argv); +new TestStack(app, 'aws-cdk-s3-urls'); +process.stdout.write(app.run()); From 43516c54decb1d3229a9fa5fa2c932feef235716 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 28 Sep 2018 19:43:18 +0200 Subject: [PATCH 02/10] Update docstring to be in line with standards --- packages/@aws-cdk/aws-s3/lib/bucket.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index 7751b447c5410..e885e7c006c47 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -32,8 +32,9 @@ export interface BucketRefProps { bucketName?: string; /** - * The domain of the bucket. This is not required and will be infered from - * the bucket name. + * The domain name of the bucket. + * + * @default Inferred from bucket name */ bucketDomainName?: string; } From 7a449818599dc89af45077bd1cfeafecf2a858b0 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 28 Sep 2018 19:47:11 +0200 Subject: [PATCH 03/10] Fix docstring format for LoggingConfiguration --- .../aws-cloudfront/lib/web_distribution.ts | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts index 77a294b17bdce..1f68f4a9d89f5 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts @@ -65,17 +65,28 @@ export enum SSLMethod { } /** - * CloudFront supports logging of incoming requests and can log details to a given S3 Bucket. - * - * If you wish to configure logging you can configure details about it. - * - * @default bucket: if you do not pass a bucket for logging - we'll create one - * @default includeCookies: false by default - * @default prefix: no prefix is set by default. + * Logging configuration for incoming requests */ export interface LoggingConfiguration { + /** + * Bucket to log requests to + * + * @default A logging bucket is automatically created + */ readonly bucket: s3.BucketRef, + + /** + * Whether to include the cookies in the logs + * + * @default false + */ readonly includeCookies?: boolean, + + /** + * Where in the bucket to store logs + * + * @default No prefix + */ readonly prefix?: string } From cb52b3abcdd0b8d57ac15ecf89595d98f6ba9bc0 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 28 Sep 2018 19:53:09 +0200 Subject: [PATCH 04/10] Fix whitespace errors --- packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts index 1f68f4a9d89f5..704c696ef9b59 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts @@ -70,15 +70,15 @@ export enum SSLMethod { export interface LoggingConfiguration { /** * Bucket to log requests to - * + * * @default A logging bucket is automatically created */ readonly bucket: s3.BucketRef, - + /** * Whether to include the cookies in the logs * - * @default false + * @default false */ readonly includeCookies?: boolean, From 24723ed594eb0254db09f54e61ecc1a0b4de5737 Mon Sep 17 00:00:00 2001 From: Blake Price Date: Fri, 28 Sep 2018 11:15:53 -0700 Subject: [PATCH 05/10] Fix whitespace errors with S3 Auto generate logging bucket if one is not provided + tests --- .../aws-cloudfront/lib/web_distribution.ts | 4 +- ...eg.cloudfront-bucket-logging.expected.json | 65 +++++++++++++++++++ .../test/integ.cloudfront-bucket-logging.ts | 19 ++++++ packages/@aws-cdk/aws-s3/lib/bucket.ts | 2 +- 4 files changed, 87 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts index 704c696ef9b59..e851418a46cd2 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts @@ -73,7 +73,7 @@ export interface LoggingConfiguration { * * @default A logging bucket is automatically created */ - readonly bucket: s3.BucketRef, + readonly bucket?: s3.BucketRef, /** * Whether to include the cookies in the logs @@ -574,7 +574,7 @@ export class CloudFrontWebDistribution extends cdk.Construct { if (props.loggingConfig) { distributionConfig.logging = { - bucket: props.loggingConfig.bucket.domainName, + bucket: (props.loggingConfig.bucket || new s3.Bucket(parent, `${name}LoggingS3Bucket`)).domainName, includeCookies: props.loggingConfig.includeCookies || false, prefix: props.loggingConfig.prefix }; diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json index 3347ce330a67e..19711b71f6048 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json @@ -3,6 +3,9 @@ "Bucket83908E77": { "Type": "AWS::S3::Bucket" }, + "AnAmazingWebsiteProbably2LoggingS3BucketB2C21612": { + "Type": "AWS::S3::Bucket" + }, "AnAmazingWebsiteProbablyCFDistribution47E3983B": { "Type": "AWS::CloudFront::Distribution", "Properties": { @@ -65,6 +68,68 @@ } } } + }, + "AnAmazingWebsiteProbably2CFDistribution7C1CCD12": { + "Type": "AWS::CloudFront::Distribution", + "Properties": { + "DistributionConfig": { + "CacheBehaviors": [], + "DefaultCacheBehavior": { + "AllowedMethods": [ + "GET", + "HEAD" + ], + "CachedMethods": [ + "GET", + "HEAD" + ], + "ForwardedValues": { + "Cookies": { + "Forward": "none" + }, + "QueryString": false + }, + "TargetOriginId": "origin1", + "ViewerProtocolPolicy": "redirect-to-https" + }, + "DefaultRootObject": "index.html", + "Enabled": true, + "HttpVersion": "http2", + "IPV6Enabled": true, + "Origins": [ + { + "CustomOriginConfig": { + "HTTPPort": 80, + "HTTPSPort": 443, + "OriginKeepaliveTimeout": 5, + "OriginProtocolPolicy": "https-only", + "OriginReadTimeout": 30, + "OriginSSLProtocols": [ + "TLSv1.2" + ] + }, + "DomainName": "brelandm.a2z.com", + "Id": "origin1", + "OriginCustomHeaders": [ + { + "HeaderName": "X-Custom-Header", + "HeaderValue": "somevalue" + } + ] + } + ], + "PriceClass": "PriceClass_100", + "ViewerCertificate": { + "CloudFrontDefaultCertificate": true + }, + "Logging": { + "Bucket": { + "Fn::GetAtt":["AnAmazingWebsiteProbably2LoggingS3BucketB2C21612","DomainName"] + }, + "IncludeCookies": false + } + } + } } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts index e2250f5d9f6b7..5c58c1e00a869 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts @@ -31,4 +31,23 @@ new cloudfront.CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', { } }); +new cloudfront.CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably2', { + originConfigs: [ + { + originHeaders: { + "X-Custom-Header": "somevalue", + }, + customOriginSource: { + domainName: "brelandm.a2z.com", + }, + behaviors: [ + { + isDefaultBehavior: true, + } + ] + } + ], + loggingConfig: {} +}); + process.stdout.write(app.run()); diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index e885e7c006c47..d3291312c3f29 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -32,7 +32,7 @@ export interface BucketRefProps { bucketName?: string; /** - * The domain name of the bucket. + * The domain name of the bucket. * * @default Inferred from bucket name */ From b8a4e14ea549b737562ab88fcb357e79d7ef39c4 Mon Sep 17 00:00:00 2001 From: Blake Price Date: Mon, 1 Oct 2018 10:02:43 -0700 Subject: [PATCH 06/10] Update default s3 bucket name --- packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts index 26723fb0c9974..531557d930528 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts @@ -635,7 +635,7 @@ export class CloudFrontWebDistribution extends cdk.Construct { if (props.loggingConfig) { distributionConfig.logging = { - bucket: (props.loggingConfig.bucket || new s3.Bucket(parent, `${name}LoggingS3Bucket`)).domainName, + bucket: (props.loggingConfig.bucket || new s3.Bucket(parent, `LoggingBucket`)).domainName, includeCookies: props.loggingConfig.includeCookies || false, prefix: props.loggingConfig.prefix }; From 1535e488ff3aa89a6861a797b7ef7f80125be46d Mon Sep 17 00:00:00 2001 From: Blake Price Date: Mon, 1 Oct 2018 11:20:18 -0700 Subject: [PATCH 07/10] Update tests --- .../test/integ.cloudfront-bucket-logging.expected.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json index 19711b71f6048..4a9b7bf9a5d4c 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json @@ -3,7 +3,7 @@ "Bucket83908E77": { "Type": "AWS::S3::Bucket" }, - "AnAmazingWebsiteProbably2LoggingS3BucketB2C21612": { + "LoggingBucket1E5A6F3B": { "Type": "AWS::S3::Bucket" }, "AnAmazingWebsiteProbablyCFDistribution47E3983B": { @@ -124,7 +124,7 @@ }, "Logging": { "Bucket": { - "Fn::GetAtt":["AnAmazingWebsiteProbably2LoggingS3BucketB2C21612","DomainName"] + "Fn::GetAtt":["LoggingBucket1E5A6F3B","DomainName"] }, "IncludeCookies": false } From bec5142f0d895887f1d65d2ef4a26120983c1894 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Mon, 1 Oct 2018 20:39:48 +0200 Subject: [PATCH 08/10] Fix parent for on-the-spot created Logging Bucket --- packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts index 531557d930528..133152bd4df0f 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts @@ -635,7 +635,7 @@ export class CloudFrontWebDistribution extends cdk.Construct { if (props.loggingConfig) { distributionConfig.logging = { - bucket: (props.loggingConfig.bucket || new s3.Bucket(parent, `LoggingBucket`)).domainName, + bucket: (props.loggingConfig.bucket || new s3.Bucket(this, `LoggingBucket`)).domainName, includeCookies: props.loggingConfig.includeCookies || false, prefix: props.loggingConfig.prefix }; From ed88a02214241c0d61fd981aafe72648b9e84bdd Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Mon, 1 Oct 2018 20:42:13 +0200 Subject: [PATCH 09/10] Assign to this.loggingBucket --- packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts index 133152bd4df0f..e2dd5bd70eaf2 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts @@ -634,8 +634,9 @@ export class CloudFrontWebDistribution extends cdk.Construct { } if (props.loggingConfig) { + this.loggingBucket = props.loggingConfig.bucket || new s3.Bucket(this, `LoggingBucket`); distributionConfig.logging = { - bucket: (props.loggingConfig.bucket || new s3.Bucket(this, `LoggingBucket`)).domainName, + bucket: this.loggingBucket.domainName, includeCookies: props.loggingConfig.includeCookies || false, prefix: props.loggingConfig.prefix }; From a1567ab7bb4a0dd16036856db7057215a2b0602a Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Tue, 2 Oct 2018 11:10:44 +0200 Subject: [PATCH 10/10] Update test expectation --- ...eg.cloudfront-bucket-logging.expected.json | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json index 4a9b7bf9a5d4c..286eaf976517e 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.expected.json @@ -3,9 +3,6 @@ "Bucket83908E77": { "Type": "AWS::S3::Bucket" }, - "LoggingBucket1E5A6F3B": { - "Type": "AWS::S3::Bucket" - }, "AnAmazingWebsiteProbablyCFDistribution47E3983B": { "Type": "AWS::CloudFront::Distribution", "Properties": { @@ -33,6 +30,16 @@ "Enabled": true, "HttpVersion": "http2", "IPV6Enabled": true, + "Logging": { + "Bucket": { + "Fn::GetAtt": [ + "Bucket83908E77", + "DomainName" + ] + }, + "IncludeCookies": true, + "Prefix": "test-prefix" + }, "Origins": [ { "CustomOriginConfig": { @@ -58,17 +65,13 @@ "PriceClass": "PriceClass_100", "ViewerCertificate": { "CloudFrontDefaultCertificate": true - }, - "Logging": { - "Bucket": { - "Fn::GetAtt":["Bucket83908E77","DomainName"] - }, - "IncludeCookies": true, - "Prefix": "test-prefix" } } } }, + "AnAmazingWebsiteProbably2LoggingBucket222F7CE9": { + "Type": "AWS::S3::Bucket" + }, "AnAmazingWebsiteProbably2CFDistribution7C1CCD12": { "Type": "AWS::CloudFront::Distribution", "Properties": { @@ -96,6 +99,15 @@ "Enabled": true, "HttpVersion": "http2", "IPV6Enabled": true, + "Logging": { + "Bucket": { + "Fn::GetAtt": [ + "AnAmazingWebsiteProbably2LoggingBucket222F7CE9", + "DomainName" + ] + }, + "IncludeCookies": false + }, "Origins": [ { "CustomOriginConfig": { @@ -121,15 +133,9 @@ "PriceClass": "PriceClass_100", "ViewerCertificate": { "CloudFrontDefaultCertificate": true - }, - "Logging": { - "Bucket": { - "Fn::GetAtt":["LoggingBucket1E5A6F3B","DomainName"] - }, - "IncludeCookies": false } } } } } -} \ No newline at end of file +}