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 CreateSecret operation.
Namespace: Amazon.SecretsManager.Model
Assembly: AWSSDK.SecretsManager.dll
Version: 3.x.y.z
public class CreateSecretResponse : AmazonWebServiceResponse
The CreateSecretResponse type exposes the following members
Name | Description | |
---|---|---|
CreateSecretResponse() |
Name | Type | Description | |
---|---|---|---|
ARN | System.String |
Gets and sets the property ARN. The ARN of the new secret. The ARN includes the name of the secret followed by six random characters. This ensures that if you create a new secret with the same name as a deleted secret, then users with access to the old secret don't get access to the new secret because the ARNs are different. |
|
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. | |
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. | |
Name | System.String |
Gets and sets the property Name. The name of the new secret. |
|
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. | |
VersionId | System.String |
Gets and sets the property VersionId. The unique identifier associated with the version of the new secret. |
The following example shows how to create a secret. The credentials stored in the encrypted secret value are retrieved from a file on disk named mycreds.json.
var client = new AmazonSecretsManagerClient(); var response = client.CreateSecret(new CreateSecretRequest { ClientRequestToken = "EXAMPLE1-90ab-cdef-fedc-ba987SECRET1", Description = "My test database secret created with the CLI", Name = "MyTestDatabaseSecret", SecretString = "{\"username\":\"david\",\"password\":\"EXAMPLE-PASSWORD\"}" }); string arn = response.ARN; string name = response.Name; string versionId = response.VersionId;
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5