AWS CloudFormation
User Guide (API Version 2010-05-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Intrinsic Functions

AWS CloudFormation provides functions that you can use to pass values that are not available until runtime. You specify a function inline with "Fn::function-name" supplying whatever arguments it needs inline. The arguments can be literal strings or lists of strings, a parameter reference, a pseudo parameter, or the value returned from another function.

In the following example, the value for the URL output is provided at stack creation time by the Fn::GetAtt function, based on the value for DNSName assigned to the MyLoadBalancer load balancer:

"Outputs" : {
    "URL" : {
        "Value" : { "Fn::GetAtt" : [ "MyLoadBalancer", "DNSName" ] }
    }
}

Currently, AWS CloudFormation supports the following functions:

NamePurpose

Fn::Base64

The base64 encoding of the argument.

Fn::FindInMap

Returns the value of a key from the specified Mapping.

Fn::GetAtt

Returns the attribute value of the specified resource.

Fn::GetAZs

Get the Availability Zones where you can create AWS CloudFormation stacks.

Fn::Join

Concatenation of the elements of the second argument, separated by the first.

Ref

Return a resource or value based on a logical name or parameter.

Many of the sample templates make use of intrinsic functions (see Example Templates). Also, for technical details about the format of intrinsic functions, see Function Declaration.