AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.
Changes the properties of a custom key store. You can use this operation to change the properties of an CloudHSM key store or an external key store.
Use the required CustomKeyStoreId
parameter to identify the custom key store. Use the remaining optional parameters to change its properties. This operation does not return any property values. To verify the updated property values, use the DescribeCustomKeyStores operation.
This operation is part of the custom key stores feature in KMS, which combines the convenience and extensive integration of KMS with the isolation and control of a key store that you own and manage.
For external key stores:
Some external key managers provide a simpler method for updating an external key store. For details, see your external key manager documentation.
When updating an external key store in the KMS console, you can upload a JSON-based proxy configuration file with the desired values. You cannot upload the proxy configuration file to the UpdateCustomKeyStore
operation. However, you can use the file to help you determine the correct values for the UpdateCustomKeyStore
parameters.
For an CloudHSM key store, you can use this operation to change the custom key store friendly name (NewCustomKeyStoreName
), to tell KMS about a change to the kmsuser
crypto user password (KeyStorePassword
), or to associate the custom key store with a different, but related, CloudHSM cluster (CloudHsmClusterId
). To update any property of an CloudHSM key store, the ConnectionState
of the CloudHSM key store must be DISCONNECTED
.
For an external key store, you can use this operation to change the custom key store friendly name (NewCustomKeyStoreName
), or to tell KMS about a change to the external key store proxy authentication credentials (XksProxyAuthenticationCredential
), connection method (XksProxyConnectivity
), external proxy endpoint (XksProxyUriEndpoint
) and path (XksProxyUriPath
). For external key stores with an XksProxyConnectivity
of VPC_ENDPOINT_SERVICE
, you can also update the Amazon VPC endpoint service name (XksProxyVpcEndpointServiceName
). To update most properties of an external key store, the ConnectionState
of the external key store must be DISCONNECTED
. However, you can update the CustomKeyStoreName
, XksProxyAuthenticationCredential
, and XksProxyUriPath
of an external key store when it is in the CONNECTED or DISCONNECTED state.
If your update requires a DISCONNECTED
state, before using UpdateCustomKeyStore
, use the DisconnectCustomKeyStore operation to disconnect the custom key store. After the UpdateCustomKeyStore
operation completes, use the ConnectCustomKeyStore to reconnect the custom key store. To find the ConnectionState
of the custom key store, use the DescribeCustomKeyStores operation.
Before updating the custom key store, verify that the new values allow KMS to connect the custom key store to its backing key store. For example, before you change the XksProxyUriPath
value, verify that the external key store proxy is reachable at the new path.
If the operation succeeds, it returns a JSON object with no properties.
Cross-account use : No. You cannot perform this operation on a custom key store in a different Amazon Web Services account.
Required permissions : kms:UpdateCustomKeyStore (IAM policy)
Related operations:
Eventual consistency : The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency .
See also: AWS API Documentation
update-custom-key-store
--custom-key-store-id <value>
[--new-custom-key-store-name <value>]
[--key-store-password <value>]
[--cloud-hsm-cluster-id <value>]
[--xks-proxy-uri-endpoint <value>]
[--xks-proxy-uri-path <value>]
[--xks-proxy-vpc-endpoint-service-name <value>]
[--xks-proxy-authentication-credential <value>]
[--xks-proxy-connectivity <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
--custom-key-store-id
(string)
Identifies the custom key store that you want to update. Enter the ID of the custom key store. To find the ID of a custom key store, use the DescribeCustomKeyStores operation.
--new-custom-key-store-name
(string)
Changes the friendly name of the custom key store to the value that you specify. The custom key store name must be unique in the Amazon Web Services account.
Warning
Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.To change this value, an CloudHSM key store must be disconnected. An external key store can be connected or disconnected.
--key-store-password
(string)
Enter the current password of the
kmsuser
crypto user (CU) in the CloudHSM cluster that is associated with the custom key store. This parameter is valid only for custom key stores with aCustomKeyStoreType
ofAWS_CLOUDHSM
.This parameter tells KMS the current password of the
kmsuser
crypto user (CU). It does not set or change the password of any users in the CloudHSM cluster.To change this value, the CloudHSM key store must be disconnected.
--cloud-hsm-cluster-id
(string)
Associates the custom key store with a related CloudHSM cluster. This parameter is valid only for custom key stores with a
CustomKeyStoreType
ofAWS_CLOUDHSM
.Enter the cluster ID of the cluster that you used to create the custom key store or a cluster that shares a backup history and has the same cluster certificate as the original cluster. You cannot use this parameter to associate a custom key store with an unrelated cluster. In addition, the replacement cluster must fulfill the requirements for a cluster associated with a custom key store. To view the cluster certificate of a cluster, use the DescribeClusters operation.
To change this value, the CloudHSM key store must be disconnected.
--xks-proxy-uri-endpoint
(string)
Changes the URI endpoint that KMS uses to connect to your external key store proxy (XKS proxy). This parameter is valid only for custom key stores with a
CustomKeyStoreType
ofEXTERNAL_KEY_STORE
.For external key stores with an
XksProxyConnectivity
value ofPUBLIC_ENDPOINT
, the protocol must be HTTPS.For external key stores with an
XksProxyConnectivity
value ofVPC_ENDPOINT_SERVICE
, specifyhttps://
followed by the private DNS name associated with the VPC endpoint service. Each external key store must use a different private DNS name.The combined
XksProxyUriEndpoint
andXksProxyUriPath
values must be unique in the Amazon Web Services account and Region.To change this value, the external key store must be disconnected.
--xks-proxy-uri-path
(string)
Changes the base path to the proxy APIs for this external key store. To find this value, see the documentation for your external key manager and external key store proxy (XKS proxy). This parameter is valid only for custom key stores with a
CustomKeyStoreType
ofEXTERNAL_KEY_STORE
.The value must start with
/
and must end with/kms/xks/v1
, wherev1
represents the version of the KMS external key store proxy API. You can include an optional prefix between the required elements such as/*example* /kms/xks/v1
.The combined
XksProxyUriEndpoint
andXksProxyUriPath
values must be unique in the Amazon Web Services account and Region.You can change this value when the external key store is connected or disconnected.
--xks-proxy-vpc-endpoint-service-name
(string)
Changes the name that KMS uses to identify the Amazon VPC endpoint service for your external key store proxy (XKS proxy). This parameter is valid when the
CustomKeyStoreType
isEXTERNAL_KEY_STORE
and theXksProxyConnectivity
isVPC_ENDPOINT_SERVICE
.To change this value, the external key store must be disconnected.
--xks-proxy-authentication-credential
(structure)
Changes the credentials that KMS uses to sign requests to the external key store proxy (XKS proxy). This parameter is valid only for custom key stores with a
CustomKeyStoreType
ofEXTERNAL_KEY_STORE
.You must specify both the
AccessKeyId
andSecretAccessKey
value in the authentication credential, even if you are only updating one value.This parameter doesn't establish or change your authentication credentials on the proxy. It just tells KMS the credential that you established with your external key store proxy. For example, if you rotate the credential on your external key store proxy, you can use this parameter to update the credential in KMS.
You can change this value when the external key store is connected or disconnected.
AccessKeyId -> (string)
A unique identifier for the raw secret access key.RawSecretAccessKey -> (string)
A secret string of 43-64 characters. Valid characters are a-z, A-Z, 0-9, /, +, and =.
Shorthand Syntax:
AccessKeyId=string,RawSecretAccessKey=string
JSON Syntax:
{
"AccessKeyId": "string",
"RawSecretAccessKey": "string"
}
--xks-proxy-connectivity
(string)
Changes the connectivity setting for the external key store. To indicate that the external key store proxy uses a Amazon VPC endpoint service to communicate with KMS, specify
VPC_ENDPOINT_SERVICE
. Otherwise, specifyPUBLIC_ENDPOINT
.If you change the
XksProxyConnectivity
toVPC_ENDPOINT_SERVICE
, you must also change theXksProxyUriEndpoint
and add anXksProxyVpcEndpointServiceName
value.If you change the
XksProxyConnectivity
toPUBLIC_ENDPOINT
, you must also change theXksProxyUriEndpoint
and specify a null or empty string for theXksProxyVpcEndpointServiceName
value.To change this value, the external key store must be disconnected.
Possible values:
PUBLIC_ENDPOINT
VPC_ENDPOINT_SERVICE
--cli-input-json
(string)
Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command.
--debug
(boolean)
Turn on debug logging.
--endpoint-url
(string)
Override command's default URL with the given URL.
--no-verify-ssl
(boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate
(boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output
(string)
The formatting style for command output.
--query
(string)
A JMESPath query to use in filtering the response data.
--profile
(string)
Use a specific profile from your credential file.
--region
(string)
The region to use. Overrides config/env settings.
--version
(string)
Display the version of this tool.
--color
(string)
Turn on/off color output.
--no-sign-request
(boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle
(string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout
(int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout
(int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.
Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal's quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .
Example 1: To edit the friendly name of a custom key store
The following update-custom-key-store
example changes the name of the custom key store. This example works for an AWS CloudHSM key store or an external key store.
Use the custom-key-store-id
to identify the key store. Use the new-custom-key-store-name
parameter to specify the new friendly name.
To update the friendly name of an AWS CloudHSM key store, you must first disconnect the key store, such as by using the disconnect-custom-key-store
command. You can update the friendly name of an external key store while it is connected or disconnected. To find the connection state of your custom key store, use the describe-custom-key-store
command.
aws kms update-custom-key-store \
--custom-key-store-id cks-1234567890abcdef0 \
--new-custom-key-store-name ExampleKeyStore
This command does not return any data. To verify that the command worked, use a describe-custom-key-stores
command.
For more information about updating an AWS CloudHSM key store, see Editing AWS CloudHSM key store settings in the AWS Key Management Service Developer Guide.
For more information about updating an external key store, see Editing external key store properties in the AWS Key Management Service Developer Guide.
Example 2: To edit the kmsuser password of an AWS CloudHSM key store
The following update-custom-key-store
example updates the value of the kmsuser
password to the current password for the kmsuser
in the CloudHSM cluster associated with the specified key store. This command doesn't change the kmsuser
password it the cluster. It just tells AWS KMS the current password. If KMS doesn't have the current kmsuser
password, it cannot connect to the AWS CloudHSM key store.
NOTE: Before updating an AWS CloudHSM key store, you must disconnect it. Use the disconnect-custom-key-store
command. After the command completes, you can reconnect the AWS CloudHSM key store. Use the connect-custom-key-store
command.
aws kms update-custom-key-store \
--custom-key-store-id cks-1234567890abcdef0 \
--key-store-password ExamplePassword
This command does not return any output. To verify that the change was effective, use a describe-custom-key-stores
command.
For more information about updating an AWS CloudHSM key store, see Editing AWS CloudHSM key store settings in the AWS Key Management Service Developer Guide.
Example 3: To edit the AWS CloudHSM cluster of an AWS CloudHSM key store
The following example changes the AWS CloudHSM cluster that is associated with an AWS CloudHSM key store to a related cluster, such as a different backup of the same cluster.
NOTE: Before updating an AWS CloudHSM key store, you must disconnect it. Use the disconnect-custom-key-store
command. After the command completes, you can reconnect the AWS CloudHSM key store. Use the connect-custom-key-store
command.
aws kms update-custom-key-store \
--custom-key-store-id cks-1234567890abcdef0 \
--cloud-hsm-cluster-id cluster-1a23b4cdefg
This command does not return any output. To verify that the change was effective, use a describe-custom-key-stores
command.
For more information about updating an AWS CloudHSM key store, see Editing AWS CloudHSM key store settings in the AWS Key Management Service Developer Guide.
Example 4: To edit the proxy authentication credential of an external key store
The following example updates the proxy authentication credential for your external key store. You must specify both the raw-secret-access-key
and the access-key-id
, even if you are changing only one of the values. You can use this feature to fix an invalid credential or to change the credential when the external key store proxy rotates it.
Establish the proxy authentication credential for AWS KMS on your external key store. Then use this command to provide the credential to AWS KMS. AWS KMS uses this credential to sign its requests to your external key store proxy.
You can update the proxy authentication credential while the external key store is connected or disconnected. To find the connection state of your custom key store, use the describe-custom-key-store
command.
aws kms update-custom-key-store \
--custom-key-store-id cks-1234567890abcdef0 \
--xks-proxy-authentication-credential "AccessKeyId=ABCDE12345670EXAMPLE, RawSecretAccessKey=DXjSUawnel2fr6SKC7G25CNxTyWKE5PF9XX6H/u9pSo="
This command does not return any output. To verify that the change was effective, use a describe-custom-key-stores
command.
For more information about updating an external key store, see Editing external key store properties in the AWS Key Management Service Developer Guide.
Example 5: To edit the proxy connectivity of an external key store
The following example changes the external key store proxy connectivity option from public endpoint connectivity to VPC endpoint service connectivity. In addition to changing the xks-proxy-connectivity
value, you must change the xks-proxy-uri-endpoint
value to reflect the private DNS name associated with the VPC endpoint service. You must also add an xks-proxy-vpc-endpoint-service-name
value.
NOTE: Before updating the proxy connectivity of an external store, you must disconnect it. Use the disconnect-custom-key-store
command. After the command completes, you can reconnect the external key store by using the connect-custom-key-store
command.
aws kms update-custom-key-store \
--custom-key-store-id cks-1234567890abcdef0 \
--xks-proxy-connectivity VPC_ENDPOINT_SERVICE \
--xks-proxy-uri-endpoint "https://myproxy-private.xks.example.com" \
--xks-proxy-vpc-endpoint-service-name "com.amazonaws.vpce.us-east-1.vpce-svc-example"
This command does not return any output. To verify that the change was effective, use a describe-custom-key-stores
command.
For more information about updating an external key store, see Editing external key store properties in the AWS Key Management Service Developer Guide.
None