From 1a30272c8bd99a919bde695b5b1b1f5cb458cb64 Mon Sep 17 00:00:00 2001 From: OksanaH <34384274+OksanaH@users.noreply.github.com> Date: Mon, 12 Apr 2021 12:39:22 +0100 Subject: [PATCH 01/11] feat(elasticloadbalancing): rename 'sslCertificateId' property of LB listener to 'sslCertificateArn'; deprecate sslCertificateId property (#13766) The property `sslCertificateId` of the LoadBalancer listener actually means sslCertificateArn. So as suggested in #9303, I have deprecated `sslCertificateId` and replaced it by `sslCertificateArn` to better reflect its actual meaning. fixes #9303 --- .../lib/load-balancer.ts | 16 ++- .../test/loadbalancer.test.ts | 103 +++++++++++++++--- 2 files changed, 102 insertions(+), 17 deletions(-) diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts index eaed2daee58d2..d60d91e0a9a51 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts @@ -187,10 +187,18 @@ export interface LoadBalancerListener { readonly policyNames?: string[]; /** - * ID of SSL certificate + * the ARN of the SSL certificate + * @deprecated - use sslCertificateArn instead */ readonly sslCertificateId?: string; + /** + * the ARN of the SSL certificate + * + * @default - none + */ + readonly sslCertificateArn?: string; + /** * Allow connections to the load balancer from the given set of connection peers * @@ -264,8 +272,12 @@ export class LoadBalancer extends Resource implements IConnectable { * @returns A ListenerPort object that controls connections to the listener port */ public addListener(listener: LoadBalancerListener): ListenerPort { + if (listener.sslCertificateArn && listener.sslCertificateId) { + throw new Error('"sslCertificateId" is deprecated, please use "sslCertificateArn" only.'); + } const protocol = ifUndefinedLazy(listener.externalProtocol, () => wellKnownProtocol(listener.externalPort)); const instancePort = listener.internalPort || listener.externalPort; + const sslCertificateArn = listener.sslCertificateArn || listener.sslCertificateId; const instanceProtocol = ifUndefined(listener.internalProtocol, ifUndefined(tryWellKnownProtocol(instancePort), isHttpProtocol(protocol) ? LoadBalancingProtocol.HTTP : LoadBalancingProtocol.TCP)); @@ -275,7 +287,7 @@ export class LoadBalancer extends Resource implements IConnectable { protocol, instancePort: instancePort.toString(), instanceProtocol, - sslCertificateId: listener.sslCertificateId, + sslCertificateId: sslCertificateArn, policyNames: listener.policyNames, }); diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/test/loadbalancer.test.ts b/packages/@aws-cdk/aws-elasticloadbalancing/test/loadbalancer.test.ts index 60bf1ee3632bb..9cac87e057e87 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/test/loadbalancer.test.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancing/test/loadbalancer.test.ts @@ -1,4 +1,4 @@ -import { expect, haveResource } from '@aws-cdk/assert-internal'; +import '@aws-cdk/assert-internal/jest'; import { Connections, Peer, SubnetType, Vpc } from '@aws-cdk/aws-ec2'; import { Duration, Stack } from '@aws-cdk/core'; import { ILoadBalancerTarget, LoadBalancer, LoadBalancingProtocol } from '../lib'; @@ -18,14 +18,14 @@ describe('tests', () => { internalPort: 8080, }); - expect(stack).to(haveResource('AWS::ElasticLoadBalancing::LoadBalancer', { + expect(stack).toHaveResource('AWS::ElasticLoadBalancing::LoadBalancer', { Listeners: [{ InstancePort: '8080', InstanceProtocol: 'http', LoadBalancerPort: '8080', Protocol: 'http', }], - })); + }); }); test('add a health check', () => { @@ -45,7 +45,7 @@ describe('tests', () => { }); // THEN - expect(stack).to(haveResource('AWS::ElasticLoadBalancing::LoadBalancer', { + expect(stack).toHaveResource('AWS::ElasticLoadBalancing::LoadBalancer', { HealthCheck: { HealthyThreshold: '2', Interval: '60', @@ -53,7 +53,7 @@ describe('tests', () => { Timeout: '5', UnhealthyThreshold: '5', }, - })); + }); }); test('add a listener and load balancing target', () => { @@ -75,7 +75,7 @@ describe('tests', () => { elb.addTarget(new FakeTarget()); // THEN: at the very least it added a security group rule for the backend - expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { + expect(stack).toHaveResource('AWS::EC2::SecurityGroup', { SecurityGroupEgress: [ { Description: 'Port 8080 LB to fleet', @@ -85,7 +85,7 @@ describe('tests', () => { ToPort: 8080, }, ], - })); + }); }); test('enable cross zone load balancing', () => { @@ -100,9 +100,9 @@ describe('tests', () => { }); // THEN - expect(stack).to(haveResource('AWS::ElasticLoadBalancing::LoadBalancer', { + expect(stack).toHaveResource('AWS::ElasticLoadBalancing::LoadBalancer', { CrossZone: true, - })); + }); }); test('disable cross zone load balancing', () => { @@ -117,9 +117,9 @@ describe('tests', () => { }); // THEN - expect(stack).to(haveResource('AWS::ElasticLoadBalancing::LoadBalancer', { + expect(stack).toHaveResource('AWS::ElasticLoadBalancing::LoadBalancer', { CrossZone: false, - })); + }); }); test('cross zone load balancing enabled by default', () => { @@ -133,9 +133,9 @@ describe('tests', () => { }); // THEN - expect(stack).to(haveResource('AWS::ElasticLoadBalancing::LoadBalancer', { + expect(stack).toHaveResource('AWS::ElasticLoadBalancing::LoadBalancer', { CrossZone: true, - })); + }); }); test('use specified subnet', () => { @@ -170,11 +170,84 @@ describe('tests', () => { }); // THEN - expect(stack).to(haveResource('AWS::ElasticLoadBalancing::LoadBalancer', { + expect(stack).toHaveResource('AWS::ElasticLoadBalancing::LoadBalancer', { Subnets: vpc.selectSubnets({ subnetGroupName: 'private1', }).subnetIds.map((subnetId: string) => stack.resolve(subnetId)), - })); + }); + }); + + test('does not fail when deprecated property sslCertificateId is used', () => { + // GIVEN + const sslCertificateArn = 'arn:aws:acm:us-east-1:12345:test/12345'; + const stack = new Stack(); + const vpc = new Vpc(stack, 'VCP'); + + // WHEN + const lb = new LoadBalancer(stack, 'LB', { vpc }); + + lb.addListener({ + externalPort: 80, + internalPort: 8080, + sslCertificateId: sslCertificateArn, + }); + + // THEN + expect(stack).toHaveResource('AWS::ElasticLoadBalancing::LoadBalancer', { + Listeners: [{ + InstancePort: '8080', + InstanceProtocol: 'http', + LoadBalancerPort: '80', + Protocol: 'http', + SSLCertificateId: sslCertificateArn, + }], + }); + }); + + test('does not fail when sslCertificateArn is used', () => { + // GIVEN + const sslCertificateArn = 'arn:aws:acm:us-east-1:12345:test/12345'; + const stack = new Stack(); + const vpc = new Vpc(stack, 'VCP'); + + // WHEN + const lb = new LoadBalancer(stack, 'LB', { vpc }); + + lb.addListener({ + externalPort: 80, + internalPort: 8080, + sslCertificateArn: sslCertificateArn, + }); + + // THEN + expect(stack).toHaveResource('AWS::ElasticLoadBalancing::LoadBalancer', { + Listeners: [{ + InstancePort: '8080', + InstanceProtocol: 'http', + LoadBalancerPort: '80', + Protocol: 'http', + SSLCertificateId: sslCertificateArn, + }], + }); + }); + + test('throws error when both sslCertificateId and sslCertificateArn are used', () => { + // GIVEN + const sslCertificateArn = 'arn:aws:acm:us-east-1:12345:test/12345'; + const stack = new Stack(); + const vpc = new Vpc(stack, 'VCP'); + + // WHEN + const lb = new LoadBalancer(stack, 'LB', { vpc }); + + // THEN + expect(() => + lb.addListener({ + externalPort: 80, + internalPort: 8080, + sslCertificateArn: sslCertificateArn, + sslCertificateId: sslCertificateArn, + })).toThrow(/"sslCertificateId" is deprecated, please use "sslCertificateArn" only./); }); }); From d9546b765fae937eb49577f4915d8db756e5c264 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Mon, 12 Apr 2021 15:35:22 +0200 Subject: [PATCH 02/11] chore: jest config inheritance should use package resolution, not filesystem paths (#14105) Packages should not rely on the file system locations of other packages in the source repository, just on the contract that is established by the package manager (i.e., NPM or Yarn will create symlinks that allow you to `require()` declared dependencies). Doing otherwise is the death of hermetic builds. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-certificatemanager/jest.config.js | 2 +- packages/@aws-cdk/aws-ecs/jest.config.js | 4 ++-- packages/@aws-cdk/aws-glue/jest.config.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/aws-certificatemanager/jest.config.js b/packages/@aws-cdk/aws-certificatemanager/jest.config.js index cd664e1d069e5..54e28beb9798b 100644 --- a/packages/@aws-cdk/aws-certificatemanager/jest.config.js +++ b/packages/@aws-cdk/aws-certificatemanager/jest.config.js @@ -1,2 +1,2 @@ -const baseConfig = require('../../../tools/cdk-build-tools/config/jest.config'); +const baseConfig = require('cdk-build-tools/config/jest.config'); module.exports = baseConfig; diff --git a/packages/@aws-cdk/aws-ecs/jest.config.js b/packages/@aws-cdk/aws-ecs/jest.config.js index f5d5c4c8ad18f..54e28beb9798b 100644 --- a/packages/@aws-cdk/aws-ecs/jest.config.js +++ b/packages/@aws-cdk/aws-ecs/jest.config.js @@ -1,2 +1,2 @@ -const baseConfig = require('../../../tools/cdk-build-tools/config/jest.config'); -module.exports = baseConfig; \ No newline at end of file +const baseConfig = require('cdk-build-tools/config/jest.config'); +module.exports = baseConfig; diff --git a/packages/@aws-cdk/aws-glue/jest.config.js b/packages/@aws-cdk/aws-glue/jest.config.js index cd664e1d069e5..54e28beb9798b 100644 --- a/packages/@aws-cdk/aws-glue/jest.config.js +++ b/packages/@aws-cdk/aws-glue/jest.config.js @@ -1,2 +1,2 @@ -const baseConfig = require('../../../tools/cdk-build-tools/config/jest.config'); +const baseConfig = require('cdk-build-tools/config/jest.config'); module.exports = baseConfig; From 5cf56fb8b3bbb805d0963be2b7fed8116511df13 Mon Sep 17 00:00:00 2001 From: Adam Ruka Date: Mon, 12 Apr 2021 07:07:56 -0700 Subject: [PATCH 03/11] chore(cli): make the "new" bootstrapping the default in V2 (#13918) Make the "new" bootstrapping (that adds additional resources beyond the S3 bucket to the template, like an ECR repository, and IAM roles) the default. Allow using the "old" bootstrapping by setting the `CDK_LEGACY_BOOTSTRAP` environment variable. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk/bin/cdk.ts | 61 +++++++++++++------ .../test/integ/cli/bootstrapping.integtest.ts | 8 ++- 2 files changed, 49 insertions(+), 20 deletions(-) diff --git a/packages/aws-cdk/bin/cdk.ts b/packages/aws-cdk/bin/cdk.ts index 9dc3a71799457..85ebcc00e821c 100644 --- a/packages/aws-cdk/bin/cdk.ts +++ b/packages/aws-cdk/bin/cdk.ts @@ -256,24 +256,7 @@ async function initCommandLine() { }); case 'bootstrap': - // Use new bootstrapping if it's requested via environment variable, or if - // new style stack synthesis has been configured in `cdk.json`. - // - // In code it's optimistically called "default" bootstrapping but that is in - // anticipation of flipping the switch, in user messaging we still call it - // "new" bootstrapping. - let source: BootstrapSource = { source: 'legacy' }; - const newStyleStackSynthesis = isFeatureEnabled(configuration, cxapi.NEW_STYLE_STACK_SYNTHESIS_CONTEXT); - if (args.template) { - print(`Using bootstrapping template from ${args.template}`); - source = { source: 'custom', templateFile: args.template }; - } else if (process.env.CDK_NEW_BOOTSTRAP) { - print('CDK_NEW_BOOTSTRAP set, using new-style bootstrapping'); - source = { source: 'default' }; - } else if (newStyleStackSynthesis) { - print(`'${cxapi.NEW_STYLE_STACK_SYNTHESIS_CONTEXT}' context set, using new-style bootstrapping`); - source = { source: 'default' }; - } + const source: BootstrapSource = determineBootsrapVersion(args, configuration); const bootstrapper = new Bootstrapper(source); @@ -361,6 +344,48 @@ async function initCommandLine() { } } +/** + * Determine which version of bootstrapping + * (legacy, or "new") should be used. + */ +function determineBootsrapVersion(args: { template?: string }, configuration: Configuration): BootstrapSource { + const isV1 = version.DISPLAY_VERSION.startsWith('1.'); + return isV1 ? determineV1BootstrapSource(args, configuration) : determineV2BootstrapSource(args); +} + +function determineV1BootstrapSource(args: { template?: string }, configuration: Configuration): BootstrapSource { + let source: BootstrapSource; + if (args.template) { + print(`Using bootstrapping template from ${args.template}`); + source = { source: 'custom', templateFile: args.template }; + } else if (process.env.CDK_NEW_BOOTSTRAP) { + print('CDK_NEW_BOOTSTRAP set, using new-style bootstrapping'); + source = { source: 'default' }; + } else if (isFeatureEnabled(configuration, cxapi.NEW_STYLE_STACK_SYNTHESIS_CONTEXT)) { + print(`'${cxapi.NEW_STYLE_STACK_SYNTHESIS_CONTEXT}' context set, using new-style bootstrapping`); + source = { source: 'default' }; + } else { + // in V1, the "legacy" bootstrapping is the default + source = { source: 'legacy' }; + } + return source; +} + +function determineV2BootstrapSource(args: { template?: string }): BootstrapSource { + let source: BootstrapSource; + if (args.template) { + print(`Using bootstrapping template from ${args.template}`); + source = { source: 'custom', templateFile: args.template }; + } else if (process.env.CDK_LEGACY_BOOTSTRAP) { + print('CDK_LEGACY_BOOTSTRAP set, using legacy-style bootstrapping'); + source = { source: 'legacy' }; + } else { + // in V2, the "new" bootstrapping is the default + source = { source: 'default' }; + } + return source; +} + function isFeatureEnabled(configuration: Configuration, featureFlag: string) { return configuration.context.get(featureFlag) ?? cxapi.futureFlagDefault(featureFlag); } diff --git a/packages/aws-cdk/test/integ/cli/bootstrapping.integtest.ts b/packages/aws-cdk/test/integ/cli/bootstrapping.integtest.ts index c6ba2e53ec2d8..46688943d803a 100644 --- a/packages/aws-cdk/test/integ/cli/bootstrapping.integtest.ts +++ b/packages/aws-cdk/test/integ/cli/bootstrapping.integtest.ts @@ -30,7 +30,11 @@ integTest('upgrade legacy bootstrap stack to new bootstrap stack while in use', // Legacy bootstrap await fixture.cdk(['bootstrap', '--toolkit-stack-name', bootstrapStackName, - '--bootstrap-bucket-name', legacyBootstrapBucketName]); + '--bootstrap-bucket-name', legacyBootstrapBucketName], { + modEnv: { + CDK_LEGACY_BOOTSTRAP: '1', + }, + }); // Deploy stack that uses file assets await fixture.cdkDeploy('lambda', { @@ -266,4 +270,4 @@ integTest('can deploy modern-synthesized stack even if bootstrap stack name is u '--context', '@aws-cdk/core:newStyleStackSynthesis=1', ], }); -})); \ No newline at end of file +})); From 708f23e78fb0eff2aa17593c530500eb0b94067a Mon Sep 17 00:00:00 2001 From: Christian Moore Date: Mon, 12 Apr 2021 17:25:57 -0400 Subject: [PATCH 04/11] fix(fsx): Weekday.SUNDAY incorrectly evaluates to 0 (should be 7) (#14081) fixes #14080 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts | 4 ++-- packages/@aws-cdk/aws-fsx/lib/maintenance-time.ts | 10 +++++----- .../@aws-cdk/aws-fsx/test/lustre-file-system.test.ts | 2 +- .../@aws-cdk/aws-fsx/test/maintenance-time.test.ts | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts b/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts index 2206bb31dfad3..b88b3e99ac081 100644 --- a/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts +++ b/packages/@aws-cdk/aws-fsx/lib/lustre-file-system.ts @@ -73,8 +73,8 @@ export interface LustreConfiguration { readonly perUnitStorageThroughput?: number; /** - * The preferred day and time to perform weekly maintenance. The first digit is the day of the week, starting at 0 - * for Sunday, then the following are hours and minutes in the UTC time zone, 24 hour clock. For example: '2:20:30' + * The preferred day and time to perform weekly maintenance. The first digit is the day of the week, starting at 1 + * for Monday, then the following are hours and minutes in the UTC time zone, 24 hour clock. For example: '2:20:30' * is Tuesdays at 20:30. * * @default - no preference diff --git a/packages/@aws-cdk/aws-fsx/lib/maintenance-time.ts b/packages/@aws-cdk/aws-fsx/lib/maintenance-time.ts index d9e06de3d0266..57c2da79379b4 100644 --- a/packages/@aws-cdk/aws-fsx/lib/maintenance-time.ts +++ b/packages/@aws-cdk/aws-fsx/lib/maintenance-time.ts @@ -2,10 +2,6 @@ * Enum for representing all the days of the week */ export enum Weekday { - /** - * Sunday - */ - SUNDAY = '0', /** * Monday */ @@ -29,7 +25,11 @@ export enum Weekday { /** * Saturday */ - SATURDAY = '6' + SATURDAY = '6', + /** + * Sunday + */ + SUNDAY = '7' } /** diff --git a/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts b/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts index 2236a15a3ea2d..ad4c4462d8c58 100644 --- a/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts +++ b/packages/@aws-cdk/aws-fsx/test/lustre-file-system.test.ts @@ -121,7 +121,7 @@ describe('FSx for Lustre File System', () => { expectCDK(stack).to(haveResource('AWS::FSx::FileSystem', { LustreConfiguration: { DeploymentType: 'SCRATCH_2', - WeeklyMaintenanceStartTime: '0:12:34', + WeeklyMaintenanceStartTime: '7:12:34', }, })); expectCDK(stack).to(haveResource('AWS::EC2::SecurityGroup')); diff --git a/packages/@aws-cdk/aws-fsx/test/maintenance-time.test.ts b/packages/@aws-cdk/aws-fsx/test/maintenance-time.test.ts index 8ea63ccacd050..9a92e6041085b 100644 --- a/packages/@aws-cdk/aws-fsx/test/maintenance-time.test.ts +++ b/packages/@aws-cdk/aws-fsx/test/maintenance-time.test.ts @@ -2,10 +2,10 @@ import { strictEqual } from 'assert'; import { LustreMaintenanceTime, Weekday } from '../lib'; test.each([ - [Weekday.SUNDAY, 0, 0, '0:00:00'], + [Weekday.SUNDAY, 0, 0, '7:00:00'], [Weekday.SATURDAY, 0, 0, '6:00:00'], - [Weekday.SUNDAY, 24, 0, '0:24:00'], - [Weekday.SUNDAY, 0, 59, '0:00:59'], + [Weekday.SUNDAY, 24, 0, '7:24:00'], + [Weekday.SUNDAY, 0, 59, '7:00:59'], ])('valid maintenance time %s:%d:%d returns %s', (day: Weekday, hour: number, minute: number, expected: string) => { strictEqual( new LustreMaintenanceTime({ day, hour, minute }).toTimestamp(), From e6c85e4167cdb38ed056eda17b869e179a6dd1c5 Mon Sep 17 00:00:00 2001 From: greg-aws <82007043+greg-aws@users.noreply.github.com> Date: Mon, 12 Apr 2021 18:29:07 -0400 Subject: [PATCH 05/11] fix(aws-ecs-patterns): fixes #11123 allow for https listeners to use non Route 53 DNS if a certificate is provided (#14004) Currently this construct requires a Route53 domain even if a certificate is provided to it. A domain should only be required if a DNS validated certificate is being created or Route53 records sets are being created. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../application-load-balanced-service-base.ts | 7 ++-- .../test.load-balanced-fargate-service.ts | 35 +++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts index 2593853cd0350..2a2c8feb23d7a 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/application-load-balanced-service-base.ts @@ -422,13 +422,14 @@ export abstract class ApplicationLoadBalancedServiceBase extends CoreConstruct { this.targetGroup = this.listener.addTargets('ECS', targetProps); if (protocol === ApplicationProtocol.HTTPS) { - if (typeof props.domainName === 'undefined' || typeof props.domainZone === 'undefined') { - throw new Error('A domain name and zone is required when using the HTTPS protocol'); - } if (props.certificate !== undefined) { this.certificate = props.certificate; } else { + if (typeof props.domainName === 'undefined' || typeof props.domainZone === 'undefined') { + throw new Error('A domain name and zone is required when using the HTTPS protocol'); + } + this.certificate = new Certificate(this, 'Certificate', { domainName: props.domainName, validation: CertificateValidation.fromDns(props.domainZone), diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service.ts index 8d204485eb125..a8c588d1187ef 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service.ts @@ -1,4 +1,5 @@ import { expect, haveResource, haveResourceLike, SynthUtils } from '@aws-cdk/assert-internal'; +import { DnsValidatedCertificate } from '@aws-cdk/aws-certificatemanager'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as ecs from '@aws-cdk/aws-ecs'; import { ApplicationLoadBalancer, ApplicationProtocol, NetworkLoadBalancer } from '@aws-cdk/aws-elasticloadbalancingv2'; @@ -977,4 +978,38 @@ export = { test.done(); }, + 'domainName and domainZone not required for HTTPS listener with provided cert'(test: Test) { + // GIVEN + const stack = new cdk.Stack(); + const vpc = new ec2.Vpc(stack, 'VPC'); + const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); + const exampleDotComZone = new route53.PublicHostedZone(stack, 'ExampleDotCom', { + zoneName: 'example.com', + }); + const certificate = new DnsValidatedCertificate(stack, 'Certificate', { + domainName: 'test.example.com', + hostedZone: exampleDotComZone, + }); + + // WHEN + new ecsPatterns.ApplicationLoadBalancedFargateService(stack, 'FargateAlbService', { + cluster, + protocol: ApplicationProtocol.HTTPS, + + taskImageOptions: { + containerPort: 2015, + image: ecs.ContainerImage.fromRegistry('abiosoft/caddy'), + }, + certificate: certificate, + }); + + // THEN + expect(stack).notTo(haveResourceLike('AWS::Route53::RecordSet', { + Name: 'test.domain.com.', + })); + + test.done(); + + }, + }; From 111d26a30d220a319bbb7b1b1696aafac865e009 Mon Sep 17 00:00:00 2001 From: Adam Ruka Date: Tue, 13 Apr 2021 01:06:57 -0700 Subject: [PATCH 06/11] fix(cfn-include): allow deploy-time values in Parameter substitutions in Fn::Sub expressions (#14068) When a Token that resolved to an object, like `{ Ref }`, was passed as the value to be substituted for a CloudFormation Parameter, and that Parameter was used in an Fn::Sub expression, it caused incorrect CloudFormation to be generated (an Fn::Join as an argument to Fn::Sub, which is not allowed). Check for that case explicitly, and move that substitution into the Fn::Sub map instead. Fixes #14047 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../test/test-templates/fn-sub-map-empty.json | 12 ++ .../test/valid-templates.test.ts | 46 ++++++++ packages/@aws-cdk/core/lib/cfn-parse.ts | 108 +++++++++++------- 3 files changed, 124 insertions(+), 42 deletions(-) create mode 100644 packages/@aws-cdk/cloudformation-include/test/test-templates/fn-sub-map-empty.json diff --git a/packages/@aws-cdk/cloudformation-include/test/test-templates/fn-sub-map-empty.json b/packages/@aws-cdk/cloudformation-include/test/test-templates/fn-sub-map-empty.json new file mode 100644 index 0000000000000..07def731df41f --- /dev/null +++ b/packages/@aws-cdk/cloudformation-include/test/test-templates/fn-sub-map-empty.json @@ -0,0 +1,12 @@ +{ + "Resources": { + "Bucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Fn::Sub": ["my-bucket", {}] + } + } + } + } +} diff --git a/packages/@aws-cdk/cloudformation-include/test/valid-templates.test.ts b/packages/@aws-cdk/cloudformation-include/test/valid-templates.test.ts index 3c211c5d476da..0741b7f9d23df 100644 --- a/packages/@aws-cdk/cloudformation-include/test/valid-templates.test.ts +++ b/packages/@aws-cdk/cloudformation-include/test/valid-templates.test.ts @@ -273,6 +273,14 @@ describe('CDK Include', () => { ); }); + test('preserves an empty map passed to Fn::Sub', () => { + includeTestTemplate(stack, 'fn-sub-map-empty.json'); + + expect(stack).toMatchTemplate( + loadTestFileToJsObject('fn-sub-map-empty.json'), + ); + }); + test('can ingest a template with Fn::Sub shadowing a logical ID from the template and output it unchanged', () => { includeTestTemplate(stack, 'fn-sub-shadow.json'); @@ -326,6 +334,44 @@ describe('CDK Include', () => { ); }); + test('when a parameter in an Fn::Sub expression is substituted with a deploy-time value, it adds a new key to the Fn::Sub map', () => { + const parameter = new core.CfnParameter(stack, 'AnotherParam'); + includeTestTemplate(stack, 'fn-sub-parameters.json', { + parameters: { + 'MyParam': `it's_a_${parameter.valueAsString}_concatenation`, + }, + }); + + expect(stack).toMatchTemplate({ + "Parameters": { + "AnotherParam": { + "Type": "String", + }, + }, + "Resources": { + "Bucket": { + "Type": "AWS::S3::Bucket", + "Properties": { + "BucketName": { + "Fn::Sub": [ + "${MyParam}", + { + "MyParam": { + "Fn::Join": ["", [ + "it's_a_", + { "Ref": "AnotherParam" }, + "_concatenation", + ]], + }, + }, + ], + }, + }, + }, + }, + }); + }); + test('can ingest a template with a Ref expression for an array value, and output it unchanged', () => { includeTestTemplate(stack, 'ref-array-property.json'); diff --git a/packages/@aws-cdk/core/lib/cfn-parse.ts b/packages/@aws-cdk/core/lib/cfn-parse.ts index 8f5d820584d98..4ed1714a2c152 100644 --- a/packages/@aws-cdk/core/lib/cfn-parse.ts +++ b/packages/@aws-cdk/core/lib/cfn-parse.ts @@ -648,7 +648,7 @@ export class CfnParser { map = value[1]; } - return Fn.sub(this.parseFnSubString(fnSubString, map), map); + return this.parseFnSubString(fnSubString, map); } case 'Condition': { // a reference to a Condition from another Condition @@ -682,48 +682,72 @@ export class CfnParser { : undefined; } - private parseFnSubString(value: string, map: { [key: string]: any } = {}): string { - const leftBrace = value.indexOf('${'); - const rightBrace = value.indexOf('}') + 1; - // don't include left and right braces when searching for the target of the reference - if (leftBrace === -1 || leftBrace >= rightBrace) { - return value; - } - - const leftHalf = value.substring(0, leftBrace); - const rightHalf = value.substring(rightBrace); - const refTarget = value.substring(leftBrace + 2, rightBrace - 1).trim(); - if (refTarget[0] === '!') { - return value.substring(0, rightBrace) + this.parseFnSubString(rightHalf, map); - } - - // lookup in map - if (refTarget in map) { - return leftHalf + '${' + refTarget + '}' + this.parseFnSubString(rightHalf, map); - } - - // since it's not in the map, check if it's a pseudo parameter - const specialRef = this.specialCaseSubRefs(refTarget); - if (specialRef !== undefined) { - return leftHalf + specialRef + this.parseFnSubString(rightHalf, map); - } + private parseFnSubString(templateString: string, expressionMap: { [key: string]: any } | undefined): string { + const map = expressionMap ?? {}; + const self = this; + return Fn.sub(go(templateString), Object.keys(map).length === 0 ? expressionMap : map); + + function go(value: string): string { + const leftBrace = value.indexOf('${'); + const rightBrace = value.indexOf('}') + 1; + // don't include left and right braces when searching for the target of the reference + if (leftBrace === -1 || leftBrace >= rightBrace) { + return value; + } + + const leftHalf = value.substring(0, leftBrace); + const rightHalf = value.substring(rightBrace); + const refTarget = value.substring(leftBrace + 2, rightBrace - 1).trim(); + if (refTarget[0] === '!') { + return value.substring(0, rightBrace) + go(rightHalf); + } + + // lookup in map + if (refTarget in map) { + return leftHalf + '${' + refTarget + '}' + go(rightHalf); + } + + // since it's not in the map, check if it's a pseudo-parameter + // (or a value to be substituted for a Parameter, provided by the customer) + const specialRef = self.specialCaseSubRefs(refTarget); + if (specialRef !== undefined) { + if (Token.isUnresolved(specialRef)) { + // specialRef can only be a Token if the value passed by the customer + // for substituting a Parameter was a Token. + // This is actually bad here, + // because the Token can potentially be something that doesn't render + // well inside an Fn::Sub template string, like a { Ref } object. + // To handle this case, + // instead of substituting the Parameter directly with the token in the template string, + // add a new entry to the Fn::Sub map, + // with key refTarget, and the token as the value. + // This is safe, because this sort of shadowing is legal in CloudFormation, + // and also because we're certain the Fn::Sub map doesn't contain an entry for refTarget + // (as we check that condition in the code right above this). + map[refTarget] = specialRef; + return leftHalf + '${' + refTarget + '}' + go(rightHalf); + } else { + return leftHalf + specialRef + go(rightHalf); + } + } - const dotIndex = refTarget.indexOf('.'); - const isRef = dotIndex === -1; - if (isRef) { - const refElement = this.finder.findRefTarget(refTarget); - if (!refElement) { - throw new Error(`Element referenced in Fn::Sub expression with logical ID: '${refTarget}' was not found in the template`); - } - return leftHalf + CfnReference.for(refElement, 'Ref', ReferenceRendering.FN_SUB).toString() + this.parseFnSubString(rightHalf, map); - } else { - const targetId = refTarget.substring(0, dotIndex); - const refResource = this.finder.findResource(targetId); - if (!refResource) { - throw new Error(`Resource referenced in Fn::Sub expression with logical ID: '${targetId}' was not found in the template`); - } - const attribute = refTarget.substring(dotIndex + 1); - return leftHalf + CfnReference.for(refResource, attribute, ReferenceRendering.FN_SUB).toString() + this.parseFnSubString(rightHalf, map); + const dotIndex = refTarget.indexOf('.'); + const isRef = dotIndex === -1; + if (isRef) { + const refElement = self.finder.findRefTarget(refTarget); + if (!refElement) { + throw new Error(`Element referenced in Fn::Sub expression with logical ID: '${refTarget}' was not found in the template`); + } + return leftHalf + CfnReference.for(refElement, 'Ref', ReferenceRendering.FN_SUB).toString() + go(rightHalf); + } else { + const targetId = refTarget.substring(0, dotIndex); + const refResource = self.finder.findResource(targetId); + if (!refResource) { + throw new Error(`Resource referenced in Fn::Sub expression with logical ID: '${targetId}' was not found in the template`); + } + const attribute = refTarget.substring(dotIndex + 1); + return leftHalf + CfnReference.for(refResource, attribute, ReferenceRendering.FN_SUB).toString() + go(rightHalf); + } } } From 9042bf7b32465e28337abaeb967a75d58a9b50ca Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Mon, 12 Apr 2021 23:41:34 -1000 Subject: [PATCH 07/11] chore: npm-check-updates && yarn upgrade (#14134) Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date. --- package.json | 6 +- .../package.json | 2 +- .../@aws-cdk/aws-cloudformation/package.json | 2 +- .../aws-global-table-coordinator/package.json | 2 +- .../@aws-cdk/aws-lambda-nodejs/package.json | 2 +- packages/@aws-cdk/aws-lambda/package.json | 2 +- .../@aws-cdk/custom-resources/package.json | 2 +- packages/awslint/package.json | 4 +- packages/cdk-dasm/package.json | 2 +- packages/decdk/package.json | 4 +- tools/cdk-build-tools/package.json | 12 +- tools/cfn2ts/package.json | 2 +- tools/eslint-plugin-cdk/package.json | 6 +- yarn.lock | 206 +++++++++--------- 14 files changed, 127 insertions(+), 127 deletions(-) diff --git a/package.json b/package.json index bcc83bf7f0957..c6bde8dfa25ed 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,9 @@ "fs-extra": "^9.1.0", "graceful-fs": "^4.2.6", "jest-junit": "^12.0.0", - "jsii-diff": "^1.27.0", - "jsii-pacmak": "^1.27.0", - "jsii-rosetta": "^1.27.0", + "jsii-diff": "^1.27.1", + "jsii-pacmak": "^1.27.1", + "jsii-rosetta": "^1.27.1", "lerna": "^4.0.0", "standard-version": "^9.2.0", "typescript": "~3.9.9" diff --git a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json index fd561b065d25e..a73a32e430540 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json +++ b/packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json @@ -29,7 +29,7 @@ "devDependencies": { "aws-sdk": "^2.596.0", "aws-sdk-mock": "^5.1.0", - "eslint": "^7.23.0", + "eslint": "^7.24.0", "eslint-config-standard": "^14.1.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", diff --git a/packages/@aws-cdk/aws-cloudformation/package.json b/packages/@aws-cdk/aws-cloudformation/package.json index c75595f815d31..c9d816c42a815 100644 --- a/packages/@aws-cdk/aws-cloudformation/package.json +++ b/packages/@aws-cdk/aws-cloudformation/package.json @@ -72,7 +72,7 @@ "@aws-cdk/aws-sns-subscriptions": "0.0.0", "@aws-cdk/aws-sqs": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", - "@types/aws-lambda": "^8.10.73", + "@types/aws-lambda": "^8.10.75", "@types/nodeunit": "^0.0.31", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", diff --git a/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json b/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json index d67e31884cd8a..540b1f6ea76a7 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json +++ b/packages/@aws-cdk/aws-dynamodb-global/lambda-packages/aws-global-table-coordinator/package.json @@ -29,7 +29,7 @@ "devDependencies": { "aws-sdk": "^2.596.0", "aws-sdk-mock": "^5.1.0", - "eslint": "^7.23.0", + "eslint": "^7.24.0", "eslint-config-standard": "^14.1.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 7e7fead742103..4e05e42b8f631 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -66,7 +66,7 @@ "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "delay": "5.0.0", - "esbuild": "^0.11.6", + "esbuild": "^0.11.9", "pkglint": "0.0.0", "@aws-cdk/assert-internal": "0.0.0" }, diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index 94ae195c4bc1b..d8ae716e37fff 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -75,7 +75,7 @@ }, "license": "Apache-2.0", "devDependencies": { - "@types/aws-lambda": "^8.10.73", + "@types/aws-lambda": "^8.10.75", "@types/lodash": "^4.14.168", "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index 3f3a64a859998..26299f67a8f16 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -74,7 +74,7 @@ "@aws-cdk/aws-events": "0.0.0", "@aws-cdk/aws-s3": "0.0.0", "@aws-cdk/aws-ssm": "0.0.0", - "@types/aws-lambda": "^8.10.73", + "@types/aws-lambda": "^8.10.75", "@types/fs-extra": "^8.1.1", "@types/sinon": "^9.0.11", "aws-sdk": "^2.848.0", diff --git a/packages/awslint/package.json b/packages/awslint/package.json index 0160949c63e04..6915867813ec2 100644 --- a/packages/awslint/package.json +++ b/packages/awslint/package.json @@ -16,11 +16,11 @@ "awslint": "bin/awslint" }, "dependencies": { - "@jsii/spec": "^1.27.0", + "@jsii/spec": "^1.27.1", "camelcase": "^6.2.0", "colors": "^1.4.0", "fs-extra": "^9.1.0", - "jsii-reflect": "^1.27.0", + "jsii-reflect": "^1.27.1", "yargs": "^16.2.0" }, "devDependencies": { diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index 6ca3c52326c49..23e5bda09d65d 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -26,7 +26,7 @@ }, "license": "Apache-2.0", "dependencies": { - "codemaker": "^1.27.0", + "codemaker": "^1.27.1", "yaml": "1.10.2" }, "devDependencies": { diff --git a/packages/decdk/package.json b/packages/decdk/package.json index 0704c80dc12e6..5789b05c61395 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -213,7 +213,7 @@ "@aws-cdk/region-info": "0.0.0", "constructs": "^3.3.69", "fs-extra": "^9.1.0", - "jsii-reflect": "^1.27.0", + "jsii-reflect": "^1.27.1", "jsonschema": "^1.4.0", "yaml": "1.10.2", "yargs": "^16.2.0" @@ -224,7 +224,7 @@ "@types/yaml": "1.9.7", "@types/yargs": "^15.0.13", "jest": "^26.6.3", - "jsii": "^1.27.0" + "jsii": "^1.27.1" }, "keywords": [ "aws", diff --git a/tools/cdk-build-tools/package.json b/tools/cdk-build-tools/package.json index dd6523d47e2df..f49f576a74dc7 100644 --- a/tools/cdk-build-tools/package.json +++ b/tools/cdk-build-tools/package.json @@ -39,20 +39,20 @@ "pkglint": "0.0.0" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "^4.21.0", - "@typescript-eslint/parser": "^4.21.0", + "@typescript-eslint/eslint-plugin": "^4.22.0", + "@typescript-eslint/parser": "^4.22.0", "awslint": "0.0.0", "colors": "^1.4.0", - "eslint": "^7.23.0", + "eslint": "^7.24.0", "eslint-import-resolver-node": "^0.3.4", "eslint-import-resolver-typescript": "^2.4.0", "eslint-plugin-cdk": "0.0.0", "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jest": "^24.3.4", + "eslint-plugin-jest": "^24.3.5", "fs-extra": "^9.1.0", "jest": "^26.6.3", - "jsii": "^1.27.0", - "jsii-pacmak": "^1.27.0", + "jsii": "^1.27.1", + "jsii-pacmak": "^1.27.1", "markdownlint-cli": "^0.27.1", "nodeunit": "^0.11.3", "nyc": "^15.1.0", diff --git a/tools/cfn2ts/package.json b/tools/cfn2ts/package.json index 3a799b44659c6..3996ca947f631 100644 --- a/tools/cfn2ts/package.json +++ b/tools/cfn2ts/package.json @@ -30,7 +30,7 @@ "license": "Apache-2.0", "dependencies": { "@aws-cdk/cfnspec": "0.0.0", - "codemaker": "^1.27.0", + "codemaker": "^1.27.1", "fast-json-patch": "^3.0.0-1", "fs-extra": "^9.1.0", "yargs": "^16.2.0" diff --git a/tools/eslint-plugin-cdk/package.json b/tools/eslint-plugin-cdk/package.json index 83f238eb4f1f2..6392ecdae440f 100644 --- a/tools/eslint-plugin-cdk/package.json +++ b/tools/eslint-plugin-cdk/package.json @@ -12,7 +12,7 @@ "build+test": "npm run build && npm test" }, "devDependencies": { - "@types/eslint": "^7.2.8", + "@types/eslint": "^7.2.9", "@types/fs-extra": "^8.1.1", "@types/jest": "^26.0.22", "@types/node": "^10.17.56", @@ -21,8 +21,8 @@ "typescript": "~3.9.9" }, "dependencies": { - "@typescript-eslint/parser": "^4.21.0", - "eslint": "^7.23.0", + "@typescript-eslint/parser": "^4.22.0", + "eslint": "^7.24.0", "fs-extra": "^9.1.0" }, "jest": { diff --git a/yarn.lock b/yarn.lock index 81510b4448e3d..170383a354967 100644 --- a/yarn.lock +++ b/yarn.lock @@ -513,10 +513,10 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jsii/spec@^1.27.0": - version "1.27.0" - resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.27.0.tgz#fd3a9c3c5074a79f91e80317c0d99d8f0db67a21" - integrity sha512-mdfSlcYY9qI3kI0rK1dAN13BkHtOffhFXzOwtuZvxjhz2+8hx6DpW5nqHAWCrq+ZQuPAPxiMOVXBsA58PZ9Ycg== +"@jsii/spec@^1.27.1": + version "1.27.1" + resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.27.1.tgz#a83833d40a39f8d34d5586a8c8ffc8570c57c06d" + integrity sha512-L5Hqv5g9TSnHsNsOhaIS/gpd1N+1dLao5e6EISF6oyh0JzZFffi2IjQbvE3Xb7GPaCfb5R9+ENO/iX/e5SvK+w== dependencies: jsonschema "^1.4.0" @@ -1449,10 +1449,10 @@ dependencies: "@types/glob" "*" -"@types/aws-lambda@^8.10.73": - version "8.10.73" - resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.73.tgz#77773c9accb2cec26fcb7c6b510a555805604a53" - integrity sha512-P+a6TRQbRnVQOIjWkmw6F23wiJcF+4Uniasbzx7NAXjLQCVGx/Z4VoMfit81/pxlmcXNxAMGuYPugn6CrJLilQ== +"@types/aws-lambda@^8.10.75": + version "8.10.75" + resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.75.tgz#93b4e688db8a45755018561a3212e7766c0fef57" + integrity sha512-orOKSsIVUMsAbKgbSX2ST3FwQt9pxinHVCAIAVl4SmmTxmki2Gu+cGqobMD3eYwDV5FV0YNtaXyxnvE9pLrKTw== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": version "7.1.13" @@ -1487,10 +1487,10 @@ dependencies: "@babel/types" "^7.3.0" -"@types/eslint@^7.2.8": - version "7.2.8" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.8.tgz#45cd802380fcc352e5680e1781d43c50916f12ee" - integrity sha512-RTKvBsfz0T8CKOGZMfuluDNyMFHnu5lvNr4hWEsQeHXH6FcmIDIozOyWMh36nLGMwVd5UFNXC2xztA8lln22MQ== +"@types/eslint@^7.2.9": + version "7.2.9" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.9.tgz#5d26eadbb6d04a225967176399a18eff622da982" + integrity sha512-SdAAXZNvWfhtf3X3y1cbbCZhP3xyPh7mfTvzV6CgfWc/ZhiHpyr9bVroe2/RCHIf7gczaNcprhaBLsx0CCJHQA== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -1727,13 +1727,13 @@ resolved "https://registry.yarnpkg.com/@types/yarnpkg__lockfile/-/yarnpkg__lockfile-1.1.4.tgz#445251eb00bd9c1e751f82c7c6bf4f714edfd464" integrity sha512-/emrKCfQMQmFCqRqqBJ0JueHBT06jBRM3e8OgnvDUcvuExONujIk2hFA5dNsN9Nt41ljGVDdChvCydATZ+KOZw== -"@typescript-eslint/eslint-plugin@^4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.21.0.tgz#3fce2bfa76d95c00ac4f33dff369cb593aab8878" - integrity sha512-FPUyCPKZbVGexmbCFI3EQHzCZdy2/5f+jv6k2EDljGdXSRc0cKvbndd2nHZkSLqCNOPk0jB6lGzwIkglXcYVsQ== +"@typescript-eslint/eslint-plugin@^4.22.0": + version "4.22.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.0.tgz#3d5f29bb59e61a9dba1513d491b059e536e16dbc" + integrity sha512-U8SP9VOs275iDXaL08Ln1Fa/wLXfj5aTr/1c0t0j6CdbOnxh+TruXu1p4I0NAvdPBQgoPjHsgKn28mOi0FzfoA== dependencies: - "@typescript-eslint/experimental-utils" "4.21.0" - "@typescript-eslint/scope-manager" "4.21.0" + "@typescript-eslint/experimental-utils" "4.22.0" + "@typescript-eslint/scope-manager" "4.22.0" debug "^4.1.1" functional-red-black-tree "^1.0.1" lodash "^4.17.15" @@ -1741,15 +1741,15 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.21.0.tgz#0b0bb7c15d379140a660c003bdbafa71ae9134b6" - integrity sha512-cEbgosW/tUFvKmkg3cU7LBoZhvUs+ZPVM9alb25XvR0dal4qHL3SiUqHNrzoWSxaXA9gsifrYrS1xdDV6w/gIA== +"@typescript-eslint/experimental-utils@4.22.0": + version "4.22.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.22.0.tgz#68765167cca531178e7b650a53456e6e0bef3b1f" + integrity sha512-xJXHHl6TuAxB5AWiVrGhvbGL8/hbiCQ8FiWwObO3r0fnvBdrbWEDy1hlvGQOAWc6qsCWuWMKdVWlLAEMpxnddg== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.21.0" - "@typescript-eslint/types" "4.21.0" - "@typescript-eslint/typescript-estree" "4.21.0" + "@typescript-eslint/scope-manager" "4.22.0" + "@typescript-eslint/types" "4.22.0" + "@typescript-eslint/typescript-estree" "4.22.0" eslint-scope "^5.0.0" eslint-utils "^2.0.0" @@ -1765,14 +1765,14 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.21.0.tgz#a227fc2af4001668c3e3f7415d4feee5093894c1" - integrity sha512-eyNf7QmE5O/l1smaQgN0Lj2M/1jOuNg2NrBm1dqqQN0sVngTLyw8tdCbih96ixlhbF1oINoN8fDCyEH9SjLeIA== +"@typescript-eslint/parser@^4.22.0": + version "4.22.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.22.0.tgz#e1637327fcf796c641fe55f73530e90b16ac8fe8" + integrity sha512-z/bGdBJJZJN76nvAY9DkJANYgK3nlRstRRi74WHm3jjgf2I8AglrSY+6l7ogxOmn55YJ6oKZCLLy+6PW70z15Q== dependencies: - "@typescript-eslint/scope-manager" "4.21.0" - "@typescript-eslint/types" "4.21.0" - "@typescript-eslint/typescript-estree" "4.21.0" + "@typescript-eslint/scope-manager" "4.22.0" + "@typescript-eslint/types" "4.22.0" + "@typescript-eslint/typescript-estree" "4.22.0" debug "^4.1.1" "@typescript-eslint/scope-manager@4.18.0": @@ -1783,23 +1783,23 @@ "@typescript-eslint/types" "4.18.0" "@typescript-eslint/visitor-keys" "4.18.0" -"@typescript-eslint/scope-manager@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.21.0.tgz#c81b661c4b8af1ec0c010d847a8f9ab76ab95b4d" - integrity sha512-kfOjF0w1Ix7+a5T1knOw00f7uAP9Gx44+OEsNQi0PvvTPLYeXJlsCJ4tYnDj5PQEYfpcgOH5yBlw7K+UEI9Agw== +"@typescript-eslint/scope-manager@4.22.0": + version "4.22.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.22.0.tgz#ed411545e61161a8d702e703a4b7d96ec065b09a" + integrity sha512-OcCO7LTdk6ukawUM40wo61WdeoA7NM/zaoq1/2cs13M7GyiF+T4rxuA4xM+6LeHWjWbss7hkGXjFDRcKD4O04Q== dependencies: - "@typescript-eslint/types" "4.21.0" - "@typescript-eslint/visitor-keys" "4.21.0" + "@typescript-eslint/types" "4.22.0" + "@typescript-eslint/visitor-keys" "4.22.0" "@typescript-eslint/types@4.18.0": version "4.18.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.18.0.tgz#bebe323f81f2a7e2e320fac9415e60856267584a" integrity sha512-/BRociARpj5E+9yQ7cwCF/SNOWwXJ3qhjurMuK2hIFUbr9vTuDeu476Zpu+ptxY2kSxUHDGLLKy+qGq2sOg37A== -"@typescript-eslint/types@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.21.0.tgz#abdc3463bda5d31156984fa5bc316789c960edef" - integrity sha512-+OQaupjGVVc8iXbt6M1oZMwyKQNehAfLYJJ3SdvnofK2qcjfor9pEM62rVjBknhowTkh+2HF+/KdRAc/wGBN2w== +"@typescript-eslint/types@4.22.0": + version "4.22.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.22.0.tgz#0ca6fde5b68daf6dba133f30959cc0688c8dd0b6" + integrity sha512-sW/BiXmmyMqDPO2kpOhSy2Py5w6KvRRsKZnV0c4+0nr4GIcedJwXAq+RHNK4lLVEZAJYFltnnk1tJSlbeS9lYA== "@typescript-eslint/typescript-estree@4.18.0": version "4.18.0" @@ -1814,13 +1814,13 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.21.0.tgz#3817bd91857beeaeff90f69f1f112ea58d350b0a" - integrity sha512-ZD3M7yLaVGVYLw4nkkoGKumb7Rog7QID9YOWobFDMQKNl+vPxqVIW/uDk+MDeGc+OHcoG2nJ2HphwiPNajKw3w== +"@typescript-eslint/typescript-estree@4.22.0": + version "4.22.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.22.0.tgz#b5d95d6d366ff3b72f5168c75775a3e46250d05c" + integrity sha512-TkIFeu5JEeSs5ze/4NID+PIcVjgoU3cUQUIZnH3Sb1cEn1lBo7StSV5bwPuJQuoxKXlzAObjYTilOEKRuhR5yg== dependencies: - "@typescript-eslint/types" "4.21.0" - "@typescript-eslint/visitor-keys" "4.21.0" + "@typescript-eslint/types" "4.22.0" + "@typescript-eslint/visitor-keys" "4.22.0" debug "^4.1.1" globby "^11.0.1" is-glob "^4.0.1" @@ -1835,12 +1835,12 @@ "@typescript-eslint/types" "4.18.0" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@4.21.0": - version "4.21.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.21.0.tgz#990a9acdc124331f5863c2cf21c88ba65233cd8d" - integrity sha512-dH22dROWGi5Z6p+Igc8bLVLmwy7vEe8r+8c+raPQU0LxgogPUrRAtRGtvBWmlr9waTu3n+QLt/qrS/hWzk1x5w== +"@typescript-eslint/visitor-keys@4.22.0": + version "4.22.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.22.0.tgz#169dae26d3c122935da7528c839f42a8a42f6e47" + integrity sha512-nnMu4F+s4o0sll6cBSsTeVsT4cwxB7zECK3dFxzEjPBii9xLpq4yqqsy/FU5zMfan6G60DKZSCXAa3sHJZrcYw== dependencies: - "@typescript-eslint/types" "4.21.0" + "@typescript-eslint/types" "4.22.0" eslint-visitor-keys "^2.0.0" "@yarnpkg/lockfile@^1.1.0": @@ -2798,10 +2798,10 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= -codemaker@^1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/codemaker/-/codemaker-1.27.0.tgz#1bbe2b05ddc9d927f5fb8f286611885600d9198e" - integrity sha512-W5r3XLxBG2a33M3g3Sg9mOU5wPbw6hz14GfmeQsKlWoSCx8Y3CCxY8ogbh77/K34epqYh43ydybI8e7UVgD/tQ== +codemaker@^1.27.1: + version "1.27.1" + resolved "https://registry.yarnpkg.com/codemaker/-/codemaker-1.27.1.tgz#80ee71860870e604bc837e27a2deb8ce49bf4dae" + integrity sha512-0Ypru4bovWAqZY+giAMIFQh1aJlTJLU7rbNPzkAW7U9mPoja2IE4KLWNlSEYvP7hpamY51Nrz/VfcazsB6a/rg== dependencies: camelcase "^6.2.0" decamelize "^5.0.0" @@ -3742,10 +3742,10 @@ es6-error@^4.0.1: resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== -esbuild@^0.11.6: - version "0.11.6" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.11.6.tgz#20961309c4cfed00b71027e18806150358d0cbb0" - integrity sha512-L+nKW9ftVS/N2CVJMR9YmXHbkm+vHzlNYuo09rzipQhF7dYNvRLfWoEPSDRTl10and4owFBV9rJ2CTFNtLIOiw== +esbuild@^0.11.9: + version "0.11.9" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.11.9.tgz#408bf4fb5ae9abc2f27d56b62e19aab697687975" + integrity sha512-qP7w/oWjJBIh9x+H37DbpkMtmSnLm63VDyA06+vkJJEHlVR7QSDiPAaka7mtMQZHoBn87irUx5rDxbXMKaf8xw== escalade@^3.1.1: version "3.1.1" @@ -3838,10 +3838,10 @@ eslint-plugin-import@^2.22.1: resolve "^1.17.0" tsconfig-paths "^3.9.0" -eslint-plugin-jest@^24.3.4: - version "24.3.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.3.4.tgz#6d90c3554de0302e879603dd6405474c98849f19" - integrity sha512-3n5oY1+fictanuFkTWPwSlehugBTAgwLnYLFsCllzE3Pl1BwywHl5fL0HFxmMjoQY8xhUDk8uAWc3S4JOHGh3A== +eslint-plugin-jest@^24.3.5: + version "24.3.5" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.3.5.tgz#71f0b580f87915695c286c3f0eb88cf23664d044" + integrity sha512-XG4rtxYDuJykuqhsOqokYIR84/C8pRihRtEpVskYLbIIKGwPNW2ySxdctuVzETZE+MbF/e7wmsnbNVpzM0rDug== dependencies: "@typescript-eslint/experimental-utils" "^4.0.1" @@ -3897,10 +3897,10 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@^7.23.0: - version "7.23.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.23.0.tgz#8d029d252f6e8cf45894b4bee08f5493f8e94325" - integrity sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q== +eslint@^7.24.0: + version "7.24.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.24.0.tgz#2e44fa62d93892bfdb100521f17345ba54b8513a" + integrity sha512-k9gaHeHiFmGCDQ2rEfvULlSLruz6tgfA8DEn+rY9/oYPFFTlz55mM/Q/Rij1b2Y42jwZiK3lXvNTw6w6TXzcKQ== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.0" @@ -5967,65 +5967,65 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsii-diff@^1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/jsii-diff/-/jsii-diff-1.27.0.tgz#48da3594e784a6badb26e01ae3be017883653465" - integrity sha512-CBg3ZwT63iPLdfy8nNY++tc8xuBm+Zs1dDjnK2/0z3yApOAmYIfi/5BplPOoSfzCNAejtvIxLEgScl9BZktXXA== +jsii-diff@^1.27.1: + version "1.27.1" + resolved "https://registry.yarnpkg.com/jsii-diff/-/jsii-diff-1.27.1.tgz#fe396401cc7e35b4b77fa80b27628b618e9a2f22" + integrity sha512-1E28l0Jy93B1KbaB72FpDcFWBE0ABlOqWssr615aHeDLFC2G4jzlI1azdGUXbSWh6615pDX3oM0F3zrJEcbxLw== dependencies: - "@jsii/spec" "^1.27.0" + "@jsii/spec" "^1.27.1" fs-extra "^9.1.0" - jsii-reflect "^1.27.0" + jsii-reflect "^1.27.1" log4js "^6.3.0" typescript "~3.9.9" yargs "^16.2.0" -jsii-pacmak@^1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/jsii-pacmak/-/jsii-pacmak-1.27.0.tgz#d6d28f5e9208d7ca338edfeba95ba25d8f552bde" - integrity sha512-K19kyUvFKpg6l5VaTkwFz4pgnrOR/vH69iqE6YWSJVY1i3S7dTA2mhG+dVbeB96MMnx7IUno0iKT3br/aWCtew== +jsii-pacmak@^1.27.1: + version "1.27.1" + resolved "https://registry.yarnpkg.com/jsii-pacmak/-/jsii-pacmak-1.27.1.tgz#abf6966d3bfedf03997464f1b2c7d597737b5788" + integrity sha512-OA9lPxOFHyGmLsGWe8VjbTnIsAjZo8vHHB7RVHZeZ5pwKZJxV3ND2SBgb8cvzbu9rwLi/eFD0aAadq9fRFrDLA== dependencies: - "@jsii/spec" "^1.27.0" + "@jsii/spec" "^1.27.1" clone "^2.1.2" - codemaker "^1.27.0" + codemaker "^1.27.1" commonmark "^0.29.3" escape-string-regexp "^4.0.0" fs-extra "^9.1.0" - jsii-reflect "^1.27.0" - jsii-rosetta "^1.27.0" + jsii-reflect "^1.27.1" + jsii-rosetta "^1.27.1" semver "^7.3.5" spdx-license-list "^6.4.0" xmlbuilder "^15.1.1" yargs "^16.2.0" -jsii-reflect@^1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/jsii-reflect/-/jsii-reflect-1.27.0.tgz#481edae2cbc497d4125207c37b964ba64c290dbc" - integrity sha512-+E2VhlDxvEcsBj8LdBaJ0OFS6+mDaWbDNmUSZ7UPIJxDPQzRFMGlMUyymz8J0f3Y2UWKiXgLvBhzEvF9UA4fCQ== +jsii-reflect@^1.27.1: + version "1.27.1" + resolved "https://registry.yarnpkg.com/jsii-reflect/-/jsii-reflect-1.27.1.tgz#f1d6a53db2624441112dc4caccefa8eff63d4534" + integrity sha512-I2jc7Gv26N9MUyVhewjLS9vZJL4aPOcKCjgsmpDCX4Pz7ny9Op7iHNST9LpicY0Vqv81gi8OnsM0mWBPUM2nOA== dependencies: - "@jsii/spec" "^1.27.0" + "@jsii/spec" "^1.27.1" colors "^1.4.0" fs-extra "^9.1.0" - oo-ascii-tree "^1.27.0" + oo-ascii-tree "^1.27.1" yargs "^16.2.0" -jsii-rosetta@^1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.27.0.tgz#13ff711cff331b1d62081d8015ea24f730d6bbf7" - integrity sha512-swQz1lsB5k2v2euJfxYOtRy+SHnYS9WJ2XRkstY8/j0xMFOLNNXoWwSDrK97h3qis+yUuCHZlI6DNQzQh1NutA== +jsii-rosetta@^1.27.1: + version "1.27.1" + resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.27.1.tgz#9258ab731eb414478807a76da436f8e2d8600002" + integrity sha512-GLoKI5iRvqhcDYxtgXReVEbBChyGbUvTy8n344UkVNvIPHnq0bhLPGArttnrbbHmIZcxrAoYd+6o5sqZ2fUZNQ== dependencies: - "@jsii/spec" "^1.27.0" + "@jsii/spec" "^1.27.1" commonmark "^0.29.3" fs-extra "^9.1.0" typescript "~3.9.9" xmldom "^0.5.0" yargs "^16.2.0" -jsii@^1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.27.0.tgz#7dc6716ad5c68d6a0c0ff913ff656cf2bbe56ec7" - integrity sha512-EP1NIeheeUw4WpGESkOK7Kb/bT9bBlOunlQuQb+KSMKYq+Zh8uWuFxzTYbt3pg/UdaVis5YD0jsdVgQFVU7ufA== +jsii@^1.27.1: + version "1.27.1" + resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.27.1.tgz#e595e8ba462c40b6fd1cb7c1dd56913ad21b3610" + integrity sha512-2VIZwLytVRsOnqhdZNqZPPKrAPYIAmqxest7YcrwgFbTK+Zyxsa2FQyWyD2nNVzdxWqVUqALvuV3RMKMEHWv7g== dependencies: - "@jsii/spec" "^1.27.0" + "@jsii/spec" "^1.27.1" case "^1.6.3" colors "^1.4.0" deep-equal "^2.0.5" @@ -7400,10 +7400,10 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -oo-ascii-tree@^1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.27.0.tgz#d806ed771026abc3a113f823408914486e48401a" - integrity sha512-3hqwUDNTJC2YLzSRye8Fh35AC4fSHl2FZhFF/hyQtO8C9lV1PEXIPWGIRZ0zwQSHFutnriEvK8AHJgbbMrLxqg== +oo-ascii-tree@^1.27.1: + version "1.27.1" + resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.27.1.tgz#4a2f2df00793aa600b927d479737a1814892449e" + integrity sha512-bCX2YoRGOhWh/CUi2e38gw5D+ixcpuMjMEJ1VJ9oAE40burZO8CVLq2noqvU3/EmaO2R9ifaM+0xnxJzBkII/A== opener@^1.5.1: version "1.5.2" From 54fddc64c7b541f9192fb904fa9a3b44b8aacf90 Mon Sep 17 00:00:00 2001 From: Fernando Minoru Baba Date: Tue, 13 Apr 2021 20:32:39 +1000 Subject: [PATCH 08/11] fix(aws-cloudfront): distribution comment length not validated (#14020) (#14094) fixes #14020 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-cloudfront/lib/distribution.ts | 8 ++- .../aws-cloudfront/lib/web-distribution.ts | 8 ++- .../aws-cloudfront/test/distribution.test.ts | 34 +++++++++ .../test/web-distribution.test.ts | 72 +++++++++++++++++++ 4 files changed, 120 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-cloudfront/lib/distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/distribution.ts index 02e3d092295f3..3482d53e9624c 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/distribution.ts @@ -279,6 +279,12 @@ export class Distribution extends Resource implements IDistribution { this.certificate = props.certificate; this.errorResponses = props.errorResponses ?? []; + // Comments have an undocumented limit of 128 characters + const trimmedComment = + props.comment && props.comment.length > 128 + ? `${props.comment.substr(0, 128 - 3)}...` + : props.comment; + const distribution = new CfnDistribution(this, 'Resource', { distributionConfig: { enabled: props.enabled ?? true, @@ -287,7 +293,7 @@ export class Distribution extends Resource implements IDistribution { defaultCacheBehavior: this.defaultBehavior._renderBehavior(), aliases: props.domainNames, cacheBehaviors: Lazy.any({ produce: () => this.renderCacheBehaviors() }), - comment: props.comment, + comment: trimmedComment, customErrorResponses: this.renderErrorResponses(), defaultRootObject: props.defaultRootObject, httpVersion: props.httpVersion ?? HttpVersion.HTTP2, diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web-distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web-distribution.ts index 87836434fa141..17aafe5e4f6fd 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web-distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web-distribution.ts @@ -769,8 +769,14 @@ export class CloudFrontWebDistribution extends cdk.Resource implements IDistribu constructor(scope: Construct, id: string, props: CloudFrontWebDistributionProps) { super(scope, id); + // Comments have an undocumented limit of 128 characters + const trimmedComment = + props.comment && props.comment.length > 128 + ? `${props.comment.substr(0, 128 - 3)}...` + : props.comment; + let distributionConfig: CfnDistribution.DistributionConfigProperty = { - comment: props.comment, + comment: trimmedComment, enabled: true, defaultRootObject: props.defaultRootObject ?? 'index.html', httpVersion: props.httpVersion || HttpVersion.HTTP2, diff --git a/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts b/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts index 1f4fb64e01dc9..f6294ad1b6d08 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts @@ -107,6 +107,40 @@ test('exhaustive example of props renders correctly', () => { }); }); +test('ensure comment prop is not greater than max lenght', () => { + const origin = defaultOrigin(); + new Distribution(stack, 'MyDist', { + defaultBehavior: { origin }, + comment: `Adding a comment longer than 128 characters should be trimmed and added the +ellipsis so a user would know there was more to read and everything beyond this point should not show up`, + }); + + expect(stack).toHaveResource('AWS::CloudFront::Distribution', { + DistributionConfig: { + DefaultCacheBehavior: { + CachePolicyId: '658327ea-f89d-4fab-a63d-7e88639e58f6', + Compress: true, + TargetOriginId: 'StackMyDistOrigin1D6D5E535', + ViewerProtocolPolicy: 'allow-all', + }, + Comment: `Adding a comment longer than 128 characters should be trimmed and added the +ellipsis so a user would know there was more to ...`, + Enabled: true, + HttpVersion: 'http2', + IPV6Enabled: true, + Origins: [ + { + DomainName: 'www.example.com', + Id: 'StackMyDistOrigin1D6D5E535', + CustomOriginConfig: { + OriginProtocolPolicy: 'https-only', + }, + }, + ], + }, + }); +}); + describe('multiple behaviors', () => { test('a second behavior can\'t be specified with the catch-all path pattern', () => { diff --git a/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts b/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts index bb67af6535c10..6e10b54defc77 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts @@ -198,6 +198,78 @@ nodeunitShim({ test.done(); }, + 'ensure long comments will not break the distribution'(test: Test) { + const stack = new cdk.Stack(); + const sourceBucket = new s3.Bucket(stack, 'Bucket'); + + new CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', { + comment: `Adding a comment longer than 128 characters should be trimmed and +added the ellipsis so a user would know there was more to read and everything beyond this point should not show up`, + originConfigs: [ + { + s3OriginSource: { + s3BucketSource: sourceBucket, + }, + behaviors: [ + { + isDefaultBehavior: true, + }, + ], + }, + ], + }); + + expect(stack).toMatch({ + Resources: { + Bucket83908E77: { + Type: 'AWS::S3::Bucket', + DeletionPolicy: 'Retain', + UpdateReplacePolicy: 'Retain', + }, + AnAmazingWebsiteProbablyCFDistribution47E3983B: { + Type: 'AWS::CloudFront::Distribution', + Properties: { + DistributionConfig: { + DefaultRootObject: 'index.html', + Origins: [ + { + ConnectionAttempts: 3, + ConnectionTimeout: 10, + DomainName: { + 'Fn::GetAtt': ['Bucket83908E77', 'RegionalDomainName'], + }, + Id: 'origin1', + S3OriginConfig: {}, + }, + ], + ViewerCertificate: { + CloudFrontDefaultCertificate: true, + }, + PriceClass: 'PriceClass_100', + DefaultCacheBehavior: { + AllowedMethods: ['GET', 'HEAD'], + CachedMethods: ['GET', 'HEAD'], + TargetOriginId: 'origin1', + ViewerProtocolPolicy: 'redirect-to-https', + ForwardedValues: { + QueryString: false, + Cookies: { Forward: 'none' }, + }, + Compress: true, + }, + Comment: `Adding a comment longer than 128 characters should be trimmed and +added the ellipsis so a user would know there was more to ...`, + Enabled: true, + IPV6Enabled: true, + HttpVersion: 'http2', + }, + }, + }, + }, + }); + test.done(); + }, + 'distribution with bucket and OAI'(test: Test) { const stack = new cdk.Stack(); const s3BucketSource = new s3.Bucket(stack, 'Bucket'); From c65c88299016772e0fb346d9072277bc2b650f7f Mon Sep 17 00:00:00 2001 From: Niranjan Jayakar Date: Tue, 13 Apr 2021 14:31:46 +0100 Subject: [PATCH 09/11] chore(rds): remove the use of testFutureBehavior for RDS_LOWERCASE_DB_IDENTIFIER feature flag (#14139) This is a backport of the fix needed during this forward merge #14114. The use testFutureBehavior and testLegacyBehavior APIs are reservd for feature flags that will be 'expired' in CDKv2. expired means that the feature flag is blocked and the behaviour defaulted to as if it was enabled. The RDS_LOWERCASE_DB_IDENTIFIER feature flag cannot be expired in CDKv2. If it was, existing customers will have to destroy their RDS database instance and create a new one, in order to migrate to CDKv2. Instead, this feature flag will continue to exist in CDKv2 but it will default to 'true'. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../@aws-cdk/aws-rds/test/instance.test.ts | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/@aws-cdk/aws-rds/test/instance.test.ts b/packages/@aws-cdk/aws-rds/test/instance.test.ts index 4dcbb84d1703e..db227fa24c3a5 100644 --- a/packages/@aws-cdk/aws-rds/test/instance.test.ts +++ b/packages/@aws-cdk/aws-rds/test/instance.test.ts @@ -9,7 +9,7 @@ import * as logs from '@aws-cdk/aws-logs'; import * as s3 from '@aws-cdk/aws-s3'; import * as cdk from '@aws-cdk/core'; import * as cxapi from '@aws-cdk/cx-api'; -import { testFutureBehavior, testLegacyBehavior } from 'cdk-build-tools/lib/feature-flag'; +import { testFutureBehavior } from 'cdk-build-tools/lib/feature-flag'; import * as rds from '../lib'; let stack: cdk.Stack; @@ -1280,33 +1280,33 @@ describe('instance', () => { }); }); - testFutureBehavior( - 'changes the case of the cluster identifier if the lowercaseDbIdentifier feature flag is enabled', - { [cxapi.RDS_LOWERCASE_DB_IDENTIFIER]: true }, cdk.App, (app, - ) => { - // GIVEN - stack = new cdk.Stack( app ); - vpc = new ec2.Vpc( stack, 'VPC' ); - - // WHEN - const instanceIdentifier = 'TestInstanceIdentifier'; - new rds.DatabaseInstance( stack, 'DB', { - engine: rds.DatabaseInstanceEngine.mysql({ - version: rds.MysqlEngineVersion.VER_8_0_19, - }), - vpc, - instanceIdentifier, - } ); + test('changes the case of the cluster identifier if the lowercaseDbIdentifier feature flag is enabled', () => { + // GIVEN + const app = new cdk.App({ + context: { [cxapi.RDS_LOWERCASE_DB_IDENTIFIER]: true }, + }); + stack = new cdk.Stack( app ); + vpc = new ec2.Vpc( stack, 'VPC' ); - // THEN - expect(stack).toHaveResource('AWS::RDS::DBInstance', { - DBInstanceIdentifier: instanceIdentifier.toLowerCase(), - }); + // WHEN + const instanceIdentifier = 'TestInstanceIdentifier'; + new rds.DatabaseInstance( stack, 'DB', { + engine: rds.DatabaseInstanceEngine.mysql({ + version: rds.MysqlEngineVersion.VER_8_0_19, + }), + vpc, + instanceIdentifier, + } ); + + // THEN + expect(stack).toHaveResource('AWS::RDS::DBInstance', { + DBInstanceIdentifier: instanceIdentifier.toLowerCase(), }); + }); - testLegacyBehavior( 'does not changes the case of the cluster identifier if the lowercaseDbIdentifier feature flag is disabled', cdk.App, (app ) => { + test( 'does not changes the case of the cluster identifier if the lowercaseDbIdentifier feature flag is disabled', () => { // GIVEN - stack = new cdk.Stack( app ); + stack = new cdk.Stack(); vpc = new ec2.Vpc( stack, 'VPC' ); // WHEN From 81b0ef609835778d5122a32d2e91e7881da84a41 Mon Sep 17 00:00:00 2001 From: AWS CDK Automation <43080478+aws-cdk-automation@users.noreply.github.com> Date: Tue, 13 Apr 2021 05:34:33 -1000 Subject: [PATCH 10/11] chore: npm-check-updates && yarn upgrade (#14140) Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date. Co-authored-by: eladb --- package.json | 6 +- .../@aws-cdk/aws-lambda-nodejs/package.json | 2 +- packages/awslint/package.json | 4 +- packages/cdk-dasm/package.json | 2 +- packages/decdk/package.json | 4 +- tools/cdk-build-tools/package.json | 4 +- tools/cfn2ts/package.json | 2 +- yarn.lock | 92 +++++++++---------- 8 files changed, 58 insertions(+), 58 deletions(-) diff --git a/package.json b/package.json index c6bde8dfa25ed..968e26990a027 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,9 @@ "fs-extra": "^9.1.0", "graceful-fs": "^4.2.6", "jest-junit": "^12.0.0", - "jsii-diff": "^1.27.1", - "jsii-pacmak": "^1.27.1", - "jsii-rosetta": "^1.27.1", + "jsii-diff": "^1.28.0", + "jsii-pacmak": "^1.28.0", + "jsii-rosetta": "^1.28.0", "lerna": "^4.0.0", "standard-version": "^9.2.0", "typescript": "~3.9.9" diff --git a/packages/@aws-cdk/aws-lambda-nodejs/package.json b/packages/@aws-cdk/aws-lambda-nodejs/package.json index 4e05e42b8f631..40e0e6c480185 100644 --- a/packages/@aws-cdk/aws-lambda-nodejs/package.json +++ b/packages/@aws-cdk/aws-lambda-nodejs/package.json @@ -66,7 +66,7 @@ "cdk-build-tools": "0.0.0", "cdk-integ-tools": "0.0.0", "delay": "5.0.0", - "esbuild": "^0.11.9", + "esbuild": "^0.11.10", "pkglint": "0.0.0", "@aws-cdk/assert-internal": "0.0.0" }, diff --git a/packages/awslint/package.json b/packages/awslint/package.json index 6915867813ec2..e9353d9c69377 100644 --- a/packages/awslint/package.json +++ b/packages/awslint/package.json @@ -16,11 +16,11 @@ "awslint": "bin/awslint" }, "dependencies": { - "@jsii/spec": "^1.27.1", + "@jsii/spec": "^1.28.0", "camelcase": "^6.2.0", "colors": "^1.4.0", "fs-extra": "^9.1.0", - "jsii-reflect": "^1.27.1", + "jsii-reflect": "^1.28.0", "yargs": "^16.2.0" }, "devDependencies": { diff --git a/packages/cdk-dasm/package.json b/packages/cdk-dasm/package.json index 23e5bda09d65d..ebd3ef93c0693 100644 --- a/packages/cdk-dasm/package.json +++ b/packages/cdk-dasm/package.json @@ -26,7 +26,7 @@ }, "license": "Apache-2.0", "dependencies": { - "codemaker": "^1.27.1", + "codemaker": "^1.28.0", "yaml": "1.10.2" }, "devDependencies": { diff --git a/packages/decdk/package.json b/packages/decdk/package.json index 5789b05c61395..9fbc5c03117e9 100644 --- a/packages/decdk/package.json +++ b/packages/decdk/package.json @@ -213,7 +213,7 @@ "@aws-cdk/region-info": "0.0.0", "constructs": "^3.3.69", "fs-extra": "^9.1.0", - "jsii-reflect": "^1.27.1", + "jsii-reflect": "^1.28.0", "jsonschema": "^1.4.0", "yaml": "1.10.2", "yargs": "^16.2.0" @@ -224,7 +224,7 @@ "@types/yaml": "1.9.7", "@types/yargs": "^15.0.13", "jest": "^26.6.3", - "jsii": "^1.27.1" + "jsii": "^1.28.0" }, "keywords": [ "aws", diff --git a/tools/cdk-build-tools/package.json b/tools/cdk-build-tools/package.json index f49f576a74dc7..711dcde8a7542 100644 --- a/tools/cdk-build-tools/package.json +++ b/tools/cdk-build-tools/package.json @@ -51,8 +51,8 @@ "eslint-plugin-jest": "^24.3.5", "fs-extra": "^9.1.0", "jest": "^26.6.3", - "jsii": "^1.27.1", - "jsii-pacmak": "^1.27.1", + "jsii": "^1.28.0", + "jsii-pacmak": "^1.28.0", "markdownlint-cli": "^0.27.1", "nodeunit": "^0.11.3", "nyc": "^15.1.0", diff --git a/tools/cfn2ts/package.json b/tools/cfn2ts/package.json index 3996ca947f631..82e397b74ce62 100644 --- a/tools/cfn2ts/package.json +++ b/tools/cfn2ts/package.json @@ -30,7 +30,7 @@ "license": "Apache-2.0", "dependencies": { "@aws-cdk/cfnspec": "0.0.0", - "codemaker": "^1.27.1", + "codemaker": "^1.28.0", "fast-json-patch": "^3.0.0-1", "fs-extra": "^9.1.0", "yargs": "^16.2.0" diff --git a/yarn.lock b/yarn.lock index 170383a354967..d5c51d3bc1723 100644 --- a/yarn.lock +++ b/yarn.lock @@ -513,10 +513,10 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jsii/spec@^1.27.1": - version "1.27.1" - resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.27.1.tgz#a83833d40a39f8d34d5586a8c8ffc8570c57c06d" - integrity sha512-L5Hqv5g9TSnHsNsOhaIS/gpd1N+1dLao5e6EISF6oyh0JzZFffi2IjQbvE3Xb7GPaCfb5R9+ENO/iX/e5SvK+w== +"@jsii/spec@^1.28.0": + version "1.28.0" + resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.28.0.tgz#47db1102fc0291dbffffb3adb7f8ee0671e15ef3" + integrity sha512-5mcupuCCXyhZwNmX/RDBn3WUYtd0oPXEDa3E+qOSjT30vaO8u9ZQ+mxwl4qsecx3m51LhXKnR1C9U9t4VlAmqA== dependencies: jsonschema "^1.4.0" @@ -2798,10 +2798,10 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= -codemaker@^1.27.1: - version "1.27.1" - resolved "https://registry.yarnpkg.com/codemaker/-/codemaker-1.27.1.tgz#80ee71860870e604bc837e27a2deb8ce49bf4dae" - integrity sha512-0Ypru4bovWAqZY+giAMIFQh1aJlTJLU7rbNPzkAW7U9mPoja2IE4KLWNlSEYvP7hpamY51Nrz/VfcazsB6a/rg== +codemaker@^1.28.0: + version "1.28.0" + resolved "https://registry.yarnpkg.com/codemaker/-/codemaker-1.28.0.tgz#21237f9240ab05ecca6c65da48141b8b752539b8" + integrity sha512-TlpvV3q/68cZk7aljYW6b/5EvyB4uw523xJISTATrCrQu/UTA79/mxpA2ug8uhPcJoGYcfWXH4BHVVLNIuEtrg== dependencies: camelcase "^6.2.0" decamelize "^5.0.0" @@ -3742,10 +3742,10 @@ es6-error@^4.0.1: resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== -esbuild@^0.11.9: - version "0.11.9" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.11.9.tgz#408bf4fb5ae9abc2f27d56b62e19aab697687975" - integrity sha512-qP7w/oWjJBIh9x+H37DbpkMtmSnLm63VDyA06+vkJJEHlVR7QSDiPAaka7mtMQZHoBn87irUx5rDxbXMKaf8xw== +esbuild@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.11.10.tgz#f5d39e4d9cc130b78d751664fef1b663240f5545" + integrity sha512-XvGbf+UreVFA24Tlk6sNOqNcvF2z49XAZt4E7A4H80+yqn944QOLTTxaU0lkdYNtZKFiITNea+VxmtrfjvnLPA== escalade@^3.1.1: version "3.1.1" @@ -5967,65 +5967,65 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -jsii-diff@^1.27.1: - version "1.27.1" - resolved "https://registry.yarnpkg.com/jsii-diff/-/jsii-diff-1.27.1.tgz#fe396401cc7e35b4b77fa80b27628b618e9a2f22" - integrity sha512-1E28l0Jy93B1KbaB72FpDcFWBE0ABlOqWssr615aHeDLFC2G4jzlI1azdGUXbSWh6615pDX3oM0F3zrJEcbxLw== +jsii-diff@^1.28.0: + version "1.28.0" + resolved "https://registry.yarnpkg.com/jsii-diff/-/jsii-diff-1.28.0.tgz#16f889559f3d2679154f93eae004704db1e6c62d" + integrity sha512-SJUzVY7sXg3esBeuvj3tQGzeRYEkpmrqbC1lIHd8VdXpPybYWU958z3hlJJkvaM1AomQpiMyXK6Ev+2XOp741g== dependencies: - "@jsii/spec" "^1.27.1" + "@jsii/spec" "^1.28.0" fs-extra "^9.1.0" - jsii-reflect "^1.27.1" + jsii-reflect "^1.28.0" log4js "^6.3.0" typescript "~3.9.9" yargs "^16.2.0" -jsii-pacmak@^1.27.1: - version "1.27.1" - resolved "https://registry.yarnpkg.com/jsii-pacmak/-/jsii-pacmak-1.27.1.tgz#abf6966d3bfedf03997464f1b2c7d597737b5788" - integrity sha512-OA9lPxOFHyGmLsGWe8VjbTnIsAjZo8vHHB7RVHZeZ5pwKZJxV3ND2SBgb8cvzbu9rwLi/eFD0aAadq9fRFrDLA== +jsii-pacmak@^1.28.0: + version "1.28.0" + resolved "https://registry.yarnpkg.com/jsii-pacmak/-/jsii-pacmak-1.28.0.tgz#3d20c27a91266cf740a1ff229b29270785d2bcfc" + integrity sha512-QAW8rq7M9rA/QSXwaJKMVpttkNW/BJgE9GT6i9UahobQMkmp+zsXCJUENeRg2mndLqX0DDyxO1in/fuIeCeR3A== dependencies: - "@jsii/spec" "^1.27.1" + "@jsii/spec" "^1.28.0" clone "^2.1.2" - codemaker "^1.27.1" + codemaker "^1.28.0" commonmark "^0.29.3" escape-string-regexp "^4.0.0" fs-extra "^9.1.0" - jsii-reflect "^1.27.1" - jsii-rosetta "^1.27.1" + jsii-reflect "^1.28.0" + jsii-rosetta "^1.28.0" semver "^7.3.5" spdx-license-list "^6.4.0" xmlbuilder "^15.1.1" yargs "^16.2.0" -jsii-reflect@^1.27.1: - version "1.27.1" - resolved "https://registry.yarnpkg.com/jsii-reflect/-/jsii-reflect-1.27.1.tgz#f1d6a53db2624441112dc4caccefa8eff63d4534" - integrity sha512-I2jc7Gv26N9MUyVhewjLS9vZJL4aPOcKCjgsmpDCX4Pz7ny9Op7iHNST9LpicY0Vqv81gi8OnsM0mWBPUM2nOA== +jsii-reflect@^1.28.0: + version "1.28.0" + resolved "https://registry.yarnpkg.com/jsii-reflect/-/jsii-reflect-1.28.0.tgz#d03276499702115ff0582f82ede7bd40f1a4b6b9" + integrity sha512-jFu9dUy5D0PrxVnaDilb50agbSr0wZRya6StwHyw8Wly3ruzS8uuSB1aWmEwN371m5ewDD4m9nPEQ9zMmKFvMQ== dependencies: - "@jsii/spec" "^1.27.1" + "@jsii/spec" "^1.28.0" colors "^1.4.0" fs-extra "^9.1.0" - oo-ascii-tree "^1.27.1" + oo-ascii-tree "^1.28.0" yargs "^16.2.0" -jsii-rosetta@^1.27.1: - version "1.27.1" - resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.27.1.tgz#9258ab731eb414478807a76da436f8e2d8600002" - integrity sha512-GLoKI5iRvqhcDYxtgXReVEbBChyGbUvTy8n344UkVNvIPHnq0bhLPGArttnrbbHmIZcxrAoYd+6o5sqZ2fUZNQ== +jsii-rosetta@^1.28.0: + version "1.28.0" + resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.28.0.tgz#89625e817d4bf50fe51924177eb78bcb08908193" + integrity sha512-lttDhXiBuWaN0DwsWakD5o7GxyVP8yMCRvpmpXOqz1eK+MMlZp654R6o39M7RksXhhxipCNwfbIY3T7Y7N85qQ== dependencies: - "@jsii/spec" "^1.27.1" + "@jsii/spec" "^1.28.0" commonmark "^0.29.3" fs-extra "^9.1.0" typescript "~3.9.9" xmldom "^0.5.0" yargs "^16.2.0" -jsii@^1.27.1: - version "1.27.1" - resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.27.1.tgz#e595e8ba462c40b6fd1cb7c1dd56913ad21b3610" - integrity sha512-2VIZwLytVRsOnqhdZNqZPPKrAPYIAmqxest7YcrwgFbTK+Zyxsa2FQyWyD2nNVzdxWqVUqALvuV3RMKMEHWv7g== +jsii@^1.28.0: + version "1.28.0" + resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.28.0.tgz#c453f2a81d001dd2c3c3991e6e36d4bbb1d03f42" + integrity sha512-B6CbHi60fabeQZJYNea8wSUsrILJzN7ng+yx69GmMJ4C6NtCVt7Oc/CITfhY/cYTwdhN3FAJf01e5/v8qj6bUA== dependencies: - "@jsii/spec" "^1.27.1" + "@jsii/spec" "^1.28.0" case "^1.6.3" colors "^1.4.0" deep-equal "^2.0.5" @@ -7400,10 +7400,10 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -oo-ascii-tree@^1.27.1: - version "1.27.1" - resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.27.1.tgz#4a2f2df00793aa600b927d479737a1814892449e" - integrity sha512-bCX2YoRGOhWh/CUi2e38gw5D+ixcpuMjMEJ1VJ9oAE40burZO8CVLq2noqvU3/EmaO2R9ifaM+0xnxJzBkII/A== +oo-ascii-tree@^1.28.0: + version "1.28.0" + resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.28.0.tgz#2bafc084f7725b118b5a8511944a8dd4ebef14df" + integrity sha512-lCeBgtQutG2+K7BOJDurYNfCepvckj7jWtq2VVP1kseLry/VbLzE/oLiXEeK6iWUXJbBE2IzmxwGuUwee293yw== opener@^1.5.1: version "1.5.2" From d01f7a8e9718444c136ff9a9533d205e18367259 Mon Sep 17 00:00:00 2001 From: AWS CDK Team Date: Tue, 13 Apr 2021 15:47:26 +0000 Subject: [PATCH 11/11] chore(release): 1.99.0 --- CHANGELOG.md | 15 +++++++++++++++ version.v1.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 431f83f204779..0221ebf0a7c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.99.0](https://github.com/aws/aws-cdk/compare/v1.98.0...v1.99.0) (2021-04-13) + + +### Features + +* **elasticloadbalancing:** rename 'sslCertificateId' property of LB listener to 'sslCertificateArn'; deprecate sslCertificateId property ([#13766](https://github.com/aws/aws-cdk/issues/13766)) ([1a30272](https://github.com/aws/aws-cdk/commit/1a30272c8bd99a919bde695b5b1b1f5cb458cb64)), closes [#9303](https://github.com/aws/aws-cdk/issues/9303) [#9303](https://github.com/aws/aws-cdk/issues/9303) + + +### Bug Fixes + +* **aws-cloudfront:** distribution comment length not validated ([#14020](https://github.com/aws/aws-cdk/issues/14020)) ([#14094](https://github.com/aws/aws-cdk/issues/14094)) ([54fddc6](https://github.com/aws/aws-cdk/commit/54fddc64c7b541f9192fb904fa9a3b44b8aacf90)) +* **aws-ecs-patterns:** fixes [#11123](https://github.com/aws/aws-cdk/issues/11123) allow for https listeners to use non Route 53 DNS if a certificate is provided ([#14004](https://github.com/aws/aws-cdk/issues/14004)) ([e6c85e4](https://github.com/aws/aws-cdk/commit/e6c85e4167cdb38ed056eda17b869e179a6dd1c5)) +* **cfn-include:** allow deploy-time values in Parameter substitutions in Fn::Sub expressions ([#14068](https://github.com/aws/aws-cdk/issues/14068)) ([111d26a](https://github.com/aws/aws-cdk/commit/111d26a30d220a319bbb7b1b1696aafac865e009)), closes [#14047](https://github.com/aws/aws-cdk/issues/14047) +* **fsx:** Weekday.SUNDAY incorrectly evaluates to 0 (should be 7) ([#14081](https://github.com/aws/aws-cdk/issues/14081)) ([708f23e](https://github.com/aws/aws-cdk/commit/708f23e78fb0eff2aa17593c530500eb0b94067a)), closes [#14080](https://github.com/aws/aws-cdk/issues/14080) + ## [1.98.0](https://github.com/aws/aws-cdk/compare/v1.97.0...v1.98.0) (2021-04-12) diff --git a/version.v1.json b/version.v1.json index f8ce43929227f..1e722c574d2d0 100644 --- a/version.v1.json +++ b/version.v1.json @@ -1,3 +1,3 @@ { - "version": "1.98.0" + "version": "1.99.0" }