Resources: GetHtmlFunction: Type: AWS::Serverless::Function Properties: CodeUri: s3://sam-demo-bucket/member_portal.zip Handler: index.handler Runtime: nodejs12.x ExplicitApi: Type: AWS::Serverless::Api Properties: StageName: Prod DefinitionBody: info: version: '1.0' title: Ref: AWS::StackName securityDefinitions: # 1 Add security definition CognitoAuthorizer: type: apiKey name: Authorization in: header x-amazon-apigateway-authtype: cognito_user_pools x-amazon-apigateway-authorizer: providerARNs: - # userPool ARN type: cognito_user_pools paths: /{proxy+}: x-amazon-apigateway-any-method: x-amazon-apigateway-integration: httpMethod: POST type: aws_proxy uri: Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetHtmlFunction.Arn}/invocations responses: {} openapi: 3.0.0