public class TagResourceRequest extends AmazonWebServiceRequest implements Serializable
Adds or overwrites one or more tags for the specified customer master key (CMK). You cannot perform this operation on a CMK in a different AWS account.
Each tag consists of a tag key and a tag value. Tag keys and tag values are both required, but tag values can be empty (null) strings.
You cannot use the same tag key more than once per CMK. For example, consider
a CMK with one tag whose tag key is Purpose and tag value is
Test. If you send a TagResource request for this
CMK with a tag key of Purpose and a tag value of
Prod, it does not create a second tag. Instead, the original tag
is overwritten with the new tag value.
For information about the rules that apply to tag keys and tag values, see User-Defined Tag Restrictions in the AWS Billing and Cost Management User Guide.
| Constructor and Description |
|---|
TagResourceRequest() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getKeyId()
A unique identifier for the CMK you are tagging.
|
List<Tag> |
getTags()
One or more tags.
|
int |
hashCode() |
void |
setKeyId(String keyId)
A unique identifier for the CMK you are tagging.
|
void |
setTags(Collection<Tag> tags)
One or more tags.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
TagResourceRequest |
withKeyId(String keyId)
A unique identifier for the CMK you are tagging.
|
TagResourceRequest |
withTags(Collection<Tag> tags)
One or more tags.
|
TagResourceRequest |
withTags(Tag... tags)
One or more tags.
|
clone, copyBaseTo, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollectorpublic String getKeyId()
A unique identifier for the CMK you are tagging.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
Constraints:
Length: 1 - 2048
A unique identifier for the CMK you are tagging.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
public void setKeyId(String keyId)
A unique identifier for the CMK you are tagging.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
Constraints:
Length: 1 - 2048
keyId - A unique identifier for the CMK you are tagging.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
public TagResourceRequest withKeyId(String keyId)
A unique identifier for the CMK you are tagging.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 2048
keyId - A unique identifier for the CMK you are tagging.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
public List<Tag> getTags()
One or more tags. Each tag consists of a tag key and a tag value.
One or more tags. Each tag consists of a tag key and a tag value.
public void setTags(Collection<Tag> tags)
One or more tags. Each tag consists of a tag key and a tag value.
tags - One or more tags. Each tag consists of a tag key and a tag value.
public TagResourceRequest withTags(Tag... tags)
One or more tags. Each tag consists of a tag key and a tag value.
Returns a reference to this object so that method calls can be chained together.
tags - One or more tags. Each tag consists of a tag key and a tag value.
public TagResourceRequest withTags(Collection<Tag> tags)
One or more tags. Each tag consists of a tag key and a tag value.
Returns a reference to this object so that method calls can be chained together.
tags - One or more tags. Each tag consists of a tag key and a tag value.
public String toString()
toString in class ObjectObject.toString()Copyright © 2018. All rights reserved.