Skip to content

Commit 6114045

Browse files
authored
fix(appsync): GraphQLApi.UserPoolConfig requires DefaultAction (#10031)
Set UserPoolConfig default action to 'allow' fixes #10028 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent d5e1cc6 commit 6114045

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ export class GraphQLApi extends GraphqlApiBase {
531531
userPoolId: config.userPool.userPoolId,
532532
awsRegion: config.userPool.stack.region,
533533
appIdClientRegex: config.appIdClientRegex,
534-
defaultAction: config.defaultAction,
534+
defaultAction: config.defaultAction || UserPoolDefaultAction.ALLOW,
535535
};
536536
}
537537

packages/@aws-cdk/aws-appsync/test/appsync-auth.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ describe('AppSync User Pool Authorization', () => {
250250
AuthenticationType: 'AMAZON_COGNITO_USER_POOLS',
251251
UserPoolConfig: {
252252
AwsRegion: { Ref: 'AWS::Region' },
253+
DefaultAction: 'ALLOW',
253254
UserPoolId: { Ref: 'pool056F3F7E' },
254255
},
255256
});
@@ -371,6 +372,7 @@ describe('AppSync User Pool Authorization', () => {
371372
AuthenticationType: 'AMAZON_COGNITO_USER_POOLS',
372373
UserPoolConfig: {
373374
AwsRegion: { Ref: 'AWS::Region' },
375+
DefaultAction: 'ALLOW',
374376
UserPoolId: { Ref: 'pool056F3F7E' },
375377
},
376378
AdditionalAuthenticationProviders: [

packages/@aws-cdk/aws-appsync/test/integ.graphql.ts

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
MappingTemplate,
1010
PrimaryKey,
1111
Schema,
12-
UserPoolDefaultAction,
1312
Values,
1413
} from '../lib';
1514

@@ -42,7 +41,6 @@ const api = new GraphQLApi(stack, 'Api', {
4241
authorizationType: AuthorizationType.USER_POOL,
4342
userPoolConfig: {
4443
userPool,
45-
defaultAction: UserPoolDefaultAction.ALLOW,
4644
},
4745
},
4846
additionalAuthorizationModes: [

0 commit comments

Comments
 (0)