Menu
Elastic Load Balancing
API Reference (API Version 2015-12-01)

AddTags

Adds the specified tags to the specified Elastic Load Balancing resource. You can tag your Application Load Balancers, Network Load Balancers, and your target groups.

Each tag consists of a key and an optional value. If a resource already has a tag with the same key, AddTags updates its value.

To list the current tags for your resources, use DescribeTags. To remove tags from your resources, use RemoveTags.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

ResourceArns.member.N

The Amazon Resource Name (ARN) of the resource.

Type: Array of strings

Required: Yes

Tags.member.N

The tags. Each resource can have a maximum of 10 tags.

Type: Array of Tag objects

Array Members: Minimum number of 1 item.

Required: Yes

Errors

For information about the errors that are common to all actions, see Common Errors.

DuplicateTagKeys

A tag key was specified more than once.

HTTP Status Code: 400

LoadBalancerNotFound

The specified load balancer does not exist.

HTTP Status Code: 400

TargetGroupNotFound

The specified target group does not exist.

HTTP Status Code: 400

TooManyTags

You've reached the limit on the number of tags per load balancer.

HTTP Status Code: 400

Example

Add tags to a load balancer

This example adds the specified tags to the specified load balancer.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=AddTags
&ResourceArns.member.1=arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188
&Tags.member.1.Key=project
&Tags.member.1.Value=lima
&Tags.member.2.Key=department
&Tags.member.2.Value=digital-media
&Version=2015-12-01
&AUTHPARAMS

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: