- substitution replicate: eliminate nearly identical resources in a template by replicating a base resource and substituting in variables wherever the intrinsic substitution function to CloudFormation is used.
The Makefile can be reused for any macro; specify the environment, the folder containing the macro and the macro name to deploy:
MACRO_PATH=<dir_to_macro> MACRO_NAME=<macro_name> make deployThis will deploy the macro under the naming convention <macro_name>. For example, the substitution replicator macro is deployed as follows:
MACRO_PATH=resource-replicate MACRO_NAME=ResourceReplicate make deployand is used in any CloudFormation template with
AWSTemplateVersion: 2010-09-09
Transform:
- SubReplicateA versions.yml file can be used in each macro folder to specify macro versions. The file is of the form:
V1:
version_name: V1
V2:
version_name: V2Versions can be added and removed (if no CloudFormation stack needs it anymore). These versioned macros will be available under the convention <macro_name>-<version_name>. Once a macro version is made it is static, unlike the <macro_name> macro. This will ensure that existing stacks relying on a versioned macro will not break due to code changes.