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.
Namespace: Amazon.SecretsManager.Model
Assembly: AWSSDK.SecretsManager.dll
Version: 3.x.y.z
public class DescribeSecretResponse : AmazonWebServiceResponse
The DescribeSecretResponse type exposes the following members
Name | Description | |
---|---|---|
DescribeSecretResponse() |
Name | Type | Description | |
---|---|---|---|
ARN | System.String |
Gets and sets the property ARN. The ARN of the secret. |
|
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. | |
CreatedDate | System.DateTime |
Gets and sets the property CreatedDate. The date the secret was created. |
|
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. |
|
Description | System.String |
Gets and sets the property Description. The description of the secret. |
|
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. | |
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 |
|
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. |
|
LastChangedDate | System.DateTime |
Gets and sets the property LastChangedDate. The last date and time that this secret was modified in any way. |
|
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. |
|
Name | System.String |
Gets and sets the property Name. The name of the secret. |
|
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. |
|
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. |
|
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 | 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:
|
|
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. | |
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. |
|
RotationLambdaARN | System.String |
Gets and sets the property RotationLambdaARN. The ARN of the Lambda function that Secrets Manager invokes to rotate the secret. |
|
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. |
|
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. |
|
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:
For more information about rotation and staging labels, see How rotation works. |
The following example shows how to get the details about 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;
.NET Core App:
Supported in: 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5, 4.0, 3.5