使用 CF 模板创建 AWS::Pinpoint::PushTemplate

Create AWS::Pinpoint::PushTemplate using CF template

您好,我想使用 cloudformation 模板创建 AWS::Pinpoint::PushTemplate,我正在关注此 link:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-pinpoint-pushtemplate.html

Type: AWS::Pinpoint::PushTemplate
Properties:
  Default:
    Action: OPEN_APP
    Body: FirstName - {{firstName}}, LastName - {{lastName}}
    Title: Title
  DefaultSubstitutions:
    firstName: default
    lastName: default
  Tags:
    project: project
    tashi: "Pinpoint Template"
  TemplateName: template_name

我收到`DefaultSubstitutions 的类型验证错误:Property validation failure: [Value of property {/DefaultSubstitutions} does not match type {String}]

根据文档 DefaultSubstitutionsString.

但是,在您的情况下,您将其设置为地图:

  DefaultSubstitutions:
    firstName: default
    lastName: default

也许必须尝试将其用作 json 字符串:

DefaultSubstitutions: "{\"firstName"\:\"default\", \"lastName"\:\"default\"}"