

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# Shared property types reference
<a name="cfn-reference-shared"></a>

This section contains detailed reference information for property types that CloudFormation supports for use in multiple resource types.

**Topics**
+ [

# CloudFormation resource custom naming
](aws-properties-name.md)
+ [

# CloudFormation resource tagging
](aws-properties-resource-tags.md)

# CloudFormation resource custom naming
<a name="aws-properties-name"></a>

You can assign custom names to supported resource types in your CloudFormation template to make them more meaningful and easily identifiable. By default, CloudFormation generates a unique physical ID to name a resource. For example, CloudFormation might name an Amazon S3 bucket with the following physical ID `MyStack-MyBucket-abcdefghijk1`. With custom names, you can specify a name that's easier to read and identify, such as `production-app-logs` or `business-metrics`.

Not all resources support custom names. Each AWS service independently determines which resource types support custom names.

Resource names must be unique across all your active stacks. If you reuse templates to create multiple stacks, you must change or remove custom names from your template. If you don't specify a name, CloudFormation generates a unique physical ID to name the resource. Names must begin with a letter; contain only ASCII letters, digits, and hyphens; and not end with a hyphen or contain two consecutive hyphens.

Also, don't manage stack resources outside of CloudFormation. For example, if you rename a resource that's part of a stack without using CloudFormation, you might get an error any time you try to update or delete that stack.

**Important**  
You can't perform an update that causes a custom-named resource to be replaced. If you must replace the resource, specify a new name.

## Example
<a name="aws-properties-name-example"></a>

If you want to use a custom name, specify a name property for that resource in your CloudFormation template. Each resource that supports custom names has its own property that you specify. For example, to name an DynamoDB table, you use the `TableName` property, as shown in the following sample:

### JSON
<a name="aws-properties-name-example.json"></a>

```
"myDynamoDBTable" : {
   "Type" : "AWS::DynamoDB::Table",
   "Properties" : {
      "KeySchema" : {
         "HashKeyElement": {
            "AttributeName" : "AttributeName1",
            "AttributeType" : "S"
         },
         "RangeKeyElement" : {
            "AttributeName" : "AttributeName2",
            "AttributeType" : "N"
         }
      },
      "ProvisionedThroughput" : {
         "ReadCapacityUnits" : "5",
         "WriteCapacityUnits" : "10"
      },
      "TableName" : "SampleTable"
   }
}
```

### YAML
<a name="aws-properties-name-example.yaml"></a>

```
myDynamoDBTable: 
  Type: AWS::DynamoDB::Table
  Properties: 
    KeySchema: 
      HashKeyElement: 
        AttributeName: "AttributeName1"
        AttributeType: "S"
      RangeKeyElement: 
        AttributeName: "AttributeName2"
        AttributeType: "N"
    ProvisionedThroughput: 
      ReadCapacityUnits: "5"
      WriteCapacityUnits: "10"
    TableName: "SampleTable"
```

# CloudFormation resource tagging
<a name="aws-properties-resource-tags"></a>

You can apply tags to resources by using the `Tags` property in your CloudFormation template, which can help you identify and categorize those resources.

For information about which resources support the `Tags` property, see the individual resources in the [AWS resource and property types reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-template-resource-type-ref.html). If a resource doesn't yet support the `Tags` property, the resource's service might support tagging using its own API operations. For more information, refer to the documentation for that service.

In addition to any tags you define, CloudFormation automatically creates the following stack-level tags with the `aws:` prefix:
+ `aws:cloudformation:logical-id`
+ `aws:cloudformation:stack-id`
+ `aws:cloudformation:stack-name`

The `aws:` prefix is reserved for AWS use. This prefix is case-insensitive. If you use this prefix in the `Key` or `Value` property, you can't update or delete the tag. Tags with this prefix don't count toward the number of tags per resource.

The propagation of stack-level tags to resources, including tags with the `aws:` prefix, varies by resource type. For example, tags aren't propagated to Amazon EBS volumes that are created from block device mappings. 

**Note**  
Some resources require explicit tag propagation settings. For example, the `AWS::AutoScaling::AutoScalingGroup` resource must have its `PropagateAtLaunch` property set to `true` to propagate tags to its EC2 instances. However, stack-level tags are automatically applied to EC2 instances regardless of the `PropagateAtLaunch` setting.

## Syntax
<a name="w2aac14d546c13c17"></a>

### JSON
<a name="aws-properties-resource-tags-syntax.json"></a>

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

### YAML
<a name="aws-properties-resource-tags-syntax.yaml"></a>

```
Key: String
Value: String
```

## Properties
<a name="w2aac14d546c13c19"></a>

`Key`  <a name="cfn-resource-tags-key"></a>
The key name of the tag. You can specify a value that's 1 to 128 Unicode characters in length and can't be prefixed with `aws:`. You can use any of the following characters: the set of Unicode letters, digits, whitespace, `_`, `.`, `:`, `/`, `=`, `+`, `@`, `-`, and `"`.  
*Required*: Yes  
*Type*: String

`Value`  <a name="cfn-resource-tags-value"></a>
The value for the tag. You can specify a value that's 1 to 256 characters in length. You can use any of the following characters: the set of Unicode letters, digits, whitespace, `_`, `.`, `/`, `=`, `+`, and `-`.  
*Required*: Yes  
*Type*: String

## Example
<a name="aws-properties-resource-tags-examples"></a>

This example shows a `Tags` property. You specify this property within the `Properties` section of a resource that supports it. When the resource is created, the `Environment` tag is dynamically set using a parameter, and the `Owner` tag is statically set to `MyName`.

### JSON
<a name="aws-properties-resource-tags-example.json"></a>

```
 1. "Tags" : [
 2.    {
 3.       "Key" : "Environment",
 4.       "Value" : { "Ref": "Environment" }
 5.    },
 6.    {
 7.       "Key" : "Owner",
 8.       "Value" : "MyName"
 9.    }
10. ]
```

### YAML
<a name="aws-properties-resource-tags-example.yaml"></a>

```
1. Tags: 
2.   - Key: Environment
3.     Value: !Ref Environment
4.   - Key: Owner
5.     Value: MyName
```

## See also
<a name="w2aac14d546c13c23"></a>
+ [Configure stack options](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html#configure-stack-options) in the *AWS CloudFormation User Guide*
+ [Viewing CloudFormation stack data and resources on the AWS Management Console](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-view-stack-data-resources.html) in the *AWS CloudFormation User Guide*