Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aws-appsync] Invalid default effect type. (UserPoolConfig.defaultAction) #10028

Closed
civilizeddev opened this issue Aug 28, 2020 · 0 comments · Fixed by #10031
Closed

[aws-appsync] Invalid default effect type. (UserPoolConfig.defaultAction) #10028

civilizeddev opened this issue Aug 28, 2020 · 0 comments · Fixed by #10031
Assignees
Labels
@aws-cdk/aws-appsync Related to AWS AppSync bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@civilizeddev
Copy link
Contributor

civilizeddev commented Aug 28, 2020

Problem

CloudFormation suddenly throws:

Invalid default effect type. (Service: AWSAppSync; Status Code: 400; Error Code: BadRequestException)

even though AWS::AppSync::GraphQLApi UserPoolConfig takes DefaultAction as not-required.

So I destroyed the stack to redeploy it because of this issue.

But the redeployment also failed.

I believe the cause must be:

* Default auth action
*
* @default ALLOW
*/
readonly defaultAction?: UserPoolDefaultAction;

private setupUserPoolConfig(config?: UserPoolConfig) {
if (!config) return undefined;
return {
userPoolId: config.userPool.userPoolId,
awsRegion: config.userPool.stack.region,
appIdClientRegex: config.appIdClientRegex,
defaultAction: config.defaultAction,
};
}

This should be like:

 private setupUserPoolConfig(config?: UserPoolConfig) { 
   if (!config) return undefined; 
   return { 
     userPoolId: config.userPool.userPoolId, 
     awsRegion: config.userPool.stack.region, 
     appIdClientRegex: config.appIdClientRegex, 
     defaultAction: config.defaultAction || UserPoolDefaultAction.ALLOW,
   }; 
 } 

Reproduction Steps

new appsync.GraphQLApi(this, 'api', {
  authorizationConfig: {
    defaultAuthorization: {
      authorizationType: appsync.AuthorizationType.USER_POOL,
      userPoolConfig: {
        // missing defaultAction
        userPool: this.deps.userPool,
      },
    },
  },
})

What did you expect to happen?

No difference.

What actually happened?

Invalid default effect type. (Service: AWSAppSync; Status Code: 400; Error Code: BadRequestException)

Environment

  • CLI Version : 1.61.0
  • Framework Version: 1.61.0
  • Node.js Version: 14.8.0
  • OS : macOS
  • Language (Version): TypeScript 4.0.2

Other


This is 🐛 Bug Report

@civilizeddev civilizeddev added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 28, 2020
@github-actions github-actions bot added the @aws-cdk/aws-appsync Related to AWS AppSync label Aug 28, 2020
@mergify mergify bot closed this as completed in #10031 Aug 28, 2020
mergify bot pushed a commit that referenced this issue Aug 28, 2020
…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*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-appsync Related to AWS AppSync bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants