Skip to content

Commit

Permalink
fix(appsync): GraphQLApi.UserPoolConfig requires DefaultAction (#…
Browse files Browse the repository at this point in the history
…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*
  • Loading branch information
civilizeddev committed Aug 28, 2020
1 parent d5e1cc6 commit 6114045
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-appsync/lib/graphqlapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export class GraphQLApi extends GraphqlApiBase {
userPoolId: config.userPool.userPoolId,
awsRegion: config.userPool.stack.region,
appIdClientRegex: config.appIdClientRegex,
defaultAction: config.defaultAction,
defaultAction: config.defaultAction || UserPoolDefaultAction.ALLOW,
};
}

Expand Down
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-appsync/test/appsync-auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ describe('AppSync User Pool Authorization', () => {
AuthenticationType: 'AMAZON_COGNITO_USER_POOLS',
UserPoolConfig: {
AwsRegion: { Ref: 'AWS::Region' },
DefaultAction: 'ALLOW',
UserPoolId: { Ref: 'pool056F3F7E' },
},
});
Expand Down Expand Up @@ -371,6 +372,7 @@ describe('AppSync User Pool Authorization', () => {
AuthenticationType: 'AMAZON_COGNITO_USER_POOLS',
UserPoolConfig: {
AwsRegion: { Ref: 'AWS::Region' },
DefaultAction: 'ALLOW',
UserPoolId: { Ref: 'pool056F3F7E' },
},
AdditionalAuthenticationProviders: [
Expand Down
2 changes: 0 additions & 2 deletions packages/@aws-cdk/aws-appsync/test/integ.graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
MappingTemplate,
PrimaryKey,
Schema,
UserPoolDefaultAction,
Values,
} from '../lib';

Expand Down Expand Up @@ -42,7 +41,6 @@ const api = new GraphQLApi(stack, 'Api', {
authorizationType: AuthorizationType.USER_POOL,
userPoolConfig: {
userPool,
defaultAction: UserPoolDefaultAction.ALLOW,
},
},
additionalAuthorizationModes: [
Expand Down

0 comments on commit 6114045

Please sign in to comment.