AWS Cloudformation templates have Intrinsic functions to use upon on Resources such as properties and metadata attributes
With reference to http://fortycloud.com/using-amazon-cloudformation-service-to-set-up-your-virtual-private-cloud/, here are few of them
String Handling Functions
Fn::Base64 - Returns the Base64 representation of the input string. This function is typically used to pass encoded data to Amazon EC2 instances by way of the UserData property.
Fn::Join - Appends a set of values into a single value, separated by the specified delimiter. If a delimiter is the empty string, the set of values are concatenated with no delimiter.
Functions for Managing data and variables inside the Template
Fn::FindInMap Returns the value corresponding to keys in a two-level map that is declared in the Mappings section.
Fn::GetAtt Returns the value of an attribute from a resource in the template.
Ref Returns the value of the specified parameter or resource.
Region Selection Function
Fn::GetAZs Returns an array that lists Availability Zones for a specified region.