public void SecretsManagerCreateSecret()
        {
            #region to-create-a-basic-secret-1523996473658

            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\":\"BnQw!XDWgaEeT9XGTT29\"}"
            });

            string arn       = response.ARN;
            string name      = response.Name;
            string versionId = response.VersionId;

            #endregion
        }
Beispiel #2
0
 private Amazon.SecretsManager.Model.CreateSecretResponse CallAWSServiceOperation(IAmazonSecretsManager client, Amazon.SecretsManager.Model.CreateSecretRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Secrets Manager", "CreateSecret");
     try
     {
         #if DESKTOP
         return(client.CreateSecret(request));
         #elif CORECLR
         return(client.CreateSecretAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }