I have “external” UserPool on my AWS account - by external I mean that it’s created through AWS console, not by serverless / CloudFormation template. I want it to stay “external” to serverless stack, I don’t want to specify it in serverless.yml Resources. It works as authorizer (I am passing user pool arn as ENV variable to sls cli/config) however it fails when I want to set preSignUp trigger. From docs it states that I should pass user pool name to cognitoUserPool event. However serverless instead of using existing user pool it creates another one with exactly same name. I am looking for an option to pass user pool ARN instead of name to preSignUp trigger to reference existing user pool. Is it possible? Here is part of my serverless.yml
functions:
graphql:
handler: dist/app.handler
events:
- http:
path: graphql
method: post
cors: true
authorizer:
name: authorizer
arn: ${env:MEMBER_POOL_ARN} # <- this one works
convertTextToSpeech:
handler: dist/backgroundTasks/convertTextToSpeech.handler
events:
- sns:
topicName: convertTextToSpeech
displayName: Convert text to speech
preSignUp:
handler: dist/hooks/preSignUp.handler
events:
- cognitoUserPool:
pool: ${env:MEMBER_POOL_NAME} # <- this one creates another pool with same name (note that I am passing name here, not ARN; passing ARN here generates config validation error)
trigger: PreSignUp