Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 642
Eric Nord Avatar asked Jan 19 '17 16:01

Eric Nord


People also ask

What is template configuration file?

A template configuration file is a JSON-formatted text file that can specify template parameter values, a stack policy, and tags. Use these configuration files to specify parameter values or a stack policy for a stack. All of the parameter values that you specify must be declared in the associated template.


1 Answers

A nice trick to see what the Cloudformation layout should be is to create a pipeline which you know will work. Then use the CLI to extract a cloudformation template.

aws codepipeline get-pipeline --name <pipelinename>

You will get the JSON of the Codepipeline resource. There will be a few changes required but from this you can see exactly what the syntax should be and from there parameterised your template and create Codepipelines programatically.

like image 154
hynespm Avatar answered Oct 23 '22 11:10

hynespm