---
  AWSTemplateFormatVersion: "2010-09-09"
  Description: "The AWS CloudFormation template for this Serverless application"
  Resources: 
    ServerlessDeploymentBucket: 
      Type: "AWS::S3::Bucket"
      Properties: 
        BucketEncryption: 
          ServerSideEncryptionConfiguration: 
            - 
              ServerSideEncryptionByDefault: 
                SSEAlgorithm: "AES256"
    ServerlessDeploymentBucketPolicy: 
      Type: "AWS::S3::BucketPolicy"
      Properties: 
        Bucket: 
          Ref: "ServerlessDeploymentBucket"
        PolicyDocument: 
          Statement: 
            - 
              Action: "s3:*"
              Effect: "Deny"
              Principal: "*"
              Resource: 
                - 
                  Fn::Join: 
                    - ""
                    - 
                      - "arn:"
                      - 
                        Ref: "AWS::Partition"
                      - ":s3:::"
                      - 
                        Ref: "ServerlessDeploymentBucket"
                      - "/*"
                - 
                  Fn::Join: 
                    - ""
                    - 
                      - "arn:"
                      - 
                        Ref: "AWS::Partition"
                      - ":s3:::"
                      - 
                        Ref: "ServerlessDeploymentBucket"
              Condition: 
                Bool: 
                  aws:SecureTransport: false
    HelloLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "/aws/lambda/serverless-test-project-dev-hello"
    PingLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "/aws/lambda/serverless-test-project-dev-ping"
    ThrottlerLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "/aws/lambda/serverless-test-project-dev-throttler"
    DriveStreamLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "/aws/lambda/serverless-test-project-dev-driveStream"
    DriveQueueLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "/aws/lambda/serverless-test-project-dev-driveQueue"
    DriveTableLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "/aws/lambda/serverless-test-project-dev-driveTable"
    StreamProcessorLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "/aws/lambda/serverless-test-project-dev-streamProcessor"
    HttpGetterLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "/aws/lambda/serverless-test-project-dev-httpGetter"
    SubscriptionHandlerLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "/aws/lambda/serverless-test-project-dev-subscriptionHandler"
    EventsRuleLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "/aws/lambda/serverless-test-project-dev-eventsRule"
    IamRoleLambdaExecution: 
      Type: "AWS::IAM::Role"
      Properties: 
        AssumeRolePolicyDocument: 
          Version: "2012-10-17"
          Statement: 
            - 
              Effect: "Allow"
              Principal: 
                Service: 
                  - "lambda.amazonaws.com"
              Action: 
                - "sts:AssumeRole"
        Policies: 
          - 
            PolicyName: 
              Fn::Join: 
                - "-"
                - 
                  - "serverless-test-project"
                  - "dev"
                  - "lambda"
            PolicyDocument: 
              Version: "2012-10-17"
              Statement: 
                - 
                  Effect: "Allow"
                  Action: 
                    - "logs:CreateLogStream"
                    - "logs:CreateLogGroup"
                    - "logs:TagResource"
                  Resource: 
                    - 
                      Fn::Sub: "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/serverless-test-project-dev*:*"
                - 
                  Effect: "Allow"
                  Action: 
                    - "logs:PutLogEvents"
                  Resource: 
                    - 
                      Fn::Sub: "arn:${AWS::Partition}:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/serverless-test-project-dev*:*:*"
                - 
                  Effect: "Allow"
                  Action: 
                    - "kinesis:GetRecords"
                    - "kinesis:GetShardIterator"
                    - "kinesis:DescribeStream"
                    - "kinesis:ListStreams"
                  Resource: 
                    - 
                      Fn::GetAtt: 
                        - "stream"
                        - "Arn"
        Path: "/"
        RoleName: 
          Fn::Join: 
            - "-"
            - 
              - "serverless-test-project"
              - "dev"
              - 
                Ref: "AWS::Region"
              - "lambdaRole"
    HelloLambdaFunction: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Code: 
          S3Bucket: 
            Ref: "ServerlessDeploymentBucket"
          S3Key: "serverless/serverless-test-project/dev/1701792788693-2023-12-05T16:13:08.693Z/serverless-test-project.zip"
        Handler: "basic-handler.hello"
        Runtime: "nodejs18.x"
        FunctionName: "serverless-test-project-dev-hello"
        MemorySize: 1024
        Timeout: 6
        Role: 
          Fn::GetAtt: 
            - "IamRoleLambdaExecution"
            - "Arn"
      DependsOn: 
        - "HelloLogGroup"
      Metadata: 
        slicWatch: 
          alarms: 
            Lambda: 
              Invocations: 
                Threshold: 2
    PingLambdaFunction: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Code: 
          S3Bucket: 
            Ref: "ServerlessDeploymentBucket"
          S3Key: "serverless/serverless-test-project/dev/1701792788693-2023-12-05T16:13:08.693Z/serverless-test-project.zip"
        Handler: "basic-handler.hello"
        Runtime: "nodejs18.x"
        FunctionName: "serverless-test-project-dev-ping"
        MemorySize: 1024
        Timeout: 6
        Role: 
          Fn::GetAtt: 
            - "IamRoleLambdaExecution"
            - "Arn"
      DependsOn: 
        - "PingLogGroup"
      Metadata: 
        slicWatch: 
          dashboard: 
            enabled: false
    ThrottlerLambdaFunction: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Code: 
          S3Bucket: 
            Ref: "ServerlessDeploymentBucket"
          S3Key: "serverless/serverless-test-project/dev/1701792788693-2023-12-05T16:13:08.693Z/serverless-test-project.zip"
        Handler: "basic-handler.hello"
        Runtime: "nodejs18.x"
        FunctionName: "serverless-test-project-dev-throttler"
        MemorySize: 1024
        Timeout: 6
        Role: 
          Fn::GetAtt: 
            - "IamRoleLambdaExecution"
            - "Arn"
        ReservedConcurrentExecutions: 0
      DependsOn: 
        - "ThrottlerLogGroup"
      Metadata: 
        slicWatch: {}
    DriveStreamLambdaFunction: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Code: 
          S3Bucket: 
            Ref: "ServerlessDeploymentBucket"
          S3Key: "serverless/serverless-test-project/dev/1701792788693-2023-12-05T16:13:08.693Z/serverless-test-project.zip"
        Handler: "stream-test-handler.handleDrive"
        Runtime: "nodejs18.x"
        FunctionName: "serverless-test-project-dev-driveStream"
        MemorySize: 1024
        Timeout: 6
        Environment: 
          Variables: 
            STREAM_NAME: 
              Ref: "stream"
        Role: 
          Fn::GetAtt: 
            - "IamRoleLambdaExecution"
            - "Arn"
      DependsOn: 
        - "DriveStreamLogGroup"
      Metadata: 
        slicWatch: {}
    DriveQueueLambdaFunction: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Code: 
          S3Bucket: 
            Ref: "ServerlessDeploymentBucket"
          S3Key: "serverless/serverless-test-project/dev/1701792788693-2023-12-05T16:13:08.693Z/serverless-test-project.zip"
        Handler: "queue-test-handler.handleDrive"
        Runtime: "nodejs18.x"
        FunctionName: "serverless-test-project-dev-driveQueue"
        MemorySize: 1024
        Timeout: 6
        Role: 
          Fn::GetAtt: 
            - "IamRoleLambdaExecution"
            - "Arn"
      DependsOn: 
        - "DriveQueueLogGroup"
      Metadata: 
        slicWatch: {}
    DriveTableLambdaFunction: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Code: 
          S3Bucket: 
            Ref: "ServerlessDeploymentBucket"
          S3Key: "serverless/serverless-test-project/dev/1701792788693-2023-12-05T16:13:08.693Z/serverless-test-project.zip"
        Handler: "table-test-hander.handleDrive"
        Runtime: "nodejs18.x"
        FunctionName: "serverless-test-project-dev-driveTable"
        MemorySize: 1024
        Timeout: 6
        Role: 
          Fn::GetAtt: 
            - "IamRoleLambdaExecution"
            - "Arn"
      DependsOn: 
        - "DriveTableLogGroup"
      Metadata: 
        slicWatch: {}
    StreamProcessorLambdaFunction: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Code: 
          S3Bucket: 
            Ref: "ServerlessDeploymentBucket"
          S3Key: "serverless/serverless-test-project/dev/1701792788693-2023-12-05T16:13:08.693Z/serverless-test-project.zip"
        Handler: "stream-handler.handle"
        Runtime: "nodejs18.x"
        FunctionName: "serverless-test-project-dev-streamProcessor"
        MemorySize: 1024
        Timeout: 6
        Role: 
          Fn::GetAtt: 
            - "IamRoleLambdaExecution"
            - "Arn"
      DependsOn: 
        - "StreamProcessorLogGroup"
      Metadata: 
        slicWatch: {}
    HttpGetterLambdaFunction: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Code: 
          S3Bucket: 
            Ref: "ServerlessDeploymentBucket"
          S3Key: "serverless/serverless-test-project/dev/1701792788693-2023-12-05T16:13:08.693Z/serverless-test-project.zip"
        Handler: "apigw-handler.handleGet"
        Runtime: "nodejs18.x"
        FunctionName: "serverless-test-project-dev-httpGetter"
        MemorySize: 1024
        Timeout: 30
        Role: 
          Fn::GetAtt: 
            - "IamRoleLambdaExecution"
            - "Arn"
      DependsOn: 
        - "HttpGetterLogGroup"
      Metadata: 
        slicWatch: {}
    SubscriptionHandlerLambdaFunction: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Code: 
          S3Bucket: 
            Ref: "ServerlessDeploymentBucket"
          S3Key: "serverless/serverless-test-project/dev/1701792788693-2023-12-05T16:13:08.693Z/serverless-test-project.zip"
        Handler: "apigw-handler.handleSubscription"
        Runtime: "nodejs18.x"
        FunctionName: "serverless-test-project-dev-subscriptionHandler"
        MemorySize: 1024
        Timeout: 30
        Role: 
          Fn::GetAtt: 
            - "IamRoleLambdaExecution"
            - "Arn"
      DependsOn: 
        - "SubscriptionHandlerLogGroup"
      Metadata: 
        slicWatch: {}
    EventsRuleLambdaFunction: 
      Type: "AWS::Lambda::Function"
      Properties: 
        Code: 
          S3Bucket: 
            Ref: "ServerlessDeploymentBucket"
          S3Key: "serverless/serverless-test-project/dev/1701792788693-2023-12-05T16:13:08.693Z/serverless-test-project.zip"
        Handler: "rule-handler.handleRule"
        Runtime: "nodejs18.x"
        FunctionName: "serverless-test-project-dev-eventsRule"
        MemorySize: 1024
        Timeout: 6
        Role: 
          Fn::GetAtt: 
            - "IamRoleLambdaExecution"
            - "Arn"
      DependsOn: 
        - "EventsRuleLogGroup"
      Metadata: 
        slicWatch: 
          alarms: 
            Lambda: 
              enabled: false
    HelloLambdaVersionf42jv6Soivw25tYtUcrbFwOQEe9r1Gm34YtgGMrPRgk: 
      Type: "AWS::Lambda::Version"
      DeletionPolicy: "Retain"
      Properties: 
        FunctionName: 
          Ref: "HelloLambdaFunction"
        CodeSha256: "x4BBRU8H8eI5d76pgM61FHBjsk7qAO0pFBi6yBCXhyM="
    PingLambdaVersionQn5C3FCwaJxuyEFz1PB1TbidW97srv2gHaU7DXZns: 
      Type: "AWS::Lambda::Version"
      DeletionPolicy: "Retain"
      Properties: 
        FunctionName: 
          Ref: "PingLambdaFunction"
        CodeSha256: "x4BBRU8H8eI5d76pgM61FHBjsk7qAO0pFBi6yBCXhyM="
    ThrottlerLambdaVersiontRCTuOU8MbmZc930qzPjGs9fBwa7TSeXpdGX5TEBl4: 
      Type: "AWS::Lambda::Version"
      DeletionPolicy: "Retain"
      Properties: 
        FunctionName: 
          Ref: "ThrottlerLambdaFunction"
        CodeSha256: "x4BBRU8H8eI5d76pgM61FHBjsk7qAO0pFBi6yBCXhyM="
    DriveStreamLambdaVersionP4u4hk59XD9172r9elN9B3yQAKgOqsVMcEqn33HWk: 
      Type: "AWS::Lambda::Version"
      DeletionPolicy: "Retain"
      Properties: 
        FunctionName: 
          Ref: "DriveStreamLambdaFunction"
        CodeSha256: "x4BBRU8H8eI5d76pgM61FHBjsk7qAO0pFBi6yBCXhyM="
    DriveQueueLambdaVersionO9yL7x2X7on8V1vfBzVj8OmtJsaRIkID1qjEuFRNI: 
      Type: "AWS::Lambda::Version"
      DeletionPolicy: "Retain"
      Properties: 
        FunctionName: 
          Ref: "DriveQueueLambdaFunction"
        CodeSha256: "x4BBRU8H8eI5d76pgM61FHBjsk7qAO0pFBi6yBCXhyM="
    DriveTableLambdaVersionCeL14112extLbZpU9IBiLCw0gjivyaXaSf664bPnc: 
      Type: "AWS::Lambda::Version"
      DeletionPolicy: "Retain"
      Properties: 
        FunctionName: 
          Ref: "DriveTableLambdaFunction"
        CodeSha256: "x4BBRU8H8eI5d76pgM61FHBjsk7qAO0pFBi6yBCXhyM="
    StreamProcessorLambdaVersionVV0TLuhlwFPLxKh4EkN9lxAkgiMhMGAQYjd59YkRg4: 
      Type: "AWS::Lambda::Version"
      DeletionPolicy: "Retain"
      Properties: 
        FunctionName: 
          Ref: "StreamProcessorLambdaFunction"
        CodeSha256: "x4BBRU8H8eI5d76pgM61FHBjsk7qAO0pFBi6yBCXhyM="
    HttpGetterLambdaVersionXJnLiB6AgdCzJn6ySnDV3jZfZFbgvZRNWY853JOnws: 
      Type: "AWS::Lambda::Version"
      DeletionPolicy: "Retain"
      Properties: 
        FunctionName: 
          Ref: "HttpGetterLambdaFunction"
        CodeSha256: "x4BBRU8H8eI5d76pgM61FHBjsk7qAO0pFBi6yBCXhyM="
    SubscriptionHandlerLambdaVersionRV0txVJkRLsjV5coDIOXnNx4aRSCVyx5VOtiMOYugQ: 
      Type: "AWS::Lambda::Version"
      DeletionPolicy: "Retain"
      Properties: 
        FunctionName: 
          Ref: "SubscriptionHandlerLambdaFunction"
        CodeSha256: "x4BBRU8H8eI5d76pgM61FHBjsk7qAO0pFBi6yBCXhyM="
    EventsRuleLambdaVersioneJD8sIr8CoIFP1PPQEJI0gOwr9VlQOhSPmtxEJmpcA: 
      Type: "AWS::Lambda::Version"
      DeletionPolicy: "Retain"
      Properties: 
        FunctionName: 
          Ref: "EventsRuleLambdaFunction"
        CodeSha256: "x4BBRU8H8eI5d76pgM61FHBjsk7qAO0pFBi6yBCXhyM="
    WorkflowRole: 
      Type: "AWS::IAM::Role"
      Properties: 
        AssumeRolePolicyDocument: 
          Version: "2012-10-17"
          Statement: 
            - 
              Effect: "Allow"
              Principal: 
                Service: 
                  Fn::Sub: "states.${AWS::Region}.amazonaws.com"
              Action: "sts:AssumeRole"
        Policies: 
          - 
            PolicyName: "dev-serverless-test-project-statemachine"
            PolicyDocument: 
              Version: "2012-10-17"
              Statement: 
                - 
                  Effect: "Allow"
                  Action: 
                    - "lambda:InvokeFunction"
                  Resource: 
                    - 
                      Fn::GetAtt: 
                        - "PingLambdaFunction"
                        - "Arn"
                    - 
                      Fn::Sub: 
                        - "${functionArn}:*"
                        - 
                          functionArn: 
                            Fn::GetAtt: 
                              - "PingLambdaFunction"
                              - "Arn"
                - 
                  Effect: "Allow"
                  Action: 
                    - "logs:CreateLogDelivery"
                    - "logs:GetLogDelivery"
                    - "logs:UpdateLogDelivery"
                    - "logs:DeleteLogDelivery"
                    - "logs:ListLogDeliveries"
                    - "logs:PutResourcePolicy"
                    - "logs:DescribeResourcePolicies"
                    - "logs:DescribeLogGroups"
                  Resource: "*"
    ExpressWorkflowRole: 
      Type: "AWS::IAM::Role"
      Properties: 
        AssumeRolePolicyDocument: 
          Version: "2012-10-17"
          Statement: 
            - 
              Effect: "Allow"
              Principal: 
                Service: 
                  Fn::Sub: "states.${AWS::Region}.amazonaws.com"
              Action: "sts:AssumeRole"
        Policies: 
          - 
            PolicyName: "dev-serverless-test-project-statemachine"
            PolicyDocument: 
              Version: "2012-10-17"
              Statement: 
                - 
                  Effect: "Allow"
                  Action: 
                    - "lambda:InvokeFunction"
                  Resource: 
                    - 
                      Fn::GetAtt: 
                        - "PingLambdaFunction"
                        - "Arn"
                    - 
                      Fn::Sub: 
                        - "${functionArn}:*"
                        - 
                          functionArn: 
                            Fn::GetAtt: 
                              - "PingLambdaFunction"
                              - "Arn"
                - 
                  Effect: "Allow"
                  Action: 
                    - "logs:CreateLogDelivery"
                    - "logs:GetLogDelivery"
                    - "logs:UpdateLogDelivery"
                    - "logs:DeleteLogDelivery"
                    - "logs:ListLogDeliveries"
                    - "logs:PutResourcePolicy"
                    - "logs:DescribeResourcePolicies"
                    - "logs:DescribeLogGroups"
                  Resource: "*"
    Workflow: 
      Type: "AWS::StepFunctions::StateMachine"
      Properties: 
        DefinitionString: 
          Fn::Sub: 
            - "{\n  \"StartAt\": \"What Next?\",\n  \"States\": {\n    \"What Next?\": {\n      \"Type\": \"Choice\",\n      \"Choices\": [\n        {\n          \"Variable\": \"$.destination\",\n          \"StringEquals\": \"fail\",\n          \"Next\": \"Fail\"\n        },\n        {\n          \"Variable\": \"$.destination\",\n          \"StringEquals\": \"timeoutTask\",\n          \"Next\": \"TimeoutTask\"\n        },\n        {\n          \"Variable\": \"$.destination\",\n          \"StringEquals\": \"keepWaiting\",\n          \"Next\": \"KeepWaiting\"\n        }\n      ],\n      \"Default\": \"Succeed\"\n    },\n    \"TimeoutTask\": {\n      \"Type\": \"Task\",\n      \"TimeoutSeconds\": 1,\n      \"Resource\": \"${085edd942ce144c5bd80364a6e973e4d}\",\n      \"Parameters\": {\n        \"sleepSeconds\": 3\n      },\n      \"Next\": \"Succeed\"\n    },\n    \"KeepWaiting\": {\n      \"Type\": \"Wait\",\n      \"Seconds\": 1,\n      \"Next\": \"KeepWaiting\"\n    },\n    \"Fail\": {\n      \"Type\": \"Fail\"\n    },\n    \"Succeed\": {\n      \"Type\": \"Pass\",\n      \"End\": true\n    }\n  }\n}"
            - 
              085edd942ce144c5bd80364a6e973e4d: 
                Fn::GetAtt: 
                  - "PingLambdaFunction"
                  - "Arn"
        RoleArn: 
          Fn::GetAtt: 
            - "WorkflowRole"
            - "Arn"
        LoggingConfiguration: 
          Level: "ALL"
          IncludeExecutionData: true
          Destinations: 
            - 
              CloudWatchLogsLogGroup: 
                LogGroupArn: 
                  Fn::GetAtt: 
                    - "workflowLogGroup"
                    - "Arn"
        StateMachineName: "Workflow"
      DependsOn: 
        - "WorkflowRole"
    ExpressWorkflow: 
      Type: "AWS::StepFunctions::StateMachine"
      Properties: 
        DefinitionString: 
          Fn::Sub: 
            - "{\n  \"StartAt\": \"What Next?\",\n  \"States\": {\n    \"What Next?\": {\n      \"Type\": \"Choice\",\n      \"Choices\": [\n        {\n          \"Variable\": \"$.destination\",\n          \"StringEquals\": \"fail\",\n          \"Next\": \"Fail\"\n        },\n        {\n          \"Variable\": \"$.destination\",\n          \"StringEquals\": \"timeoutTask\",\n          \"Next\": \"TimeoutTask\"\n        },\n        {\n          \"Variable\": \"$.destination\",\n          \"StringEquals\": \"keepWaiting\",\n          \"Next\": \"KeepWaiting\"\n        }\n      ],\n      \"Default\": \"Succeed\"\n    },\n    \"TimeoutTask\": {\n      \"Type\": \"Task\",\n      \"TimeoutSeconds\": 1,\n      \"Resource\": \"${085edd942ce144c5bd80364a6e973e4d}\",\n      \"Parameters\": {\n        \"sleepSeconds\": 3\n      },\n      \"Next\": \"Succeed\"\n    },\n    \"KeepWaiting\": {\n      \"Type\": \"Wait\",\n      \"Seconds\": 1,\n      \"Next\": \"KeepWaiting\"\n    },\n    \"Fail\": {\n      \"Type\": \"Fail\"\n    },\n    \"Succeed\": {\n      \"Type\": \"Pass\",\n      \"End\": true\n    }\n  }\n}"
            - 
              085edd942ce144c5bd80364a6e973e4d: 
                Fn::GetAtt: 
                  - "PingLambdaFunction"
                  - "Arn"
        RoleArn: 
          Fn::GetAtt: 
            - "ExpressWorkflowRole"
            - "Arn"
        StateMachineType: "EXPRESS"
        LoggingConfiguration: 
          Level: "ALL"
          IncludeExecutionData: true
          Destinations: 
            - 
              CloudWatchLogsLogGroup: 
                LogGroupArn: 
                  Fn::GetAtt: 
                    - "expressWorkflowLogGroup"
                    - "Arn"
        StateMachineName: "ExpressWorkflow"
      DependsOn: 
        - "ExpressWorkflowRole"
    ApiGatewayRestApi: 
      Type: "AWS::ApiGateway::RestApi"
      Properties: 
        Name: "dev-serverless-test-project"
        EndpointConfiguration: 
          Types: 
            - "REGIONAL"
        Policy: ""
    ApiGatewayResourceItem: 
      Type: "AWS::ApiGateway::Resource"
      Properties: 
        ParentId: 
          Fn::GetAtt: 
            - "ApiGatewayRestApi"
            - "RootResourceId"
        PathPart: "item"
        RestApiId: 
          Ref: "ApiGatewayRestApi"
    ApiGatewayResourceSubscription: 
      Type: "AWS::ApiGateway::Resource"
      Properties: 
        ParentId: 
          Fn::GetAtt: 
            - "ApiGatewayRestApi"
            - "RootResourceId"
        PathPart: "subscription"
        RestApiId: 
          Ref: "ApiGatewayRestApi"
    ApiGatewayMethodItemGet: 
      Type: "AWS::ApiGateway::Method"
      Properties: 
        HttpMethod: "GET"
        RequestParameters: {}
        ResourceId: 
          Ref: "ApiGatewayResourceItem"
        RestApiId: 
          Ref: "ApiGatewayRestApi"
        ApiKeyRequired: false
        AuthorizationType: "NONE"
        Integration: 
          IntegrationHttpMethod: "POST"
          Type: "AWS_PROXY"
          Uri: 
            Fn::Join: 
              - ""
              - 
                - "arn:"
                - 
                  Ref: "AWS::Partition"
                - ":apigateway:"
                - 
                  Ref: "AWS::Region"
                - ":lambda:path/2015-03-31/functions/"
                - 
                  Fn::GetAtt: 
                    - "HttpGetterLambdaFunction"
                    - "Arn"
                - "/invocations"
        MethodResponses: []
      DependsOn: 
        - "HttpGetterLambdaPermissionApiGateway"
    ApiGatewayMethodSubscriptionPost: 
      Type: "AWS::ApiGateway::Method"
      Properties: 
        HttpMethod: "POST"
        RequestParameters: {}
        ResourceId: 
          Ref: "ApiGatewayResourceSubscription"
        RestApiId: 
          Ref: "ApiGatewayRestApi"
        ApiKeyRequired: false
        AuthorizationType: "NONE"
        Integration: 
          IntegrationHttpMethod: "POST"
          Type: "AWS_PROXY"
          Uri: 
            Fn::Join: 
              - ""
              - 
                - "arn:"
                - 
                  Ref: "AWS::Partition"
                - ":apigateway:"
                - 
                  Ref: "AWS::Region"
                - ":lambda:path/2015-03-31/functions/"
                - 
                  Fn::GetAtt: 
                    - "SubscriptionHandlerLambdaFunction"
                    - "Arn"
                - "/invocations"
        MethodResponses: []
      DependsOn: 
        - "SubscriptionHandlerLambdaPermissionApiGateway"
    ApiGatewayDeployment1701792785979: 
      Type: "AWS::ApiGateway::Deployment"
      Properties: 
        RestApiId: 
          Ref: "ApiGatewayRestApi"
        StageName: "dev"
      DependsOn: 
        - "ApiGatewayMethodItemGet"
        - "ApiGatewayMethodSubscriptionPost"
    HttpGetterLambdaPermissionApiGateway: 
      Type: "AWS::Lambda::Permission"
      Properties: 
        FunctionName: 
          Fn::GetAtt: 
            - "HttpGetterLambdaFunction"
            - "Arn"
        Action: "lambda:InvokeFunction"
        Principal: "apigateway.amazonaws.com"
        SourceArn: 
          Fn::Join: 
            - ""
            - 
              - "arn:"
              - 
                Ref: "AWS::Partition"
              - ":execute-api:"
              - 
                Ref: "AWS::Region"
              - ":"
              - 
                Ref: "AWS::AccountId"
              - ":"
              - 
                Ref: "ApiGatewayRestApi"
              - "/*/*"
    SubscriptionHandlerLambdaPermissionApiGateway: 
      Type: "AWS::Lambda::Permission"
      Properties: 
        FunctionName: 
          Fn::GetAtt: 
            - "SubscriptionHandlerLambdaFunction"
            - "Arn"
        Action: "lambda:InvokeFunction"
        Principal: "apigateway.amazonaws.com"
        SourceArn: 
          Fn::Join: 
            - ""
            - 
              - "arn:"
              - 
                Ref: "AWS::Partition"
              - ":execute-api:"
              - 
                Ref: "AWS::Region"
              - ":"
              - 
                Ref: "AWS::AccountId"
              - ":"
              - 
                Ref: "ApiGatewayRestApi"
              - "/*/*"
    StreamProcessorEventSourceMappingKinesisStream: 
      Type: "AWS::Lambda::EventSourceMapping"
      DependsOn: 
        - "IamRoleLambdaExecution"
      Properties: 
        BatchSize: 10
        Enabled: true
        EventSourceArn: 
          Fn::GetAtt: 
            - "stream"
            - "Arn"
        FunctionName: 
          Fn::GetAtt: 
            - "StreamProcessorLambdaFunction"
            - "Arn"
        StartingPosition: "LATEST"
        MaximumRetryAttempts: 0
    ServerlesstestprojectdeveventsRulerule1EventBridgeRule: 
      Type: "AWS::Events::Rule"
      Properties: 
        EventPattern: 
          detail-type: 
            - "Invoke Lambda Function"
        Name: "serverless-test-project-dev-eventsRule-rule-1"
        State: "ENABLED"
        Targets: 
          - 
            Arn: 
              Fn::GetAtt: 
                - "EventsRuleLambdaFunction"
                - "Arn"
            Id: "serverless-test-project-dev-eventsRule-rule-1-target"
            RetryPolicy: 
              MaximumEventAgeInSeconds: 60
              MaximumRetryAttempts: 2
    EventsRuleEventBridgeLambdaPermission1: 
      Type: "AWS::Lambda::Permission"
      Properties: 
        Action: "lambda:InvokeFunction"
        FunctionName: 
          Fn::GetAtt: 
            - "EventsRuleLambdaFunction"
            - "Arn"
        Principal: "events.amazonaws.com"
        SourceArn: 
          Fn::Join: 
            - ":"
            - 
              - "arn"
              - 
                Ref: "AWS::Partition"
              - "events"
              - 
                Ref: "AWS::Region"
              - 
                Ref: "AWS::AccountId"
              - 
                Fn::Join: 
                  - "/"
                  - 
                    - "rule"
                    - "serverless-test-project-dev-eventsRule-rule-1"
    stream: 
      Type: "AWS::Kinesis::Stream"
      Properties: 
        Name: 
          Fn::Sub: "slic-watch-test-project-stream-${AWS::AccountId}-${AWS::Region}"
        ShardCount: 1
    bucket: 
      Type: "AWS::S3::Bucket"
      Properties: 
        BucketName: 
          Fn::Sub: "slic-watch-test-project-bucket-${AWS::AccountId}-${AWS::Region}"
    dataTable: 
      Type: "AWS::DynamoDB::Table"
      DeletionPolicy: "Delete"
      Properties: 
        TableName: "MyTable"
        ProvisionedThroughput: 
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
        AttributeDefinitions: 
          - 
            AttributeName: "pk"
            AttributeType: "S"
          - 
            AttributeName: "sk"
            AttributeType: "S"
          - 
            AttributeName: "gsi1pk"
            AttributeType: "S"
          - 
            AttributeName: "gsi1sk"
            AttributeType: "S"
          - 
            AttributeName: "timestamp"
            AttributeType: "N"
        KeySchema: 
          - 
            AttributeName: "pk"
            KeyType: "HASH"
          - 
            AttributeName: "sk"
            KeyType: "RANGE"
        GlobalSecondaryIndexes: 
          - 
            IndexName: "GSI1"
            ProvisionedThroughput: 
              ReadCapacityUnits: 1
              WriteCapacityUnits: 1
            KeySchema: 
              - 
                AttributeName: "gsi1pk"
                KeyType: "HASH"
              - 
                AttributeName: "gsi1sk"
                KeyType: "RANGE"
            Projection: 
              NonKeyAttributes: 
                - "address"
              ProjectionType: "INCLUDE"
        LocalSecondaryIndexes: 
          - 
            IndexName: "LSI1"
            KeySchema: 
              - 
                AttributeName: "pk"
                KeyType: "HASH"
              - 
                AttributeName: "timestamp"
                KeyType: "RANGE"
            Projection: 
              NonKeyAttributes: 
                - "name"
              ProjectionType: "INCLUDE"
      Metadata: 
        slicWatch: 
          alarms: 
            UserErrors: 
              Threshold: 20
          dashboard: 
            ReadThrottleEvents: 
              yAxis: "right"
            WriteThrottleEvents: 
              yAxis: "right"
    regularQueue: 
      Type: "AWS::SQS::Queue"
      Properties: 
        QueueName: "SomeRegularQueue"
    fifoQueue: 
      Type: "AWS::SQS::Queue"
      Properties: 
        QueueName: "SomeFifoQueue.fifo"
        FifoQueue: true
    workflowLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "WorkflowLogs"
        RetentionInDays: 1
    expressWorkflowLogGroup: 
      Type: "AWS::Logs::LogGroup"
      Properties: 
        LogGroupName: "ExpressWorkflowLogs"
        RetentionInDays: 1
    vpc: 
      Type: "AWS::EC2::VPC"
      Properties: 
        CidrBlock: "10.0.0.0/16"
    subnet: 
      Type: "AWS::EC2::Subnet"
      Properties: 
        AvailabilityZone: "eu-west-1a"
        CidrBlock: "10.0.16.0/20"
        VpcId: 
          Ref: "vpc"
    ecsCluster: 
      Type: "AWS::ECS::Cluster"
      Properties: 
        ClusterName: "awesome-cluster"
    ecsService: 
      Type: "AWS::ECS::Service"
      Properties: 
        ServiceName: "awesome-service"
        Cluster: 
          Ref: "ecsCluster"
        DesiredCount: 0
        LaunchType: "FARGATE"
        TaskDefinition: 
          Ref: "taskDef"
        NetworkConfiguration: 
          AwsvpcConfiguration: 
            AssignPublicIp: "ENABLED"
            SecurityGroups: []
            Subnets: 
              - 
                Ref: "subnet"
    taskDef: 
      Type: "AWS::ECS::TaskDefinition"
      Properties: 
        RequiresCompatibilities: 
          - "FARGATE"
        Cpu: "256"
        Memory: "512"
        ContainerDefinitions: 
          - 
            Name: "busybox"
            Image: "busybox"
            Cpu: 256
            EntryPoint: 
              - "sh"
              - "-c"
            Memory: 512
            Command: 
              - "/bin/sh -c \"while true; do echo Hello; sleep 10; done\""
            Essential: true
        NetworkMode: "awsvpc"
    topic: 
      Type: "AWS::SNS::Topic"
      Properties: 
        TopicName: 
          Fn::Sub: "slic-watch-test-project-topic-${AWS::AccountId}-${AWS::Region}"
    subscriptionTest: 
      Type: "AWS::SNS::Subscription"
      Properties: 
        Endpoint: 
          Fn::Sub: "https://${ApiGatewayRestApi}.execute-api.${AWS::Region}.amazonaws.com/dev/subscription"
        Protocol: "https"
        TopicArn: 
          Ref: "topic"
  Outputs: 
    ServerlessDeploymentBucketName: 
      Value: 
        Ref: "ServerlessDeploymentBucket"
      Export: 
        Name: "sls-serverless-test-project-dev-ServerlessDeploymentBucketName"
    HelloLambdaFunctionQualifiedArn: 
      Description: "Current Lambda function version"
      Value: 
        Ref: "HelloLambdaVersionf42jv6Soivw25tYtUcrbFwOQEe9r1Gm34YtgGMrPRgk"
      Export: 
        Name: "sls-serverless-test-project-dev-HelloLambdaFunctionQualifiedArn"
    PingLambdaFunctionQualifiedArn: 
      Description: "Current Lambda function version"
      Value: 
        Ref: "PingLambdaVersionQn5C3FCwaJxuyEFz1PB1TbidW97srv2gHaU7DXZns"
      Export: 
        Name: "sls-serverless-test-project-dev-PingLambdaFunctionQualifiedArn"
    ThrottlerLambdaFunctionQualifiedArn: 
      Description: "Current Lambda function version"
      Value: 
        Ref: "ThrottlerLambdaVersiontRCTuOU8MbmZc930qzPjGs9fBwa7TSeXpdGX5TEBl4"
      Export: 
        Name: "sls-serverless-test-project-dev-ThrottlerLambdaFunctionQualifiedArn"
    DriveStreamLambdaFunctionQualifiedArn: 
      Description: "Current Lambda function version"
      Value: 
        Ref: "DriveStreamLambdaVersionP4u4hk59XD9172r9elN9B3yQAKgOqsVMcEqn33HWk"
      Export: 
        Name: "sls-serverless-test-project-dev-DriveStreamLambdaFunctionQualifiedArn"
    DriveQueueLambdaFunctionQualifiedArn: 
      Description: "Current Lambda function version"
      Value: 
        Ref: "DriveQueueLambdaVersionO9yL7x2X7on8V1vfBzVj8OmtJsaRIkID1qjEuFRNI"
      Export: 
        Name: "sls-serverless-test-project-dev-DriveQueueLambdaFunctionQualifiedArn"
    DriveTableLambdaFunctionQualifiedArn: 
      Description: "Current Lambda function version"
      Value: 
        Ref: "DriveTableLambdaVersionCeL14112extLbZpU9IBiLCw0gjivyaXaSf664bPnc"
      Export: 
        Name: "sls-serverless-test-project-dev-DriveTableLambdaFunctionQualifiedArn"
    StreamProcessorLambdaFunctionQualifiedArn: 
      Description: "Current Lambda function version"
      Value: 
        Ref: "StreamProcessorLambdaVersionVV0TLuhlwFPLxKh4EkN9lxAkgiMhMGAQYjd59YkRg4"
      Export: 
        Name: "sls-serverless-test-project-dev-StreamProcessorLambdaFunctionQualifiedArn"
    HttpGetterLambdaFunctionQualifiedArn: 
      Description: "Current Lambda function version"
      Value: 
        Ref: "HttpGetterLambdaVersionXJnLiB6AgdCzJn6ySnDV3jZfZFbgvZRNWY853JOnws"
      Export: 
        Name: "sls-serverless-test-project-dev-HttpGetterLambdaFunctionQualifiedArn"
    SubscriptionHandlerLambdaFunctionQualifiedArn: 
      Description: "Current Lambda function version"
      Value: 
        Ref: "SubscriptionHandlerLambdaVersionRV0txVJkRLsjV5coDIOXnNx4aRSCVyx5VOtiMOYugQ"
      Export: 
        Name: "sls-serverless-test-project-dev-SubscriptionHandlerLambdaFunctionQualifiedArn"
    EventsRuleLambdaFunctionQualifiedArn: 
      Description: "Current Lambda function version"
      Value: 
        Ref: "EventsRuleLambdaVersioneJD8sIr8CoIFP1PPQEJI0gOwr9VlQOhSPmtxEJmpcA"
      Export: 
        Name: "sls-serverless-test-project-dev-EventsRuleLambdaFunctionQualifiedArn"
    WorkflowArn: 
      Description: "Current StateMachine Arn"
      Value: 
        Ref: "Workflow"
      Export: 
        Name: "sls-serverless-test-project-dev-WorkflowArn"
    ExpressWorkflowArn: 
      Description: "Current StateMachine Arn"
      Value: 
        Ref: "ExpressWorkflow"
      Export: 
        Name: "sls-serverless-test-project-dev-ExpressWorkflowArn"
    ServiceEndpoint: 
      Description: "URL of the service endpoint"
      Value: 
        Fn::Join: 
          - ""
          - 
            - "https://"
            - 
              Ref: "ApiGatewayRestApi"
            - ".execute-api."
            - 
              Ref: "AWS::Region"
            - "."
            - 
              Ref: "AWS::URLSuffix"
            - "/dev"
      Export: 
        Name: "sls-serverless-test-project-dev-ServiceEndpoint"

