Posted On: Mar 27, 2023
Amazon CloudFormation has expanded the availability of language Transform called ‘AWS::LanguageExtensions' to the Amazon Web Services China (Beijing) Region, operated by Sinnet and the Amazon Web Services China (Ningxia) Region, operated by NWCD. When declared in a template, the transform enables extensions to the template language in Amazon CloudFormation. The language extensions transform expands the functionality of the base CloudFormation JSON/YAML template language.
With this launch, you can use intrinsic functions for length (Fn::Length) and JSON string conversion (Fn::ToJsonString), and support for intrinsic functions and pseudo-parameter references in update and deletion policies in these Amazon Web Services China Regions. You use intrinsic functions in your templates to assign property values to properties that are not available until runtime. For example, you can use the Fn::ToJsonString intrinsic function to convert an object or array to its corresponding JSON string.
Additionally, the language extension transform supports default parameter values and additional intrinsic functions in Fn::FindInMap. You can use these features to minimize the size of your CloudFormation templates, and improve their readability. For example, you can combine intrinsic functions such as Fn::Select and Fn::Split to dynamically extract and return string from a given parameter. This returned string value can be used within Fn::FindInMap to map to the desired Mappings section. You can automate inputs to your Mapping logic with fewer lines of code, instead of declaring multiple conditions. To see other examples of Fn::FindInMap enhancements, refer to our user guide.
To learn more about language extension transform, refer to the CloudFormation documentation.