Trying to grasp these syntax rules, unsure if it's possible.
We have numerous CloudFormation templates that we want to deploy using CDK by constructing them with CfnInclude
. The issue is that CfnInclude
always needs an explicit parameters
argument if parameters are involved.
Is there a way to write this in a more general manner? So we can create multiple resources via CfnInclude
in just one loop for all the CF templates, each possibly having different parameters or none at all. Otherwise, I'd have to provide all potential parameters to all CF templates and specify them during CfnInclude
.
The values of actual parameters come from another source and are stored in a map. Let's say that, altogether, these CF templates may require 0, 1, 2, or 3 possible parameters from a list like this:
let cfnParameters = {
"param1": value1,
"param2": value2,
"param3": value3,
};
Can we somehow, by providing the template files, instruct CDK to automatically determine the number and type of parameters for each file, then replace them with the proper values from the map (essentially passing a dynamically created Parameters
list for each template)? It seems like the getParameters
API only works on the fully constructed CF template after CfnInclude
has been used?
And is it not possible to first create a CfnInclude
without supplying the Parameters
, then use GetParameters
and substitute them with actual values afterward? The documentation indicates that Parameter Replacement can only occur during construction time?