Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . secretsmanager ]



Retrieves the details of a secret. It does not include the encrypted fields. Only those fields that are populated with a value are returned in the response.

Minimum permissions

To run this command, you must have the following permissions:

  • secretsmanager:DescribeSecret
Related operations
  • To create a secret, use create-secret .
  • To modify a secret, use update-secret .
  • To retrieve the encrypted secret information in a version of the secret, use get-secret-value .
  • To list all of the secrets in the AWS account, use list-secrets .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


--secret-id <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--secret-id (string)

The identifier of the secret whose details you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.

--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.

--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.

See 'aws help' for descriptions of global parameters.


ARN -> (string)

The ARN of the secret.

Name -> (string)

The user-provided friendly name of the secret.

Description -> (string)

The user-provided description of the secret.

KmsKeyId -> (string)

The ARN or alias of the AWS KMS customer master key (CMK) that's used to encrypt the SecretString and SecretBinary fields in each version of the secret. If you don't provide a key, then AWS Secrets Manager defaults to encrypting the secret fields with the default KMS CMK (the one named awssecretsmanager ) for this account.

RotationEnabled -> (boolean)

Specifies whether automatic rotation is enabled for this secret.

To enable rotation, use rotate-secret with AutomaticallyRotateAfterDays set to a value greater than 0. To disable rotation, use cancel-rotate-secret .

RotationLambdaARN -> (string)

The ARN of a Lambda function that's invoked by AWS Secrets Manager to rotate the secret either automatically per the schedule or manually by a call to rotate-secret .

RotationRules -> (structure)

A structure that contains the rotation configuration for this secret.

AutomaticallyAfterDays -> (long)

Specifies the number of days between automatic scheduled rotations of the secret.

LastRotatedDate -> (timestamp)

The last date and time that the Secrets Manager rotation process for this secret was invoked.

LastChangedDate -> (timestamp)

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

LastAccessedDate -> (timestamp)

The last date that this secret was accessed. This value is truncated to midnight of the date and therefore shows only the date, not the time.

DeletedDate -> (timestamp)

This value exists if the secret is scheduled for deletion. Some time after the specified date and time, Secrets Manager deletes the secret and all of its versions.

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

Tags -> (list)

The list of user-defined tags that are associated with the secret. To add tags to a secret, use tag-resource . To remove tags, use untag-resource .


A structure that contains information about a tag.

Key -> (string)

The key identifier, or name, of the tag.

Value -> (string)

The string value that's associated with the key of the tag.

VersionIdsToStages -> (map)

A list of all of the currently assigned VersionStage staging labels and the SecretVersionId that each is attached to. Staging labels are used to keep track of the different versions during the rotation process.


A version that does not have any staging labels attached is considered deprecated and subject to deletion. Such versions are not included in this list.

key -> (string)

value -> (list)