amazonka-secretsmanager-2.0: Amazon Secrets Manager SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.SecretsManager.DescribeSecret

Description

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

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

Synopsis

Creating a Request

data DescribeSecret Source #

See: newDescribeSecret smart constructor.

Constructors

DescribeSecret' 

Fields

Instances

Instances details
ToJSON DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

ToHeaders DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

ToPath DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

ToQuery DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

AWSRequest DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

Associated Types

type AWSResponse DescribeSecret #

Generic DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

Associated Types

type Rep DescribeSecret :: Type -> Type #

Read DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

Show DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

NFData DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

Methods

rnf :: DescribeSecret -> () #

Eq DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

Hashable DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

type AWSResponse DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

type Rep DescribeSecret Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

type Rep DescribeSecret = D1 ('MetaData "DescribeSecret" "Amazonka.SecretsManager.DescribeSecret" "amazonka-secretsmanager-2.0-8tljeZ4CwL92E7JavkDb0o" 'False) (C1 ('MetaCons "DescribeSecret'" 'PrefixI 'True) (S1 ('MetaSel ('Just "secretId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))

newDescribeSecret Source #

Create a value of DescribeSecret with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:secretId:DescribeSecret', describeSecret_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.

Request Lenses

describeSecret_secretId :: Lens' DescribeSecret Text Source #

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.

Destructuring the Response

data DescribeSecretResponse Source #

See: newDescribeSecretResponse smart constructor.

Constructors

DescribeSecretResponse' 

Fields

  • arn :: Maybe Text

    The ARN of the secret.

  • createdDate :: Maybe POSIX

    The date the secret was created.

  • deletedDate :: Maybe POSIX

    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.

  • description :: Maybe Text

    The description of the secret.

  • kmsKeyId :: Maybe Text

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

  • lastAccessedDate :: Maybe POSIX

    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.

  • lastChangedDate :: Maybe POSIX

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

  • lastRotatedDate :: Maybe POSIX

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

  • name :: Maybe Text

    The name of the secret.

  • nextRotationDate :: Maybe POSIX
     
  • owningService :: Maybe Text

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

  • primaryRegion :: Maybe Text

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

  • replicationStatus :: Maybe [ReplicationStatusType]

    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.
  • rotationEnabled :: Maybe Bool

    Specifies whether automatic rotation is turned on for this secret.

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

  • rotationLambdaARN :: Maybe Text

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

  • rotationRules :: Maybe RotationRulesType

    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.

  • tags :: Maybe [Tag]

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

  • versionIdsToStages :: Maybe (HashMap Text (NonEmpty Text))

    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.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic DescribeSecretResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

Associated Types

type Rep DescribeSecretResponse :: Type -> Type #

Read DescribeSecretResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

Show DescribeSecretResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

NFData DescribeSecretResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

Methods

rnf :: DescribeSecretResponse -> () #

Eq DescribeSecretResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

type Rep DescribeSecretResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.DescribeSecret

type Rep DescribeSecretResponse = D1 ('MetaData "DescribeSecretResponse" "Amazonka.SecretsManager.DescribeSecret" "amazonka-secretsmanager-2.0-8tljeZ4CwL92E7JavkDb0o" 'False) (C1 ('MetaCons "DescribeSecretResponse'" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "arn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "createdDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX))) :*: (S1 ('MetaSel ('Just "deletedDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "kmsKeyId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "lastAccessedDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX))) :*: (S1 ('MetaSel ('Just "lastChangedDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: (S1 ('MetaSel ('Just "lastRotatedDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))))) :*: (((S1 ('MetaSel ('Just "nextRotationDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: S1 ('MetaSel ('Just "owningService") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "primaryRegion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "replicationStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [ReplicationStatusType])) :*: S1 ('MetaSel ('Just "rotationEnabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))))) :*: ((S1 ('MetaSel ('Just "rotationLambdaARN") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "rotationRules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RotationRulesType))) :*: (S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Tag])) :*: (S1 ('MetaSel ('Just "versionIdsToStages") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (HashMap Text (NonEmpty Text)))) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))))

newDescribeSecretResponse Source #

Create a value of DescribeSecretResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

DescribeSecretResponse, describeSecretResponse_arn - The ARN of the secret.

DescribeSecretResponse, describeSecretResponse_createdDate - The date the secret was created.

DescribeSecretResponse, describeSecretResponse_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.

DescribeSecretResponse, describeSecretResponse_description - The description of the secret.

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

DescribeSecretResponse, describeSecretResponse_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.

DescribeSecretResponse, describeSecretResponse_lastChangedDate - The last date and time that this secret was modified in any way.

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

DescribeSecretResponse, describeSecretResponse_name - The name of the secret.

DescribeSecretResponse, describeSecretResponse_nextRotationDate - Undocumented member.

DescribeSecretResponse, describeSecretResponse_owningService - The ID of the service that created this secret. For more information, see Secrets managed by other Amazon Web Services services.

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

$sel:replicationStatus:DescribeSecretResponse', describeSecretResponse_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.

DescribeSecretResponse, describeSecretResponse_rotationEnabled - Specifies whether automatic rotation is turned on for this secret.

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

DescribeSecretResponse, describeSecretResponse_rotationLambdaARN - The ARN of the Lambda function that Secrets Manager invokes to rotate the secret.

DescribeSecretResponse, describeSecretResponse_rotationRules - 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.

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

$sel:versionIdsToStages:DescribeSecretResponse', describeSecretResponse_versionIdsToStages - 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.

$sel:httpStatus:DescribeSecretResponse', describeSecretResponse_httpStatus - The response's http status code.

Response Lenses

describeSecretResponse_deletedDate :: Lens' DescribeSecretResponse (Maybe UTCTime) Source #

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.

describeSecretResponse_kmsKeyId :: Lens' DescribeSecretResponse (Maybe Text) Source #

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

describeSecretResponse_lastAccessedDate :: Lens' DescribeSecretResponse (Maybe UTCTime) Source #

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.

describeSecretResponse_lastChangedDate :: Lens' DescribeSecretResponse (Maybe UTCTime) Source #

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

describeSecretResponse_lastRotatedDate :: Lens' DescribeSecretResponse (Maybe UTCTime) Source #

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

describeSecretResponse_primaryRegion :: Lens' DescribeSecretResponse (Maybe Text) Source #

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

describeSecretResponse_replicationStatus :: Lens' DescribeSecretResponse (Maybe [ReplicationStatusType]) Source #

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.

describeSecretResponse_rotationEnabled :: Lens' DescribeSecretResponse (Maybe Bool) Source #

Specifies whether automatic rotation is turned on for this secret.

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

describeSecretResponse_rotationLambdaARN :: Lens' DescribeSecretResponse (Maybe Text) Source #

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

describeSecretResponse_rotationRules :: Lens' DescribeSecretResponse (Maybe RotationRulesType) Source #

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.

describeSecretResponse_tags :: Lens' DescribeSecretResponse (Maybe [Tag]) Source #

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

describeSecretResponse_versionIdsToStages :: Lens' DescribeSecretResponse (Maybe (HashMap Text (NonEmpty Text))) Source #

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.