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...

Fn::GetAtt

The intrinsic function Fn::GetAtt returns the value of an attribute from a resource in the template.

Declaration

"Fn::GetAtt" : [ "logicalNameOfResource", "attributeName" ]

Parameters

logicalNameOfResource

The logical name of the resource that contains the attribute you want.

attributeName

The name of the resource-specific attribute whose value you want. See the resource's reference page for details about the attributes available for that resource type.

Return Value

The attribute value.

Example

This example returns a string containing the DNS name of the LoadBalancer with the logical name MyLB.

"Fn::GetAtt" : [ "MyLB" , "DNSName" ]

Attributes

You can retrieve the following attributes using Fn::GetAtt.

Resource TypeNameAttributeDescription

AWS::CloudFormation::WaitCondition

Data

A JSON format string containing the UniqueId and Data values from the wait condition signal(s) for the specified wait condition. For more information about wait condition signals, see Wait Condition Signal JSON Format.

Example for wait condition with 2 signals:

{"Signal1":"Step 1 complete.","Signal2":"Step 2 complete."}

AWS::CloudFormation::Stack

Outputs.NestedStackOutputName

Output value from the nested stack that you specified, where NestedStackOutputName is the name of the output value.

AWS::CloudFront::Distribution

DomainName

Example: http://d2fadu0nynjpfn.cloudfront.net/

AWS::EC2::EIP

AllocationId

ID that AWS assigns to represent the allocation of the address for use with Amazon VPC. Returned only for VPC elastic IP addresses.

Example: eipalloc-5723d13e

AWS::EC2::Instance

AvailabilityZone

The Availability Zone where the instance that you specified is launched.

Example:

us-east-1b

AWS::EC2::Instance

PrivateDnsName

The private DNS name of the instance that you specified.

Example: ip-10-24-34-0.ec2.internal

AWS::EC2::Instance

PublicDnsName

The public DNS name of the specified instance that you specified.

Example: ec2-107-20-50-45.compute-1.amazonaws.com

AWS::EC2::Instance

PrivateIp

The private IP address of the instance that you specified.

Example: 10.24.34.0

AWS::EC2::Instance

PublicIp

The public IP address of the instance that you specified.

Example: 192.0.2.0

AWS::EC2::NetworkInterface

PrimaryPrivateIpAddress

The primary private IP address of the network interface that you specified.

Example: 10.0.0.192

AWS::EC2::NetworkInterface

SecondaryPrivateIpAddresses

The secondary private IP addresses of the network interface that you specified.

Example: ["10.0.0.161", "10.0.0.162", "10.0.0.163"]

AWS::EC2::SecurityGroup

GroupId

The group ID of the specified security group.

Example: sg-94b3a1f6

AWS::EC2::AWS::EC2::SubnetNetworkAclAssociation

AssociationId

NetworkAcl associationId that is attached to a subnet

AWS::ElastiCache::CacheCluster

ConfigurationEndpoint.Address

The DNS address of the configuration endpoint for the cache cluster.

AWS::ElastiCache::CacheCluster

ConfigurationEndpoint.Port

The port number of the configuration endpoint for the cache cluster.

AWS::ElasticBeanstalk::Environment

EndpointURL

The URL to the LoadBalancer for this environment.

Example: awseb-myst-myen-132MQC4KRLAMD-1371280482.us-east-1.elb.amazonaws.com

AWS::ElasticLoadBalancing::LoadBalancer

CanonicalHostedZoneName

The name of the Amazon Route 53 hosted zone that is associated with the LoadBalancer.

Example: mystack-myelb-15HMABG9ZCN57-1013119603.us-east-1.elb.amazonaws.com

AWS::ElasticLoadBalancing::LoadBalancer

CanonicalHostedZoneNameID

The ID of the Amazon Route 53 hosted zone name that is associated with the LoadBalancer.

Example: Z3DZXE0Q79N41H

AWS::ElasticLoadBalancing::LoadBalancer

DNSName

The DNS name for the LoadBalancer.

Example: mystack-myelb-15HMABG9ZCN57-1013119603.us-east-1.elb.amazonaws.com

AWS::ElasticLoadBalancing::LoadBalancer

SourceSecurityGroup.GroupName

The security group that you can use as part of your inbound rules for your LoadBalancer's back-end Amazon EC2 application instances.

Example: amazon-elb

AWS::ElasticLoadBalancing::LoadBalancer

SourceSecurityGroup.OwnerAlias

Owner of the source security group.

Example: amazon-elb-sg

AWS::IAM::AccessKey

SecretAccessKey

Secret access key for the specified Access Key.

Example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY

AWS::IAM::Group

Arn

Example: arn:aws:iam::123456789012:group/mystack-mygroup-1DZETITOWEKVO

AWS::IAM::Role

Arn

Example: arn:aws:iam::1234567890:role/MyRole-AJJHDSKSDF

AWS::IAM::User

Arn

Example: arn:aws:iam::123456789012:group/mystack-myuser-1CCXAFG2H2U4D

AWS::Redshift::Cluster

Endpoint.Address

Connection endpoint for the cluster.

Example: examplecluster.cg034hpkmmjt.us-east-1.redshift.amazonaws.com

AWS::Redshift::Cluster

Endpoint.Port

Connection endpoint for the cluster.

Example: 5439

AWS::RDS::DBInstance

Endpoint.Address

Connection endpoint for the database.

Example: mystack-mydb-1apw1j4phylrk.cg034hpkmmjt.us-east-1.rds.amazonaws.com

AWS::RDS::DBInstance

Endpoint.Port

The port number on which the database accepts connections.

Example: 3306

AWS::S3::Bucket

DomainName

The DNS name of the specified bucket.

Example: mystack-mybucket-kdwwxmddtr2g.s3.amazonaws.com

AWS::S3::Bucket

WebsiteURL

Amazon S3 website endpoint for the specified bucket.

Example: http://mystack-mybucket-kdwwxmddtr2g.s3-website-us-east-1.amazonaws.com/

AWS::SNS::Topic

TopicName

The name of an Amazon SNS topic.

Example: my-sns-topic

AWS::SQS::Queue

Arn

ARN for the specified queue.

Example: arn:aws:sqs:us-east-1:123456789012:mystack-myqueue-15PG5C2FC1CW8

AWS::SQS::Queue

QueueName

The name of an Amazon SQS queue.

Example: mystack-myqueue-1VF9BKQH5BJVI