Resources: MyApiWithCognitoAuth: Type: AWS::Serverless::Api Properties: StageName: Prod Auth: DefaultAuthorizer: MyCognitoAuth Authorizers: MyCognitoAuth: UserPoolArn: !GetAtt MyUserPool.Arn MyApiWithLambdaTokenAuth: Type: AWS::Serverless::Api Properties: StageName: Prod Auth: DefaultAuthorizer: MyLambdaTokenAuth Authorizers: MyLambdaTokenAuth: FunctionArn: !GetAtt MyAuthFn.Arn MyApiWithLambdaRequestAuth: Type: AWS::Serverless::Api Properties: StageName: Prod Auth: DefaultAuthorizer: MyLambdaRequestAuth Authorizers: MyLambdaRequestAuth: FunctionPayloadType: REQUEST FunctionArn: !GetAtt MyAuthFn.Arn Identity: Headers: - Authorization1 MyApiWithNotCachedLambdaRequestAuth: Type: AWS::Serverless::Api Properties: StageName: Prod Auth: DefaultAuthorizer: MyLambdaRequestAuth Authorizers: MyLambdaRequestAuth: FunctionPayloadType: REQUEST FunctionArn: !GetAtt MyAuthFn.Arn Identity: ReauthorizeEvery: 0 MyAuthFn: Type: AWS::Serverless::Function Properties: CodeUri: s3://bucket/key Handler: index.handler Runtime: nodejs12.x MyFn: Type: AWS::Serverless::Function Properties: CodeUri: s3://bucket/key Handler: index.handler Runtime: nodejs12.x Events: Cognito: Type: Api Properties: RestApiId: !Ref MyApiWithCognitoAuth Method: get Path: /cognito CognitoAnyMethod: Type: Api Properties: RestApiId: !Ref MyApiWithCognitoAuth Method: any Path: /any/cognito LambdaToken: Type: Api Properties: RestApiId: !Ref MyApiWithLambdaTokenAuth Method: get Path: /lambda-token LambdaTokenAnyMethod: Type: Api Properties: RestApiId: !Ref MyApiWithLambdaTokenAuth Method: any Path: /any/lambda-token LambdaRequest: Type: Api Properties: RestApiId: !Ref MyApiWithLambdaRequestAuth Method: get Path: /lambda-request LambdaRequestAnyMethod: Type: Api Properties: RestApiId: !Ref MyApiWithLambdaRequestAuth Method: any Path: /any/lambda-request LambdaNotCachedRequest: Type: Api Properties: RestApiId: !Ref MyApiWithNotCachedLambdaRequestAuth Method: get Path: /not-cached-lambda-request MyUserPool: Type: AWS::Cognito::UserPool Properties: UserPoolName: UserPoolName Policies: PasswordPolicy: MinimumLength: 8 UsernameAttributes: - email Schema: - AttributeDataType: String Name: email Required: false