DescribeSecret - AWS Secrets Manager


Retrieves the details of a secret. It does not include the encrypted secret value. Secrets Manager only returns fields that have a value in the response.

Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters because it might be logged. For more information, see Logging Secrets Manager events with AWS CloudTrail.

Required permissions: secretsmanager:DescribeSecret. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager.

Request Syntax

{ "SecretId": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.


The ARN or name of the secret.

For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See Finding a secret from a partial ARN.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Required: Yes

Response Syntax

{ "ARN": "string", "CreatedDate": number, "DeletedDate": number, "Description": "string", "KmsKeyId": "string", "LastAccessedDate": number, "LastChangedDate": number, "LastRotatedDate": number, "Name": "string", "OwningService": "string", "PrimaryRegion": "string", "ReplicationStatus": [ { "KmsKeyId": "string", "LastAccessedDate": number, "Region": "string", "Status": "string", "StatusMessage": "string" } ], "RotationEnabled": boolean, "RotationLambdaARN": "string", "RotationRules": { "AutomaticallyAfterDays": number, "Duration": "string", "ScheduleExpression": "string" }, "Tags": [ { "Key": "string", "Value": "string" } ], "VersionIdsToStages": { "string" : [ "string" ] } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The ARN of the secret.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.


The date the secret was created.

Type: Timestamp


The date the secret is scheduled for deletion. If it is not scheduled for deletion, this field is omitted. When you delete a secret, Secrets Manager requires a recovery window of at least 7 days before deleting the secret. Some time after the deleted date, Secrets Manager deletes the secret, including all of its versions.

If a secret is scheduled for deletion, then its details, including the encrypted secret value, is not accessible. To cancel a scheduled deletion and restore access to the secret, use RestoreSecret.

Type: Timestamp


The description of the secret.

Type: String

Length Constraints: Maximum length of 2048.


The key ID or alias ARN of the AWS KMS key that Secrets Manager uses to encrypt the secret value. If the secret is encrypted with the AWS managed key aws/secretsmanager, this field is omitted. Secrets created using the console use an AWS KMS key ID.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.


The date that the secret was last accessed in the Region. This field is omitted if the secret has never been retrieved in the Region.

Type: Timestamp


The last date and time that this secret was modified in any way.

Type: Timestamp


The last date and time that Secrets Manager rotated the secret. If the secret isn't configured for rotation, Secrets Manager returns null.

Type: Timestamp


The name of the secret.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.


The ID of the service that created this secret. For more information, see Secrets managed by other AWS services.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.


The Region the secret is in. If a secret is replicated to other Regions, the replicas are listed in ReplicationStatus.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: ^([a-z]+-)+\d+$


A list of the replicas of this secret and their status:

  • Failed, which indicates that the replica was not created.

  • InProgress, which indicates that Secrets Manager is in the process of creating the replica.

  • InSync, which indicates that the replica was created.

Type: Array of ReplicationStatusType objects


Specifies whether automatic rotation is turned on for this secret.

To turn on rotation, use RotateSecret. To turn off rotation, use CancelRotateSecret.

Type: Boolean


The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.


The rotation schedule and Lambda function for this secret. If the secret previously had rotation turned on, but it is now turned off, this field shows the previous rotation schedule and rotation function. If the secret never had rotation turned on, this field is omitted.

Type: RotationRulesType object


The list of tags attached to the secret. To add tags to a secret, use TagResource. To remove tags, use UntagResource.

Type: Array of Tag objects


A list of the versions of the secret that have staging labels attached. Versions that don't have staging labels are considered deprecated and Secrets Manager can delete them.

Secrets Manager uses staging labels to indicate the status of a secret version during rotation. The three staging labels for rotation are:

  • AWSCURRENT, which indicates the current version of the secret.

  • AWSPENDING, which indicates the version of the secret that contains new secret information that will become the next current version when rotation finishes.

    During rotation, Secrets Manager creates an AWSPENDING version ID before creating the new secret version. To check if a secret version exists, call GetSecretValue.

  • AWSPREVIOUS, which indicates the previous current version of the secret. You can use this as the last known good version.

For more information about rotation and staging labels, see How rotation works.

Type: String to array of strings map

Key Length Constraints: Minimum length of 32. Maximum length of 64.

Array Members: Minimum number of 1 item. Maximum number of 20 items.

Length Constraints: Minimum length of 1. Maximum length of 256.


For information about the errors that are common to all actions, see Common Errors.


An error occurred on the server side.

HTTP Status Code: 500


The parameter name or value is invalid.

HTTP Status Code: 400


Secrets Manager can't find the resource that you asked for.

HTTP Status Code: 400



The following example shows how to get the details about a secret. The JSON request string input and response output displays formatted code with white space and line breaks for better readability. Submit your input as a single line JSON string.

Sample Request

POST / HTTP/1.1 Host: secretsmanager.region.domain Accept-Encoding: identity X-Amz-Target: secretsmanager.DescribeSecret Content-Type: application/x-amz-json-1.1 User-Agent: <user-agent-string> X-Amz-Date: <date> Authorization: AWS4-HMAC-SHA256 Credential=<credentials>,SignedHeaders=<headers>, Signature=<signature> Content-Length: <payload-size-bytes> { "SecretId": "MyTestDatabaseSecret" }

Sample Response

HTTP/1.1 200 OK Date: <date> Content-Type: application/x-amz-json-1.1 Content-Length: <response-size-bytes> Connection: keep-alive x-amzn-RequestId: <request-id-guid> { "ARN": "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3", "Name": "MyTestDatabaseSecret", "Description": "My test database secret created with the CLI", "LastChangedDate": 1523477145.729, "LastAccessedDate": 1606269226, "RotationEnabled": true, "RotationLambdaARN": "arn:aws:lambda:us-west-2:123456789012:function:MyTestRotationLambda", "RotationRules": { "AutomaticallyAfterDays": 14, "ScheduleExpression": "cron(0 16 1,15 * ? *)", "Duration": "2h" }, "LastRotatedDate": 1525747253.72 "Tags": [ { "Key": "SecondTag", "Value": "AnotherValue" }, { "Key": "FirstTag", "Value": "SomeValue" } ], "VersionIdsToStages": { "EXAMPLE1-90ab-cdef-fedc-ba987SECRET1": [ "AWSPREVIOUS" ], "EXAMPLE2-90ab-cdef-fedc-ba987SECRET2": [ "AWSCURRENT" ] } }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: