代码之家  ›  专栏  ›  技术社区  ›  bensiu CandorZ

无服务器框架-尝试填充非字符串值错误

  •  0
  • bensiu CandorZ  · 技术社区  · 3 年前

    我有 serverless.yaml 对于许多SNS主题,我需要从不同帐户和地区的名称构建ARN,因此我使用了一个自定义前缀

    custom:
      snsTopicPrefix:
        Fn::Join:
          - ":"
          - - "arn:aws:sns"
            - !Ref "AWS::Region"
            - !Ref "AWS::AccountId"
    
      topic01: Topic-01-test
    
    functions:    
      from-SNS:
        handler: src/fromSNS/handler.fromSNS
        events:
          - sns:
              arn: ${self:custom.snsTopicPrefix}:${self:custom.topic01}
              topicName: ${self:custom.topic01}
    

    但是,当我部署它时,我不能传递错误 Trying to populate non string value into a string for variable ${self:custom.snsTopicPrefix}. Please make sure the value of the property is a string.

    0 回复  |  直到 3 年前