首页 > 解决方案 > 无服务器框架 - 尝试填充非字符串值错误

问题描述

我有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.

标签: amazon-web-servicesyamlamazon-cloudformationamazon-snsserverless-framework

解决方案


推荐阅读