Search code examples
amazon-web-servicesaws-api-gatewayamazon-cognito

DIfferent Cognito Pool Authorizer by Api Gateway Stages


We have 3 stages on our API Gateway (Development, Testing, Production) they use a Cognito User Pool Authorizer for authorization, each one of the stages has a different User Pool so this configuration must be dynamic.

The problem: How do i configure the Auhtorizer for my API so that each API stage checks the authorization in the correct user pool?

PS: The Authorizer isn't a custom lambda function, it's the default Cognito authorizer.


Solution

  • According to a thread on the AWS forums that has since been "archived", AWS doesn't currently support this.

    Your best bet seems to be a multi-stack solution, where instead of stages you have separate APIs for the different environments.

    See also this post for some more information.