0

我有以下无服务器 yaml 用于尝试部署我的第一步功能:

org: bizrob
app: flexipod-2-queue
service: flexipod-2-queue

frameworkVersion: "2 || 3"

package:
  exclude:
      # list of biggest modules that are in devdepenedecies and similar
      - node_modules/aws-sdk/**
      - node_modules/serverless-domain-manager/**
      - node_modules/@serverless
      - node_modules/serverless
      - node_modules/java-invoke-local
      - node_modules/tabtab
      - node_modules/snappy

custom:
  region: eu-west-1

provider:
  name: aws
  runtime: nodejs14.x

plugins:
  - serverless-step-functions
functions:
  GetConfigDbConnection:
    handler: flexipod-2-queue/dbConfig.getConfigDbConnection
    environment:
      REGION: ${self:custom.region}
  GetConfigRec:
    handler: flexipod-2-queue/dbConfig.getConfigRec
    environment:
      REGION: ${self:custom.region}
  GetSelectQueries:
    handler: flexipod-2-queue/dbConfig.getSelectQueries
    environment:
      REGION: ${self:custom.region}
  PullSqlSvr:
    handler: flexipod-2-queue/pullSqlSvrData.pullSqlSvr
    environment:
      REGION: ${self:custom.region}
      API_VERSION_S3: "2006-03-01"
      API_VERSION_SQS: "2012-11-05"
      SQS_QUEUE_URL: !Ref "MyQueue"
  SendToDataLake:
    handler: queue-2-datalake/sendToDataLake.sendBatchToQueue
    environment:
      REGION: ${self:custom.region}
      API_VERSION_S3: "2006-03-01"
      API_VERSION_SQS: "2012-11-05"
      

stepFunctions:
  stateMachines:
    flexipodFlow:
      name: flexipodFlow
      definition:
        StartAt: GetConfigDbConnection
        States:
          GetConfigDbConnection:
            Type: Task
            Resource:
              Fn::GetAtt: [GetConfigDbConnection, Arn]
            Next: GetConfigRec
          GetConfigRec:
            Type: Task
            Resource:
              Fn::GetAtt: [GetConfigRec, Arn]
            Next: GetSelectQueries
          GetSelectQueries:
            Type: Task
            Resource:
              Fn::GetAtt: [GetSelectQueries, Arn]
              ResultPath: $.queries
            Next: Map
          Map:
            Type: Map
            ItemsPath: $.queries
            MaxConcurrency: 2
            Next: Final State
            Iterator:
              StartAt: PullSql
              States:
                PullSql:
                  Type: Task
                  Resource:
                  Fn::GetAtt: [PullSqlSvr, Arn]
          Final State:
            Type: Pass
            End: true
resources:
  Resources:
    MyQueue:
      Type: "AWS::SQS::Queue"
      Properties:
        QueueName: "flexipod"

运行 serverless deploy 后,我看到 vscode 终端出现以下错误:

Error:
TypeError: Cannot read property 'match' of null
    at C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\serverless-step-functions\lib\deploy\stepFunctions\compileIamRole.js:472:61
    at arrayMap (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\lodash\lodash.js:653:23)
    at map (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\lodash\lodash.js:9622:14)
    at Function.flatMap (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\lodash\lodash.js:9325:26)    at ServerlessStepFunctions.getIamPermissions (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\serverless-step-functions\lib\deploy\stepFunctions\compileIamRole.js:413:12)
    at C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\serverless-step-functions\lib\deploy\stepFunctions\compileIamRole.js:522:56
    at Array.forEach (<anonymous>)
    at ServerlessStepFunctions.compileIamRole (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\serverless-step-functions\lib\deploy\stepFunctions\compileIamRole.js:511:32)
    at ServerlessStepFunctions.tryCatcher (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromiseCtx (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\bluebird\js\release\promise.js:641:10)
    at _drainQueueStep (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\bluebird\js\release\async.js:97:12)
    at _drainQueue (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (C:\GitBizTalkers\OLD_Wck_Flexipod\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (node:internal/timers:464:21)

有人看到我做错了什么吗?

4

1 回答 1

0

问题是由于 yaml 格式。192 号线

Fn::GetAtt: [PullSqlSvr, Arn]

这需要一个额外的选项卡在“资源:”下方缩进

于 2022-02-11T12:31:14.497 回答