AWS CloudFormation
User Guide (API Version 2010-05-15)

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Metadata Attribute

The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON or YAML to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.


AWS CloudFormation does not validate the syntax within the Metadata attribute.

You can retrieve this data using the AWS command aws cloudformation describe-stack-resource or the DescribeStackResource action.


The following template contains an Amazon S3 bucket resource with a Metadata attribute.


{ "AWSTemplateFormatVersion" : "2010-09-09", "Resources" : { "MyS3Bucket" : { "Type" : "AWS::S3::Bucket", "Metadata" : { "Object1" : "Location1", "Object2" : "Location2" } } } }


AWSTemplateFormatVersion: '2010-09-09' Resources: MyS3Bucket: Type: AWS::S3::Bucket Metadata: Object1: Location1 Object2: Location2

On this page: