Queries the metadata of a secret.

This operation returns the metadata of a secret. This operation does not return the secret value.

In this example, the metadata of the secret named secret001 is queried.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeSecret

The operation that you want to perform. Set the value to DescribeSecret.

SecretName String Yes secret001

The name of the secret.

FetchTags String No true

Specifies whether to return the resource tags of the secret. Valid values:

  • true: The resource tags are returned.
  • false: The resource tags are not returned. This is the default value.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
UpdateTime String 2022-02-21T15:39:26Z

The time when the secret was updated.

CreateTime String 2022-02-21T15:39:26Z

The time when the secret was created.

NextRotationDate String 2022-07-06T18:22:03Z

The time when the next rotation will be performed.

Note This parameter is returned when automatic rotation is enabled.
EncryptionKeyId String 00aa68af-2c02-4f68-95fe-3435d330****

The ID of the customer master key (CMK) that is used to encrypt the secret value.

RotationInterval String 3153600s

The interval for automatic rotation.

The value is in the integer[unit] format. integer indicates the length of time. unit: indicates the time unit. The value of unit is fixed as s. For example, if the value is 604800s, automatic rotation is performed at a 7-day interval.

Note This parameter is returned when automatic rotation is enabled.
Arn String acs:kms:cn-hangzhou:154035569884****:secret/secret001

The Alibaba Cloud Resource Name (ARN) of the secret.

ExtendedConfig String {\"SecretSubType\":\"SingleUser\", \"DBInstanceId\":\"rm-uf667446pc955****\", \"CustomData\":{} }

The extended configuration of the secret.

Note This parameter is returned only for a managed ApsaraDB RDS secret, a managed Resource Access Management (RAM) secret, or a managed Elastic Compute Service (ECS) secret.
LastRotationDate String 2022-07-05T08:22:03Z

The time when the last rotation was performed.

Note This parameter is returned if the secret was rotated.
RequestId String 93348dfb-3627-4417-8d90-487a76a909c9

The ID of the request, which is used to locate and troubleshoot issues.

Description String userinfo

The description of the secret.

SecretName String secret001

The name of the secret.

AutomaticRotation String Enabled

Indicates whether automatic rotation is enabled. Valid values:

  • Enabled: indicates that automatic rotation is enabled.
  • Disabled: indicates that automatic rotation is disabled.
  • Invalid: indicates that the status of automatic rotation is abnormal. In this case, Secrets Manager cannot automatically rotate the secret.
Note This parameter is returned only for a managed ApsaraDB RDS secret, a managed RAM secret, or a managed ECS secret.
SecretType String Rds

The type of the secret. Valid values:

  • Generic: indicates a generic secret.
  • Rds: indicates a managed ApsaraDB RDS secret.
  • RAMCredentials: indicates a managed RAM secret.
  • ECS: indicates a managed ECS secret.
PlannedDeleteTime String 2022-03-21T15:45:12Z

The time when the secret is scheduled to be deleted.

DKMSInstanceId String kst-bjj62d8f5e0sgtx8h****

The ID of the dedicated KMS instance.

Tags Array of Tag

The resource tags of the secret.

This parameter is not returned if you set the FetchTags parameter to false or you do not specify the FetchTags parameter.

Tag
TagValue String val1

The tag value.

TagKey String key1

The tag key.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeSecret
&SecretName=secret001
&FetchTags=true
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeSecretResponse>
    <UpdateTime>2020-02-21T15:39:26Z</UpdateTime>
    <CreateTime>2020-02-21T15:39:26Z</CreateTime>
    <NextRotationDate>2020-07-06T18:22:03Z</NextRotationDate>
    <EncryptionKeyId>00aa68af-2c02-4f68-95fe-3435d330****</EncryptionKeyId>
    <RotationInterval>3153600s</RotationInterval>
    <Arn>acs:kms:cn-hangzhou:154035569884****:secret/secret001</Arn>
    <ExtendedConfig>{\"SecretSubType\":\"SingleUser\", \"DBInstanceId\":\"rm-uf667446pc955****\",  \"CustomData\":{} }</ExtendedConfig>
    <LastRotationDate>2020-07-05T08:22:03Z</LastRotationDate>
    <RequestId>93348dfb-3627-4417-8d90-487a76a909c9</RequestId>
    <Description>userinfo</Description>
    <SecretName>secret001</SecretName>
    <AutomaticRotation>Enabled</AutomaticRotation>
    <SecretType>Rds</SecretType>
    <PlannedDeleteTime>2020-03-21T15:45:12Z</PlannedDeleteTime>
    <DKMSInstanceId>kst-bjj62d8f5e0sgtx8h****</DKMSInstanceId>
    <Tags>
        <TagValue>val1</TagValue>
        <TagKey>key1</TagKey>
    </Tags>
</DescribeSecretResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "UpdateTime" : "2020-02-21T15:39:26Z",
  "CreateTime" : "2020-02-21T15:39:26Z",
  "NextRotationDate" : "2020-07-06T18:22:03Z",
  "EncryptionKeyId" : "00aa68af-2c02-4f68-95fe-3435d330****",
  "RotationInterval" : "3153600s",
  "Arn" : "acs:kms:cn-hangzhou:154035569884****:secret/secret001",
  "ExtendedConfig" : "{\\\"SecretSubType\\\":\\\"SingleUser\\\", \\\"DBInstanceId\\\":\\\"rm-uf667446pc955****\\\",  \\\"CustomData\\\":{} }",
  "LastRotationDate" : "2020-07-05T08:22:03Z",
  "RequestId" : "93348dfb-3627-4417-8d90-487a76a909c9",
  "Description" : "userinfo",
  "SecretName" : "secret001",
  "AutomaticRotation" : "Enabled",
  "SecretType" : "Rds",
  "PlannedDeleteTime" : "2020-03-21T15:45:12Z",
  "DKMSInstanceId" : "kst-bjj62d8f5e0sgtx8h****",
  "Tags" : [ {
    "TagValue" : "val1",
    "TagKey" : "key1"
  } ]
}

Error codes

For a list of error codes, visit the API Error Center.