AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: simple-app

Globals:
  Function:
    Timeout: 30
    Environment:
      Variables:
        BUGSNAG_API_KEY:
        BUGSNAG_NOTIFY_ENDPOINT:
        BUGSNAG_SESSIONS_ENDPOINT:
        BUGSNAG_AUTO_TRACK_SESSIONS: true
        BUGSNAG_AUTO_DETECT_ERRORS: true

Resources:
  AsyncUnhandledExceptionFunctionNode14:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: async/
      Handler: unhandled-exception.lambdaHandler
      Runtime: nodejs14.x
      Events:
        AsyncUnhandledException:
          Type: Api
          Properties:
            Path: /async/unhandled/exception
            Method: get

  AsyncHandledExceptionFunctionNode14:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: async/
      Handler: handled-exception.lambdaHandler
      Runtime: nodejs14.x
      Events:
        AsyncHandledException:
          Type: Api
          Properties:
            Path: /async/handled/exception
            Method: get

  AsyncPromiseRejectionFunctionNode14:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: async/
      Handler: promise-rejection.lambdaHandler
      Runtime: nodejs14.x
      Events:
        AsyncPromiseRejection:
          Type: Api
          Properties:
            Path: /async/promise/rejection
            Method: get

  CallbackUnhandledExceptionFunctionNode14:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: callback/
      Handler: unhandled-exception.lambdaHandler
      Runtime: nodejs14.x
      Events:
        CallbackUnhandledException:
          Type: Api
          Properties:
            Path: /callback/unhandled/exception
            Method: get

  CallbackThrownUnhandledExceptionFunctionNode14:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: callback/
      Handler: thrown-unhandled-exception.lambdaHandler
      Runtime: nodejs14.x
      Events:
        CallbackThrownUnhandledException:
          Type: Api
          Properties:
            Path: /callback/thrown/unhandled/exception
            Method: get

  CallbackHandledExceptionFunctionNode14:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: callback/
      Handler: handled-exception.lambdaHandler
      Runtime: nodejs14.x
      Events:
        CallbackHandledException:
          Type: Api
          Properties:
            Path: /callback/handled/exception
            Method: get

  CallbackPromiseRejectionFunctionNode14:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: callback/
      Handler: promise-rejection.lambdaHandler
      Runtime: nodejs14.x
      Events:
        CallbackPromiseRejection:
          Type: Api
          Properties:
            Path: /callback/promise/rejection
            Method: get

  AsyncUnhandledExceptionFunctionNode12:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: async/
      Handler: unhandled-exception.lambdaHandler
      Runtime: nodejs12.x
      Events:
        AsyncUnhandledException:
          Type: Api
          Properties:
            Path: /async/unhandled/exception
            Method: get

  AsyncHandledExceptionFunctionNode12:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: async/
      Handler: handled-exception.lambdaHandler
      Runtime: nodejs12.x
      Events:
        AsyncHandledException:
          Type: Api
          Properties:
            Path: /async/handled/exception
            Method: get

  AsyncPromiseRejectionFunctionNode12:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: async/
      Handler: promise-rejection.lambdaHandler
      Runtime: nodejs12.x
      Events:
        AsyncPromiseRejection:
          Type: Api
          Properties:
            Path: /async/promise/rejection
            Method: get

  CallbackUnhandledExceptionFunctionNode12:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: callback/
      Handler: unhandled-exception.lambdaHandler
      Runtime: nodejs12.x
      Events:
        CallbackUnhandledException:
          Type: Api
          Properties:
            Path: /callback/unhandled/exception
            Method: get

  CallbackThrownUnhandledExceptionFunctionNode12:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: callback/
      Handler: thrown-unhandled-exception.lambdaHandler
      Runtime: nodejs12.x
      Events:
        CallbackThrownUnhandledException:
          Type: Api
          Properties:
            Path: /callback/thrown/unhandled/exception
            Method: get

  CallbackHandledExceptionFunctionNode12:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: callback/
      Handler: handled-exception.lambdaHandler
      Runtime: nodejs12.x
      Events:
        CallbackHandledException:
          Type: Api
          Properties:
            Path: /callback/handled/exception
            Method: get

  CallbackPromiseRejectionFunctionNode12:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: callback/
      Handler: promise-rejection.lambdaHandler
      Runtime: nodejs12.x
      Events:
        CallbackPromiseRejection:
          Type: Api
          Properties:
            Path: /callback/promise/rejection
            Method: get
