AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Adds one or more tags to a specified resource.

A resource can have up to 10 tags. If you try to create more than 10 tags for a resource, you will receive an error and the attempt will fail.

If you specify a key that already exists for the resource, the value for that key will be updated with the new value.

Note:

For PCL this operation is only available in asynchronous form. Please refer to CreateTagsAsync.

Namespace: Amazon.Redshift
Assembly: AWSSDK.Redshift.dll
Version: 3.x.y.z

Syntax

C#
public abstract CreateTagsResponse CreateTags(
         CreateTagsRequest request
)
Parameters
request
Type: Amazon.Redshift.Model.CreateTagsRequest

Container for the necessary parameters to execute the CreateTags service method.

Return Value
The response from the CreateTags service method, as returned by Redshift.

Exceptions

ExceptionCondition
InvalidTagException The tag is invalid.
ResourceNotFoundException The resource could not be found.
TagLimitExceededException The request exceeds the limit of 10 tags for the resource.

Examples

This example creates tags for the specified cluster.

To create tags


var response = client.CreateTags(new CreateTagsRequest 
{
    ResourceName = "arn:aws:redshift:us-west-2:644653688104:cluster:mycluster",
    Tags = new List {
        new Tag {
            Key = "owner",
            Value = "admin"
        },
        new Tag {
            Key = "test",
            Value = "environment"
        }
    }
});


            

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

See Also