public void KeyManagementServiceCreateKey()
        {
            #region to-create-a-cmk-1478028992966

            var response = client.CreateKey(new CreateKeyRequest
            {
                Tags = new List <Tag> {
                    new Tag {
                        TagKey   = "CreatedBy",
                        TagValue = "ExampleUser"
                    }
                } // One or more tags. Each tag consists of a tag key and a tag value.
            });

            KeyMetadata keyMetadata = response.KeyMetadata; // An object that contains information about the CMK created by this operation.

            #endregion
        }
示例#2
0
 private Amazon.KeyManagementService.Model.CreateKeyResponse CallAWSServiceOperation(IAmazonKeyManagementService client, Amazon.KeyManagementService.Model.CreateKeyRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Key Management Service", "CreateKey");
     try
     {
         #if DESKTOP
         return(client.CreateKey(request));
         #elif CORECLR
         return(client.CreateKeyAsync(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;
     }
 }