From 1a39b1f33973064a4234b974f4e0551590de9185 Mon Sep 17 00:00:00 2001 From: peterwoodworth Date: Thu, 29 Jul 2021 16:24:13 -0700 Subject: [PATCH 1/3] fix: incorrect error message --- packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts b/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts index 9dcc75719b77b..8b0252bed9eb4 100644 --- a/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts +++ b/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts @@ -492,10 +492,10 @@ export class GraphqlApi extends GraphqlApiBase { private validateAuthorizationProps(modes: AuthorizationMode[]) { modes.map((mode) => { if (mode.authorizationType === AuthorizationType.OIDC && !mode.openIdConnectConfig) { - throw new Error('Missing default OIDC Configuration'); + throw new Error('Missing OIDC Configuration'); } if (mode.authorizationType === AuthorizationType.USER_POOL && !mode.userPoolConfig) { - throw new Error('Missing default OIDC Configuration'); + throw new Error('Missing User Pool Configuration'); } }); if (modes.filter((mode) => mode.authorizationType === AuthorizationType.API_KEY).length > 1) { From 98b094d38c4a51642b53c2fd334112f8d36512ab Mon Sep 17 00:00:00 2001 From: peterwoodworth Date: Thu, 29 Jul 2021 17:17:56 -0700 Subject: [PATCH 2/3] fix: volumename doesn't set name of ec2 volume --- packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts | 4 ++-- packages/@aws-cdk/aws-ec2/lib/volume.ts | 2 ++ packages/@aws-cdk/aws-ec2/test/volume.test.ts | 7 +++++++ yarn.lock | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts b/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts index 8b0252bed9eb4..9dcc75719b77b 100644 --- a/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts +++ b/packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts @@ -492,10 +492,10 @@ export class GraphqlApi extends GraphqlApiBase { private validateAuthorizationProps(modes: AuthorizationMode[]) { modes.map((mode) => { if (mode.authorizationType === AuthorizationType.OIDC && !mode.openIdConnectConfig) { - throw new Error('Missing OIDC Configuration'); + throw new Error('Missing default OIDC Configuration'); } if (mode.authorizationType === AuthorizationType.USER_POOL && !mode.userPoolConfig) { - throw new Error('Missing User Pool Configuration'); + throw new Error('Missing default OIDC Configuration'); } }); if (modes.filter((mode) => mode.authorizationType === AuthorizationType.API_KEY).length > 1) { diff --git a/packages/@aws-cdk/aws-ec2/lib/volume.ts b/packages/@aws-cdk/aws-ec2/lib/volume.ts index 64f920866a17b..a25ca459b7c63 100644 --- a/packages/@aws-cdk/aws-ec2/lib/volume.ts +++ b/packages/@aws-cdk/aws-ec2/lib/volume.ts @@ -614,6 +614,8 @@ export class Volume extends VolumeBase { }); resource.applyRemovalPolicy(props.removalPolicy); + if (props.volumeName) Tags.of(resource).add('Name', props.volumeName); + this.volumeId = resource.ref; this.availabilityZone = props.availabilityZone; this.encryptionKey = props.encryptionKey; diff --git a/packages/@aws-cdk/aws-ec2/test/volume.test.ts b/packages/@aws-cdk/aws-ec2/test/volume.test.ts index 308e1ad4fa1ef..af88164fcc439 100644 --- a/packages/@aws-cdk/aws-ec2/test/volume.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/volume.test.ts @@ -32,6 +32,7 @@ describe('volume', () => { new Volume(stack, 'Volume', { availabilityZone: 'us-east-1a', size: cdk.Size.gibibytes(8), + volumeName: 'MyVolume', }); // THEN @@ -40,6 +41,12 @@ describe('volume', () => { MultiAttachEnabled: false, Size: 8, VolumeType: 'gp2', + Tags: [ + { + Key: 'Name', + Value: 'MyVolume', + }, + ], }, ResourcePart.Properties)); cdkExpect(stack).to(haveResource('AWS::EC2::Volume', { diff --git a/yarn.lock b/yarn.lock index 7e67161d74f5e..66bb214514901 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1628,7 +1628,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^26.0.24": +"@types/jest@^26.0.22", "@types/jest@^26.0.24": version "26.0.24" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.24.tgz#943d11976b16739185913a1936e0de0c4a7d595a" integrity sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w== From 779092c326821b209bb648a0b784992debff59b1 Mon Sep 17 00:00:00 2001 From: peterwoodworth Date: Thu, 29 Jul 2021 17:23:08 -0700 Subject: [PATCH 3/3] fix: volumename doesn't set name of ec2 volume --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 66bb214514901..7e67161d74f5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1628,7 +1628,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^26.0.22", "@types/jest@^26.0.24": +"@types/jest@^26.0.24": version "26.0.24" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.24.tgz#943d11976b16739185913a1936e0de0c4a7d595a" integrity sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w==