Set more environment variables in container instances


I see in the module fargate-service definition (@cfn-modules/fargate-service/module.yml) that I can only use 6 environment variables. What if I need more than 6? Are there any ways to extend or override the module template yml file and put more variables?

Hi @jn6h

Thanks for your question! You are not the first person running into this limitation. How many vars do you need?

The reason for the limited amount of variables it that CloudFormation hard limits us to 60 parameters in total.

Oh, i didnt know that… Right now, I only need three more variables.

Well i guess i will have to use mappings or lists in order to assign multiple values to a single parameter…

Thanks for you reply!

I see. What kind of values do you need? Are they all dynamic (like a database endpoint) or do you also have more static values?

One idea: Add multiple config files to your image (e.g., test.conf, prod.conf) and select the config file based on a single env variable like STAGE.