DescribeSecret
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.
- SecretId
-
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",
"ExternalSecretRotationMetadata": [
{
"Key": "string",
"Value": "string"
}
],
"ExternalSecretRotationRoleArn": "string",
"KmsKeyId": "string",
"LastAccessedDate": number,
"LastChangedDate": number,
"LastRotatedDate": number,
"Name": "string",
"NextRotationDate": number,
"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"
}
],
"Type": "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.
- ARN
-
The ARN of the secret.
Type: String
Length Constraints: Minimum length of 20. Maximum length of 2048.
- CreatedDate
-
The date the secret was created.
Type: Timestamp
- DeletedDate
-
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
- Description
-
The description of the secret.
Type: String
Length Constraints: Maximum length of 2048.
- ExternalSecretRotationMetadata
-
The metadata needed to successfully rotate a managed external secret. A list of key value pairs in JSON format specified by the partner. For more information about the required information, see Managed external secrets partners.
Type: Array of ExternalSecretRotationMetadataItem objects
- ExternalSecretRotationRoleArn
-
The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a third-party partner. For more information, see Security and permissions.
Type: String
Length Constraints: Minimum length of 20. Maximum length of 2048.
- KmsKeyId
-
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.
- LastAccessedDate
-
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
- LastChangedDate
-
The last date and time that this secret was modified in any way.
Type: Timestamp
- LastRotatedDate
-
The last date and time that Secrets Manager rotated the secret. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null.
Type: Timestamp
- Name
-
The name of the secret.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
- NextRotationDate
-
The next rotation is scheduled to occur on or before this date. If the secret isn't configured for rotation or rotation has been disabled, Secrets Manager returns null. If rotation fails, Secrets Manager retries the entire rotation process multiple times. If rotation is unsuccessful, this date may be in the past.
This date represents the latest date that rotation will occur, but it is not an approximate rotation date. In some cases, for example if you turn off automatic rotation and then turn it back on, the next rotation may occur much sooner than this date.
Type: Timestamp
- OwningService
-
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.
- PrimaryRegion
-
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+$ - ReplicationStatus
-
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
-
- RotationEnabled
-
Specifies whether automatic rotation is turned on for this secret. If the secret has never been configured for rotation, Secrets Manager returns null.
To turn on rotation, use RotateSecret. To turn off rotation, use CancelRotateSecret.
Type: Boolean
- RotationLambdaARN
-
The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.
Type: String