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

EC2 Tag

EC2 Tags are embedded properties of the AWS::EC2::Instance, AWS::EC2::RouteTable, AWS::EC2::NetworkAcl, AWS::EC2::NetworkInterface, AWS::EC2::Subnet, AWS::EC2::VPC, and AWS::EC2::Volume types.

Syntax

{
   "Key" : String,
   "Value" : String
}     

Properties

Key

The key term for this item.

Required: Yes

Type: String

Value

A value associated with the key term.

Required: Yes

Type: String

Example

EC2 Tags are typically provided in a list. You can also include useful information in a tag by providing it with a value using the Ref or Fn::GetAtt intrinsic functions. For example:

"Tags": [
   { "Key" : "Role", "Value": "Test Instance" },
   { "Key" : "Application", "Value" : { "Ref" : "AWS::StackName"} }
]

More examples of tags are provided in the EC2 resources that use tags, and on the Amazon EC2 Snippets page.

See Also

  • Using Tags in the Amazon Elastic Compute Cloud User Guide