Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Tags help you to categorize your load balancers in different ways, for example, by
purpose, owner, or environment.
You can add multiple tags to each load balancer. If you add a tag with a key that is
already associated with the load balancer, it updates the value of that tag.
When you are finished with a tag, you can remove it from your load balancer.
Restrictions
-
Maximum number of tags per resource—50
-
Maximum key length—127 Unicode characters
-
Maximum value length—255 Unicode characters
-
Tag keys and values are case sensitive. Allowed characters are letters,
spaces, and numbers representable in UTF-8, plus the following special
characters: + - = . _ : / @. Do not use leading or trailing spaces.
-
Do not use the aws:
prefix in your tag names or values because it
is reserved for Amazon use. You can't edit or delete tag names or values with
this prefix. Tags with this prefix do not count against your tags per resource
limit.
- Console
-
To update the tags for a load balancer
Open the Amazon EC2 console at
https://console.amazonaws.cn/ec2/.
-
On the navigation pane, choose Load Balancers.
-
Select the load balancer.
-
On the Tags tab, choose Manage tags.
-
To add a tag, choose Add tag and enter the tag key and
tag value.
-
To update a tag, enter new values in Key or
Value.
-
To delete a tag, choose Remove next to
the tag.
-
Choose Save changes.
- Amazon CLI
-
To add tags
Use the add-tags
command.
aws elbv2 add-tags \
--resource-arns load-balancer-arn
\
--tags "Key=project
,Value=lima
" "Key=department
,Value=digital-media
"
To remove tags
Use the remove-tags
command.
aws elbv2 remove-tags \
--resource-arns load-balancer-arn
\
--tag-keys project
department
- CloudFormation
-
To add tags
Update the AWS::ElasticLoadBalancingV2::LoadBalancer
resource to include the Tags
property.
Resources:
myLoadBalancer:
Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
Properties:
Name: my-alb
Type: application
Scheme: internal
Subnets:
- !Ref subnet-AZ1
- !Ref subnet-AZ2
SecurityGroups:
- !Ref mySecurityGroup
Tags:
- Key: 'project
'
Value: 'lima
'
- Key: 'department
'
Value: 'digital-media
'