AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

This is the response object from the DescribeSecret operation.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.SecretsManager.Model.DescribeSecretResponse

Namespace: Amazon.SecretsManager.Model
Assembly: AWSSDK.SecretsManager.dll
Version: 3.x.y.z

Syntax

C#
public class DescribeSecretResponse : AmazonWebServiceResponse

The DescribeSecretResponse type exposes the following members

Constructors

NameDescription
Public Method DescribeSecretResponse()

Properties

NameTypeDescription
Public Property ARN System.String

Gets and sets the property ARN.

The ARN of the secret.

Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property CreatedDate System.DateTime

Gets and sets the property CreatedDate.

The date the secret was created.

Public Property DeletedDate System.DateTime

Gets and sets the property 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.

Public Property Description System.String

Gets and sets the property Description.

The description of the secret.

Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property KmsKeyId System.String

Gets and sets the property 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.

Public Property LastAccessedDate System.DateTime

Gets and sets the property 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.

Public Property LastChangedDate System.DateTime

Gets and sets the property LastChangedDate.

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

Public Property LastRotatedDate System.DateTime

Gets and sets the property 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.

Public Property Name System.String

Gets and sets the property Name.

The name of the secret.

Public Property NextRotationDate System.DateTime

Gets and sets the property 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.

Public Property OwningService System.String

Gets and sets the property OwningService.

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

Public Property PrimaryRegion System.String

Gets and sets the property PrimaryRegion.

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

Public Property ReplicationStatus System.Collections.Generic.List<Amazon.SecretsManager.Model.ReplicationStatusType>

Gets and sets the property 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.

Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property RotationEnabled System.Boolean

Gets and sets the property RotationEnabled.

Specifies whether automatic rotation is turned on for this secret.

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

Public Property RotationLambdaARN System.String

Gets and sets the property RotationLambdaARN.

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

Public Property RotationRules Amazon.SecretsManager.Model.RotationRulesType

Gets and sets the property 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.

Public Property Tags System.Collections.Generic.List<Amazon.SecretsManager.Model.Tag>

Gets and sets the property Tags.

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

Public Property VersionIdsToStages System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<System.String>>

Gets and sets the property 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.

Examples

The following example shows how to get the details about a secret.

To retrieve the details of a secret


var client = new AmazonSecretsManagerClient();
var response = client.DescribeSecret(new DescribeSecretRequest 
{
    SecretId = "MyTestDatabaseSecret"
});

string arn = response.ARN;
string description = response.Description;
string kmsKeyId = response.KmsKeyId;
DateTime lastAccessedDate = response.LastAccessedDate;
DateTime lastChangedDate = response.LastChangedDate;
DateTime lastRotatedDate = response.LastRotatedDate;
string name = response.Name;
DateTime nextRotationDate = response.NextRotationDate;
bool rotationEnabled = response.RotationEnabled;
string rotationLambdaARN = response.RotationLambdaARN;
RotationRulesType rotationRules = response.RotationRules;
List<Tag> tags = response.Tags;
Dictionary<string, List<string>> versionIdsToStages = response.VersionIdsToStages;

            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5