public class UpdateAliasRequest extends AmazonWebServiceRequest implements Serializable
Associates an existing alias with a different customer master key (CMK). Each CMK can have multiple aliases, but the aliases must be unique within the account and region. You cannot perform this operation on an alias in a different AWS account.
This operation works only on existing aliases. To change the alias of a CMK to a new value, use CreateAlias to create a new alias and DeleteAlias to delete the old alias.
Because an alias is not a property of a CMK, you can create, update, and delete the aliases of a CMK without affecting the CMK. Also, aliases do not appear in the response from the DescribeKey operation. To get the aliases of all CMKs in the account, use the ListAliases operation.
The alias name must begin with alias/ followed by a name, such
as alias/ExampleAlias. It can contain only alphanumeric
characters, forward slashes (/), underscores (_), and dashes (-). The alias
name cannot begin with alias/aws/. The alias/aws/
prefix is reserved for AWS managed CMKs.
The result of this operation varies with the key state of the CMK. For details, see How Key State Affects Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
| Constructor and Description |
|---|
UpdateAliasRequest() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getAliasName()
Specifies the name of the alias to change.
|
String |
getTargetKeyId()
Unique identifier of the customer master key (CMK) to be mapped to the
alias.
|
int |
hashCode() |
void |
setAliasName(String aliasName)
Specifies the name of the alias to change.
|
void |
setTargetKeyId(String targetKeyId)
Unique identifier of the customer master key (CMK) to be mapped to the
alias.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
UpdateAliasRequest |
withAliasName(String aliasName)
Specifies the name of the alias to change.
|
UpdateAliasRequest |
withTargetKeyId(String targetKeyId)
Unique identifier of the customer master key (CMK) to be mapped to the
alias.
|
clone, copyBaseTo, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollectorpublic String getAliasName()
Specifies the name of the alias to change. This value must begin with
alias/ followed by the alias name, such as
alias/ExampleAlias.
Constraints:
Length: 1 - 256
Pattern: ^[a-zA-Z0-9:/_-]+$
Specifies the name of the alias to change. This value must begin
with alias/ followed by the alias name, such as
alias/ExampleAlias.
public void setAliasName(String aliasName)
Specifies the name of the alias to change. This value must begin with
alias/ followed by the alias name, such as
alias/ExampleAlias.
Constraints:
Length: 1 - 256
Pattern: ^[a-zA-Z0-9:/_-]+$
aliasName -
Specifies the name of the alias to change. This value must
begin with alias/ followed by the alias name,
such as alias/ExampleAlias.
public UpdateAliasRequest withAliasName(String aliasName)
Specifies the name of the alias to change. This value must begin with
alias/ followed by the alias name, such as
alias/ExampleAlias.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 256
Pattern: ^[a-zA-Z0-9:/_-]+$
aliasName -
Specifies the name of the alias to change. This value must
begin with alias/ followed by the alias name,
such as alias/ExampleAlias.
public String getTargetKeyId()
Unique identifier of the customer master key (CMK) to be mapped to the alias. When the update operation completes, the alias will point to this CMK.
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.
To verify that the alias is mapped to the correct CMK, use ListAliases.
Constraints:
Length: 1 - 2048
Unique identifier of the customer master key (CMK) to be mapped to the alias. When the update operation completes, the alias will point to this CMK.
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.
To verify that the alias is mapped to the correct CMK, use ListAliases.
public void setTargetKeyId(String targetKeyId)
Unique identifier of the customer master key (CMK) to be mapped to the alias. When the update operation completes, the alias will point to this CMK.
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.
To verify that the alias is mapped to the correct CMK, use ListAliases.
Constraints:
Length: 1 - 2048
targetKeyId - Unique identifier of the customer master key (CMK) to be mapped to the alias. When the update operation completes, the alias will point to this CMK.
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.
To verify that the alias is mapped to the correct CMK, use ListAliases.
public UpdateAliasRequest withTargetKeyId(String targetKeyId)
Unique identifier of the customer master key (CMK) to be mapped to the alias. When the update operation completes, the alias will point to this CMK.
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.
To verify that the alias is mapped to the correct CMK, use ListAliases.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 2048
targetKeyId - Unique identifier of the customer master key (CMK) to be mapped to the alias. When the update operation completes, the alias will point to this CMK.
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.
To verify that the alias is mapped to the correct CMK, use ListAliases.
public String toString()
toString in class ObjectObject.toString()Copyright © 2019. All rights reserved.