Search code examples
aws-cloudformationaws-codepipeline

CodePipeline CloudFormation Template configuration


I'm trying to use the CloudFormation Template configuration field in a CodePipeline. If you edit the CloudFormation in CodePipeline it looks like this:

enter image description here

If my InputArtifactName is MyAppBuild and I have a CloudFormation config file in cfg-prd.json, my hope was I could enter MyAppBuild::cfg-prd.json and have it pick it up.

I get an error about the template file not being valid even though it works manually as:

--parameters cfg-prd.json

Solution

  • Note that the Template Configuration File has a different JSON structure than the format accepted by the --parameters option to aws cloudformation create-stack:

    {
      "Parameters" : {
        "NameOfTemplateParameter" : "ValueOfParameter",
        ...
      },
      "StackPolicy" : {
        "Statement" : [
          StackPolicyStatement
        ]
      }
    }