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

Inheritance Hierarchy

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

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

Syntax

C#
public class CreateSecretResponse : AmazonWebServiceResponse

The CreateSecretResponse type exposes the following members

Constructors

NameDescription
Public Method CreateSecretResponse()

Properties

NameTypeDescription
Public Property 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.

Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property Name System.String

Gets and sets the property Name.

The name of the new secret.

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 VersionId System.String

Gets and sets the property VersionId.

The unique identifier associated with the version of the new secret.

Examples

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.

To create a basic secret


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;

            

Version Information

.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