Exemplo n.º 1
0
        private static async Task CreateKeyVersion(KmsManagementClient kmsManagementClient, string keyId)
        {
            logger.Info("Create Key Version");
            CreateKeyVersionRequest createKeyVersionRequest = new CreateKeyVersionRequest
            {
                KeyId = keyId
            };
            CreateKeyVersionResponse createKeyVersionResponse = await kmsManagementClient.CreateKeyVersion(createKeyVersionRequest);

            logger.Info($"Created key version");
        }
Exemplo n.º 2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            CreateKeyVersionRequest request;

            try
            {
                request = new CreateKeyVersionRequest
                {
                    KeyId         = KeyId,
                    OpcRequestId  = OpcRequestId,
                    OpcRetryToken = OpcRetryToken
                };

                response = client.CreateKeyVersion(request).GetAwaiter().GetResult();
                WriteOutput(response, response.KeyVersion);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }