All Products
Search
Document Center

Key Management Service:GetKmsInstance

Last Updated:Oct 26, 2026

Queries the details of a KMS instance.

Operation description

For details about the access policy that must be granted to a Resource Access Management (RAM) user or RAM role to invoke this API operation, see Access control.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

kms:GetKmsInstance

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

KmsInstanceId

string

Yes

The ID of the KMS instance.

kst-bjj62f5ba3dnpb6v8****

Response elements

Element

Type

Description

Example

object

The KMS instance details.

RequestId

string

The ID of the request. It is a unique identifier generated by Alibaba Cloud for the request and can be used for troubleshooting.

46b4a94a-57d2-44b4-9810-1e87d31abb33

KmsInstance

object

The KMS instance details.

3

InstanceId

string

The ID of the KMS instance.

kst-bjj62f5ba3dnpb6v8****

InstanceName

string

The name of the KMS instance.

kst-bjj62f5ba3dnpb6v8****

Status

string

The status of the KMS instance. Valid values:

  • Uninitialized: not enabled

  • Connecting: connecting

  • Connected: enabled

  • Disconnected: disconnected

  • Error: abnormal

Connected

CreateTime

string

The time when the KMS instance was created.

2023-09-05T12:44:20Z

Spec

integer

The computing performance of the KMS instance.

1000

KeyNum

integer

The number of keys that can be created in the KMS instance.

1000

SecretNum

string

The number of secrets that can be created in the KMS instance.

10

VpcNum

integer

The total number of VPCs that can access the KMS instance.

5

VpcId

string

The VPC to which the KMS instance is bound.

vpc-bp19z7cwmltad5dff****

ZoneIds

array

The zones to which the KMS instance is bound.

"cn-hangzhou-k", "cn-hangzhou-j"

string

VswitchIds

array

The vSwitches in the VPC to which the KMS instance is bound.

vsw-bp1i512amda6d10a0****

string

EndDate

string

The expiration time of the KMS instance.

2023-10-05T16:00:00Z

StartDate

string

The time when the KMS instance was enabled.

2023-09-05T12:44:19Z

CaCertificateChainPem

string

The content of the CA certificate for the KMS instance.

-----BEGIN CERTIFICATE-----\r\nMIIDuzCCAqOgAwIBAgIJALTKwWAjvbMiMA0GCSqGSIb3DQEBCwUAMHQxCzAJBgNV****-----END CERTIFICATE-----

BindVpcs

object

BindVpc

array<object>

The list of configured VPCs.

Note

If your self-managed applications are deployed in multiple VPCs in the same region, you can configure VPCs other than the VPC to which the KMS instance belongs (the VPC specified when the KMS instance is enabled) to the KMS instance. These VPCs can belong to the same Alibaba Cloud account or different Alibaba Cloud accounts. After the configuration is complete, the self-managed applications in these VPCs can access the specified KMS instance.

object

The list of configured VPCs.

Note

If your self-managed applications are deployed in multiple VPCs in the same region, you can configure VPCs other than the VPC bound to the KMS instance to the KMS instance. These VPCs can belong to the same Alibaba Cloud account or different Alibaba Cloud accounts. After the configuration is complete, the self-managed applications in these VPCs can access the specified KMS instance.

RegionId

string

The region to which the VPC belongs.

cn-hangzhou

VpcId

string

The ID of the VPC.

vpc-bp19z7djuhtad5dff****

VpcOwnerId

string

The Alibaba Cloud account to which the VPC belongs.

190325303126****

VSwitchId

string

The vSwitch in the VPC.

vsw-bp1i512amhdje10f1****

ChargeType

string

The billing method of the instance. Valid values:

  • PREPAY: subscription

  • POSTPAY: pay-as-you-go

POSTPAY

ProductVersion

string

The version of the KMS instance.

3

SaleStatus

string

The sales status.

Normal

Log

integer

Specifies whether logging is enabled for the KMS instance. Valid values:

  • 0: disabled

  • 1: enabled

1

LogStorage

integer

The log storage capacity. Unit: GB.

100

ProductType

string

The product type. Subscription:

  • kms_ddi_public_cn: China site

  • kms_ddi_public_intl: International site Pay-as-you-go:

  • kms_ppi_public_cn: China site

  • kms_ppi_public_intl: International site

kms_ddi_public_cn

Examples

Success response

JSON format

{
  "RequestId": "46b4a94a-57d2-44b4-9810-1e87d31abb33",
  "KmsInstance": {
    "InstanceId": "kst-bjj62f5ba3dnpb6v8****",
    "InstanceName": "kst-bjj62f5ba3dnpb6v8****",
    "Status": "Connected",
    "CreateTime": "2023-09-05T12:44:20Z",
    "Spec": 1000,
    "KeyNum": 1000,
    "SecretNum": "10",
    "VpcNum": 5,
    "VpcId": "vpc-bp19z7cwmltad5dff****",
    "ZoneIds": [
      ""
    ],
    "VswitchIds": [
      ""
    ],
    "EndDate": "2023-10-05T16:00:00Z",
    "StartDate": "2023-09-05T12:44:19Z",
    "CaCertificateChainPem": "-----BEGIN CERTIFICATE-----\\r\\nMIIDuzCCAqOgAwIBAgIJALTKwWAjvbMiMA0GCSqGSIb3DQEBCwUAMHQxCzAJBgNV****-----END CERTIFICATE-----",
    "BindVpcs": {
      "BindVpc": [
        {
          "RegionId": "cn-hangzhou",
          "VpcId": "vpc-bp19z7djuhtad5dff****",
          "VpcOwnerId": "190325303126****",
          "VSwitchId": "vsw-bp1i512amhdje10f1****"
        }
      ]
    },
    "ChargeType": "POSTPAY",
    "ProductVersion": "3",
    "SaleStatus": "Normal",
    "Log": 1,
    "LogStorage": 100,
    "ProductType": "kms_ddi_public_cn"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalTimestamp The input parameter Timestamp that is mandatory for processing this request is not supplied. The input parameter timestamp indicates that the request is outside the processing time range.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.