Transform: AWS::Serverless-2016-10-31 Globals: Api: MergeDefinitions: true Resources: MyApi: Type: AWS::Serverless::Api Properties: StageName: Prod DefinitionBody: swagger: '2.0' info: title: Example version: '1' paths: /test: get: security: MyAuthorizer2: [] Auth: Authorizers: MyAuthorizer: UserPoolArn: !GetAtt MyCognitoUserPool.Arn MyAuthorizer2: UserPoolArn: !GetAtt MyCognitoUserPool2.Arn MyFunction: Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: nodejs14.x InlineCode: | exports.handler = async (event, context, callback) => { return { statusCode: 200, body: 'Success' } } Events: MyEventV1: Type: Api Properties: RestApiId: !Ref MyApi Path: /test Method: get Auth: Authorizer: MyAuthorizer MyCognitoUserPool: Type: AWS::Cognito::UserPool Properties: UserPoolName: MyCognitoUserPoolRandomName MyCognitoUserPool2: Type: AWS::Cognito::UserPool Properties: UserPoolName: MyCognitoUserPoolRandomName2