Hi all. So I need to consolidate an artifact repo and openshift into a nested stack and I’m trying to call all the required parameters into the root stack template which requires 61 parameters…however 60 is the limit for CloudFormation, funny how things work sometimes. Is there a way around this? Perhaps I should see if i can get rid of the 61st parameter? Is there a way to keep it? Thanks
Encode a couple of similar parameters together into a single parameter, separated with a comma. Then, in your CF template you can split on the parameter to get the first or second values.
But, I’d probably try to refactor the template a bit to cut down on the number of parameters required, if possible.
You can use a mapping or list to jam multiple values into a single Parameter. Keep in mind that the maximum length for a Parameter value is 4096 bytes.
I don’t use parameters at all in my templates. Here’s how I do it:
I have a python program that I wrote that uses jinja2 templating library. I wrote a few jinja templates for each type of CF template I need deploy. I pass in the variables to the python program, it renders a bespoke CF template with all the variables where they need to be, and puts a copy in my local repo and one in S3 where I can deploy it easily.
There is no limit to variables in jinja and I find it far less cumbersome than dealing with pure CF stuff.
I can share some examples if you want or need them. It’s not the best thing I’ve ever done, but it solves my problem and gives me a way to automate these by just passing in a file with all the variables. I’ve been able to use the program itself to manage building new templates and deploying them in pipelines as well.