

# Tagging Elastic Beanstalk application resources
Tagging resources

This topic explains the benefits of using tags with your Elastic Beanstalk application resources along with the constraints of doing so. It also explains how to create and manage tags for application resources.

You can apply tags to resources of your AWS Elastic Beanstalk applications. Tags are key-value pairs associated with AWS resources. Tags can help you categorize resources. They're particularly useful if you manage many resources as part of multiple AWS applications.

Here are some ways to use tagging with Elastic Beanstalk resources:
+ *Deployment stages* – Identify resources associated with different stages of your application, such as development, beta, and production.
+ *Cost allocation* – Use cost allocation reports to track your usage of AWS resources associated with various expense accounts. The reports include both tagged and untagged resources, and they aggregate costs according to tags. For information about how cost allocation reports use tags, see [Use Cost Allocation Tags for Custom Billing Reports](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation.html) in the *AWS Billing and Cost Management User Guide*.
+ *Access control* – Use tags to manage permissions to requests and resources. For example, a user who can only create and manage beta environments should only have access to beta stage resources. For details, see [Using tags to control access to Elastic Beanstalk resourcesExamples of tag conditions in policies](AWSHowTo.iam.policies.access-tags.md).

You can add up to 50 tags to each resource. Environments are slightly different: Elastic Beanstalk adds three default system tags to environments, and you can't edit or delete these tags. In addition to the default tags, you can add up to 47 additional tags to each environment.

The following constraints apply to tag keys and values:
+ Keys and values can contain letters, numbers, white space, and the following symbols: `_ . : / = + - @`
+ Keys can contain up to 127 characters. Values can contain up to 255 characters.
**Note**  
These length limits are for Unicode characters in UTF-8. For other multibyte encodings, the limits might be lower.
+ Keys are case sensitive.
+ Keys cannot begin with `aws:` or `elasticbeanstalk:`.

## Resources you can tag


The following are the types of Elastic Beanstalk resources that you can tag, and links to specific topics about managing tags for each of them:
+ [Applications](applications-tagging.md)
+ [Environments](using-features.tagging.md)
+ [Application versions](applications-versions-tagging.md)
+ [Saved configurations](environment-configuration-savedconfig-tagging.md)

# Tag propagation to launch templates


Elastic Beanstalk provides an option to enable the propagation of environment tags to launch templates. This option provides continued support for tag-based access control (TBAC) with launch templates.

**Note**  
Launch configurations are being phased out and replaced by launch templates. For more information, see [Launch configurations](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html) in the *Amazon EC2 Auto Scaling User Guide*.

To prevent down-time of running EC2 instances CloudFormation doesn’t propagate tags to existing launch templates. If there's a use case that requires tags for your environment’s resources, you can enable Elastic Beanstalk to create launch templates with tags for these resources. To do so, set the `LaunchTemplateTagPropagationEnabled` option in the [aws:autoscaling:launchconfiguration](command-options-general.md#command-options-general-autoscalinglaunchconfiguration) namespace to `true`. The default value is `false`.

The following [configuration file](ebextensions.md) example enables the propagation of tags to launch templates.

```
option_settings:
  aws:autoscaling:launchconfiguration:
    LaunchTemplateTagPropagationEnabled: true
```

Elastic Beanstalk can only propagate tags to launch templates for the following resources:
+ EBS volumes
+ EC2 instances 
+ EC2 network interfaces
+ CloudFormation launch templates that define a resource

This constraint exists because CloudFormation only allows tags on template creation for specific resources. For more information see [TagSpecification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-tagspecification.html) in the *AWS CloudFormation User Guide*.

**Important**  
Changing this option value from `false` to `true` for an existing environment may be a breaking change for previously existing tags.
When this feature is enabled, the propagation of tags will require EC2 replacement, which can result in downtime. You can enable *rolling updates* to apply configuration changes in batches and prevent downtime during the update process. For more information, see [Configuration changes](environments-updating.md).

For more information about launch templates, see the following:
+ [Launch templates](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-templates.html) in the *Amazon EC2 Auto Scaling User Guide*
+ [Working with templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-guide.html) in the *AWS CloudFormation User Guide*
+ [Elastic Beanstalk template snippets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-elasticbeanstalk.html) in the *AWS CloudFormation User Guide*