Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Fn::Transform

Focus mode
Fn::Transform - AWS CloudFormation
Filter View

The intrinsic function Fn::Transform specifies a macro to perform custom processing on part of a stack template. Macros enable you to perform custom processing on templates, from simple actions like find-and-replace operations to extensive transformations of entire templates. For more information, see Perform custom processing on CloudFormation templates with template macros.

You can also use Fn::Transform to call the AWS::Include transform transform, which is a macro hosted by AWS CloudFormation.

Declaration

JSON

Syntax for the full function name:

{ "Fn::Transform": { "Name": "macro name", "Parameters": { "Key": "value" } } }

Syntax for the short form:

{ "Transform": { "Name": "macro name", "Parameters": { "Key": "value" } } }

YAML

Syntax for the full function name:

Fn::Transform: Name : macro name Parameters : Key : value

Syntax for the short form:

!Transform Name: macro name Parameters: Key: value

Parameters

Name

The name of the macro you want to perform the processing.

Parameters

The list parameters, specified as key-value pairs, to pass to the macro.

Return value

The processed template snippet to be included in the processed stack template.

Examples

The following example calls the AWS::Include transform, specifying that the location to retrieve a template snippet from is passed in the InputValue parameter.

JSON

{ "Fn::Transform": { "Name": "AWS::Include", "Parameters": { "Location": { "Ref": "InputValue" } } } }

YAML

'Fn::Transform': Name: 'AWS::Include' Parameters: Location: !Ref InputValue

Supported functions

None.

CloudFormation passes any intrinsic function calls included in Fn::Transform to the specified macro as literal strings.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.