Posted On: Apr 13, 2021

AWS CloudFormation Modules encapsulate one or more AWS resources and their respective properties for reuse across your organization. Modules make it simple to use the specific resources you need, while keeping resource configurations aligned with organizational best practices. You can now create YAML-formatted Modules in your CloudFormation templates. YAML-formatted Modules follow the same anatomy as existing JSON-formatted Modules. We have also added delimiter support for Modules.

A common practice in CloudFormation is to use intrinsic functions to assign values to properties that are not available until runtime. Because a Module can be composed of one or more resources, attributes are referenced differently than for stand-alone resources. Prior to this launch, customers needed to reference a resource or resource property by concatenating the logical name of the module and the resource specified in the module. This created long strings and confusion with the naming convention. For example, previously a reference may have looked like this: :!GetAtt module1nestedmoduleresource.property. With the Delimiter notation, we have made it simpler for customers to use the Fn::Sub, Fn::GetAtt and Ref intrinsic functions to reference resources and properties using a familiar and consistent convention. This helps identify a resource or attribute being referenced from a Module. For example, !GetAtt module1.nestedmodule.resource.property.

YAML and Delimiter notation support is available in all regions where CloudFormation Modules are supported.

To learn more, refer to our CloudFormation Modules documentation.