Search code examples
aws-lambdaaws-cloudformationaws-pinpoint

Create AWS::Pinpoint::PushTemplate using CF template


Hi I want to create AWS::Pinpoint::PushTemplate using cloudformation template and I am following this 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

I am getting type validation error for`DefaultSubstitutions: Property validation failure: [Value of property {/DefaultSubstitutions} does not match type {String}]


Solution

  • According to docs DefaultSubstitutions is a String.

    However, in your case, you set it up as map:

      DefaultSubstitutions:
        firstName: default
        lastName: default
    

    Maybe have to try using it as json string:

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