예제 #1
0
 private Amazon.SecretsManager.Model.DescribeSecretResponse CallAWSServiceOperation(IAmazonSecretsManager client, Amazon.SecretsManager.Model.DescribeSecretRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Secrets Manager", "DescribeSecret");
     try
     {
         #if DESKTOP
         return(client.DescribeSecret(request));
         #elif CORECLR
         return(client.DescribeSecretAsync(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;
     }
 }
        public void SecretsManagerDescribeSecret()
        {
            #region to-retrieve-the-details-of-a-secret-1524000138629

            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;
            bool              rotationEnabled   = response.RotationEnabled;
            string            rotationLambdaARN = response.RotationLambdaARN;
            RotationRulesType rotationRules     = response.RotationRules;
            List <Tag>        tags              = response.Tags;
            Dictionary <string, List <string> > versionIdsToStages = response.VersionIdsToStages;

            #endregion
        }