@aws-sdk/client-kms 3.288.0 → 3.290.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist-types/commands/CancelKeyDeletionCommand.d.ts +51 -0
  2. package/dist-types/commands/ConnectCustomKeyStoreCommand.d.ts +96 -0
  3. package/dist-types/commands/CreateAliasCommand.d.ts +54 -0
  4. package/dist-types/commands/CreateCustomKeyStoreCommand.d.ts +193 -0
  5. package/dist-types/commands/CreateGrantCommand.d.ts +67 -0
  6. package/dist-types/commands/CreateKeyCommand.d.ts +405 -0
  7. package/dist-types/commands/DecryptCommand.d.ts +94 -0
  8. package/dist-types/commands/DeleteAliasCommand.d.ts +42 -0
  9. package/dist-types/commands/DeleteCustomKeyStoreCommand.d.ts +62 -0
  10. package/dist-types/commands/DeleteImportedKeyMaterialCommand.d.ts +50 -0
  11. package/dist-types/commands/DescribeCustomKeyStoresCommand.d.ts +114 -0
  12. package/dist-types/commands/DescribeKeyCommand.d.ts +245 -0
  13. package/dist-types/commands/DisableKeyCommand.d.ts +46 -0
  14. package/dist-types/commands/DisableKeyRotationCommand.d.ts +53 -0
  15. package/dist-types/commands/DisconnectCustomKeyStoreCommand.d.ts +56 -0
  16. package/dist-types/commands/EnableKeyCommand.d.ts +50 -0
  17. package/dist-types/commands/EnableKeyRotationCommand.d.ts +53 -0
  18. package/dist-types/commands/EncryptCommand.d.ts +80 -0
  19. package/dist-types/commands/GenerateDataKeyCommand.d.ts +81 -0
  20. package/dist-types/commands/GenerateDataKeyPairCommand.d.ts +87 -0
  21. package/dist-types/commands/GenerateDataKeyPairWithoutPlaintextCommand.d.ts +86 -0
  22. package/dist-types/commands/GenerateDataKeyWithoutPlaintextCommand.d.ts +80 -0
  23. package/dist-types/commands/GenerateMacCommand.d.ts +78 -0
  24. package/dist-types/commands/GenerateRandomCommand.d.ts +69 -0
  25. package/dist-types/commands/GetKeyPolicyCommand.d.ts +52 -0
  26. package/dist-types/commands/GetKeyRotationStatusCommand.d.ts +55 -0
  27. package/dist-types/commands/GetParametersForImportCommand.d.ts +60 -0
  28. package/dist-types/commands/GetPublicKeyCommand.d.ts +93 -0
  29. package/dist-types/commands/ImportKeyMaterialCommand.d.ts +73 -0
  30. package/dist-types/commands/ListAliasesCommand.d.ts +77 -0
  31. package/dist-types/commands/ListGrantsCommand.d.ts +111 -0
  32. package/dist-types/commands/ListKeyPoliciesCommand.d.ts +54 -0
  33. package/dist-types/commands/ListKeysCommand.d.ts +57 -0
  34. package/dist-types/commands/ListResourceTagsCommand.d.ts +47 -0
  35. package/dist-types/commands/ListRetirableGrantsCommand.d.ts +51 -0
  36. package/dist-types/commands/PutKeyPolicyCommand.d.ts +60 -0
  37. package/dist-types/commands/ReEncryptCommand.d.ts +95 -0
  38. package/dist-types/commands/ReplicateKeyCommand.d.ts +101 -0
  39. package/dist-types/commands/RetireGrantCommand.d.ts +53 -0
  40. package/dist-types/commands/RevokeGrantCommand.d.ts +50 -0
  41. package/dist-types/commands/ScheduleKeyDeletionCommand.d.ts +53 -0
  42. package/dist-types/commands/SignCommand.d.ts +104 -0
  43. package/dist-types/commands/TagResourceCommand.d.ts +55 -0
  44. package/dist-types/commands/UntagResourceCommand.d.ts +49 -0
  45. package/dist-types/commands/UpdateAliasCommand.d.ts +47 -0
  46. package/dist-types/commands/UpdateCustomKeyStoreCommand.d.ts +234 -0
  47. package/dist-types/commands/UpdateKeyDescriptionCommand.d.ts +47 -0
  48. package/dist-types/commands/UpdatePrimaryRegionCommand.d.ts +54 -0
  49. package/dist-types/commands/VerifyCommand.d.ts +111 -0
  50. package/dist-types/commands/VerifyMacCommand.d.ts +84 -0
  51. package/package.json +29 -29
@@ -195,6 +195,411 @@ export interface CreateKeyCommandOutput extends CreateKeyResponse, __MetadataBea
195
195
  * @see {@link CreateKeyCommandOutput} for command's `response` shape.
196
196
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
197
197
  *
198
+ * @throws {@link CloudHsmClusterInvalidConfigurationException} (client fault)
199
+ * <p>The request was rejected because the associated CloudHSM cluster did not meet the
200
+ * configuration requirements for an CloudHSM key store.</p>
201
+ * <ul>
202
+ * <li>
203
+ * <p>The CloudHSM cluster must be configured with private subnets in at least two different
204
+ * Availability Zones in the Region.</p>
205
+ * </li>
206
+ * <li>
207
+ * <p>The <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html">security group for
208
+ * the cluster</a> (cloudhsm-cluster-<i><cluster-id></i>-sg) must
209
+ * include inbound rules and outbound rules that allow TCP traffic on ports 2223-2225. The
210
+ * <b>Source</b> in the inbound rules and the <b>Destination</b> in the outbound rules must match the security group
211
+ * ID. These rules are set by default when you create the CloudHSM cluster. Do not delete or
212
+ * change them. To get information about a particular security group, use the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html">DescribeSecurityGroups</a> operation.</p>
213
+ * </li>
214
+ * <li>
215
+ * <p>The CloudHSM cluster must contain at least as many HSMs as the operation requires. To add
216
+ * HSMs, use the CloudHSM <a href="https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html">CreateHsm</a> operation.</p>
217
+ * <p>For the <a>CreateCustomKeyStore</a>, <a>UpdateCustomKeyStore</a>, and <a>CreateKey</a> operations, the CloudHSM cluster must have at least two
218
+ * active HSMs, each in a different Availability Zone. For the <a>ConnectCustomKeyStore</a> operation, the CloudHSM must contain at least one active
219
+ * HSM.</p>
220
+ * </li>
221
+ * </ul>
222
+ * <p>For information about the requirements for an CloudHSM cluster that is associated with an
223
+ * CloudHSM key store, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore">Assemble the Prerequisites</a>
224
+ * in the <i>Key Management Service Developer Guide</i>. For information about creating a private subnet for an CloudHSM cluster,
225
+ * see <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html">Create a Private
226
+ * Subnet</a> in the <i>CloudHSM User Guide</i>. For information about cluster security groups, see
227
+ * <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html">Configure a Default Security
228
+ * Group</a> in the <i>
229
+ * <i>CloudHSM User Guide</i>
230
+ * </i>. </p>
231
+ *
232
+ * @throws {@link CustomKeyStoreInvalidStateException} (client fault)
233
+ * <p>The request was rejected because of the <code>ConnectionState</code> of the custom key
234
+ * store. To get the <code>ConnectionState</code> of a custom key store, use the <a>DescribeCustomKeyStores</a> operation.</p>
235
+ * <p>This exception is thrown under the following conditions:</p>
236
+ * <ul>
237
+ * <li>
238
+ * <p>You requested the <a>ConnectCustomKeyStore</a> operation on a custom key
239
+ * store with a <code>ConnectionState</code> of <code>DISCONNECTING</code> or
240
+ * <code>FAILED</code>. This operation is valid for all other <code>ConnectionState</code>
241
+ * values. To reconnect a custom key store in a <code>FAILED</code> state, disconnect it
242
+ * (<a>DisconnectCustomKeyStore</a>), then connect it
243
+ * (<code>ConnectCustomKeyStore</code>).</p>
244
+ * </li>
245
+ * <li>
246
+ * <p>You requested the <a>CreateKey</a> operation in a custom key store that is
247
+ * not connected. This operations is valid only when the custom key store
248
+ * <code>ConnectionState</code> is <code>CONNECTED</code>.</p>
249
+ * </li>
250
+ * <li>
251
+ * <p>You requested the <a>DisconnectCustomKeyStore</a> operation on a custom key
252
+ * store with a <code>ConnectionState</code> of <code>DISCONNECTING</code> or
253
+ * <code>DISCONNECTED</code>. This operation is valid for all other
254
+ * <code>ConnectionState</code> values.</p>
255
+ * </li>
256
+ * <li>
257
+ * <p>You requested the <a>UpdateCustomKeyStore</a> or <a>DeleteCustomKeyStore</a> operation on a custom key store that is not
258
+ * disconnected. This operation is valid only when the custom key store
259
+ * <code>ConnectionState</code> is <code>DISCONNECTED</code>.</p>
260
+ * </li>
261
+ * <li>
262
+ * <p>You requested the <a>GenerateRandom</a> operation in an CloudHSM key store
263
+ * that is not connected. This operation is valid only when the CloudHSM key store
264
+ * <code>ConnectionState</code> is <code>CONNECTED</code>. </p>
265
+ * </li>
266
+ * </ul>
267
+ *
268
+ * @throws {@link CustomKeyStoreNotFoundException} (client fault)
269
+ * <p>The request was rejected because KMS cannot find a custom key store with the specified
270
+ * key store name or ID.</p>
271
+ *
272
+ * @throws {@link DependencyTimeoutException} (server fault)
273
+ * <p>The system timed out while trying to fulfill the request. You can retry the
274
+ * request.</p>
275
+ *
276
+ * @throws {@link InvalidArnException} (client fault)
277
+ * <p>The request was rejected because a specified ARN, or an ARN in a key policy, is not
278
+ * valid.</p>
279
+ *
280
+ * @throws {@link KMSInternalException} (server fault)
281
+ * <p>The request was rejected because an internal exception occurred. The request can be
282
+ * retried.</p>
283
+ *
284
+ * @throws {@link LimitExceededException} (client fault)
285
+ * <p>The request was rejected because a quota was exceeded. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/limits.html">Quotas</a> in the
286
+ * <i>Key Management Service Developer Guide</i>.</p>
287
+ *
288
+ * @throws {@link MalformedPolicyDocumentException} (client fault)
289
+ * <p>The request was rejected because the specified policy is not syntactically or semantically
290
+ * correct.</p>
291
+ *
292
+ * @throws {@link TagException} (client fault)
293
+ * <p>The request was rejected because one or more tags are not valid.</p>
294
+ *
295
+ * @throws {@link UnsupportedOperationException} (client fault)
296
+ * <p>The request was rejected because a specified parameter is not supported or a specified
297
+ * resource is not valid for this operation.</p>
298
+ *
299
+ * @throws {@link XksKeyAlreadyInUseException} (client fault)
300
+ * <p>The request was rejected because the (<code>XksKeyId</code>) is already associated with a
301
+ * KMS key in this external key store. Each KMS key in an external key store must be associated
302
+ * with a different external key.</p>
303
+ *
304
+ * @throws {@link XksKeyInvalidConfigurationException} (client fault)
305
+ * <p>The request was rejected because the external key specified by the <code>XksKeyId</code>
306
+ * parameter did not meet the configuration requirements for an external key store.</p>
307
+ * <p>The external key must be an AES-256 symmetric key that is enabled and performs encryption
308
+ * and decryption.</p>
309
+ *
310
+ * @throws {@link XksKeyNotFoundException} (client fault)
311
+ * <p>The request was rejected because the external key store proxy could not find the external key. This
312
+ * exception is thrown when the value of the <code>XksKeyId</code> parameter doesn't identify a
313
+ * key in the external key manager associated with the external key proxy.</p>
314
+ * <p>Verify that the <code>XksKeyId</code> represents an existing key in the external key
315
+ * manager. Use the key identifier that the external key store proxy uses to identify the key.
316
+ * For details, see the documentation provided with your external key store proxy or key
317
+ * manager.</p>
318
+ *
319
+ *
320
+ * @example To create a KMS key
321
+ * ```javascript
322
+ * // The following example creates a symmetric KMS key for encryption and decryption. No parameters are required for this operation.
323
+ * const input = {};
324
+ * const command = new CreateKeyCommand(input);
325
+ * const response = await client.send(command);
326
+ * /* response ==
327
+ * {
328
+ * "KeyMetadata": {
329
+ * "AWSAccountId": "111122223333",
330
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
331
+ * "CreationDate": "2017-07-05T14:04:55-07:00",
332
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
333
+ * "Description": "",
334
+ * "Enabled": true,
335
+ * "EncryptionAlgorithms": [
336
+ * "SYMMETRIC_DEFAULT"
337
+ * ],
338
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
339
+ * "KeyManager": "CUSTOMER",
340
+ * "KeySpec": "SYMMETRIC_DEFAULT",
341
+ * "KeyState": "Enabled",
342
+ * "KeyUsage": "ENCRYPT_DECRYPT",
343
+ * "MultiRegion": false,
344
+ * "Origin": "AWS_KMS"
345
+ * }
346
+ * }
347
+ * *\/
348
+ * // example id: to-create-a-cmk-1
349
+ * ```
350
+ *
351
+ * @example To create an asymmetric RSA KMS key for encryption and decryption
352
+ * ```javascript
353
+ * // This example creates a KMS key that contains an asymmetric RSA key pair for encryption and decryption. The key spec and key usage can't be changed after the key is created.
354
+ * const input = {
355
+ * "KeySpec": "RSA_4096",
356
+ * "KeyUsage": "ENCRYPT_DECRYPT"
357
+ * };
358
+ * const command = new CreateKeyCommand(input);
359
+ * const response = await client.send(command);
360
+ * /* response ==
361
+ * {
362
+ * "KeyMetadata": {
363
+ * "AWSAccountId": "111122223333",
364
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
365
+ * "CreationDate": "2021-04-05T14:04:55-07:00",
366
+ * "CustomerMasterKeySpec": "RSA_4096",
367
+ * "Description": "",
368
+ * "Enabled": true,
369
+ * "EncryptionAlgorithms": [
370
+ * "RSAES_OAEP_SHA_1",
371
+ * "RSAES_OAEP_SHA_256"
372
+ * ],
373
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
374
+ * "KeyManager": "CUSTOMER",
375
+ * "KeySpec": "RSA_4096",
376
+ * "KeyState": "Enabled",
377
+ * "KeyUsage": "ENCRYPT_DECRYPT",
378
+ * "MultiRegion": false,
379
+ * "Origin": "AWS_KMS"
380
+ * }
381
+ * }
382
+ * *\/
383
+ * // example id: to-create-an-asymmetric-rsa-kms-key-for-encryption-and-decryption-2
384
+ * ```
385
+ *
386
+ * @example To create an asymmetric elliptic curve KMS key for signing and verification
387
+ * ```javascript
388
+ * // This example creates a KMS key that contains an asymmetric elliptic curve (ECC) key pair for signing and verification. The key usage is required even though "SIGN_VERIFY" is the only valid value for ECC KMS keys. The key spec and key usage can't be changed after the key is created.
389
+ * const input = {
390
+ * "KeySpec": "ECC_NIST_P521",
391
+ * "KeyUsage": "SIGN_VERIFY"
392
+ * };
393
+ * const command = new CreateKeyCommand(input);
394
+ * const response = await client.send(command);
395
+ * /* response ==
396
+ * {
397
+ * "KeyMetadata": {
398
+ * "AWSAccountId": "111122223333",
399
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
400
+ * "CreationDate": "2019-12-02T07:48:55-07:00",
401
+ * "CustomerMasterKeySpec": "ECC_NIST_P521",
402
+ * "Description": "",
403
+ * "Enabled": true,
404
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
405
+ * "KeyManager": "CUSTOMER",
406
+ * "KeySpec": "ECC_NIST_P521",
407
+ * "KeyState": "Enabled",
408
+ * "KeyUsage": "SIGN_VERIFY",
409
+ * "MultiRegion": false,
410
+ * "Origin": "AWS_KMS",
411
+ * "SigningAlgorithms": [
412
+ * "ECDSA_SHA_512"
413
+ * ]
414
+ * }
415
+ * }
416
+ * *\/
417
+ * // example id: to-create-an-asymmetric-elliptic-curve-kms-key-for-signing-and-verification-3
418
+ * ```
419
+ *
420
+ * @example To create an HMAC KMS key
421
+ * ```javascript
422
+ * // This example creates a 384-bit symmetric HMAC KMS key. The GENERATE_VERIFY_MAC key usage value is required even though it's the only valid value for HMAC KMS keys. The key spec and key usage can't be changed after the key is created.
423
+ * const input = {
424
+ * "KeySpec": "HMAC_384",
425
+ * "KeyUsage": "GENERATE_VERIFY_MAC"
426
+ * };
427
+ * const command = new CreateKeyCommand(input);
428
+ * const response = await client.send(command);
429
+ * /* response ==
430
+ * {
431
+ * "KeyMetadata": {
432
+ * "AWSAccountId": "111122223333",
433
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
434
+ * "CreationDate": "2022-04-05T14:04:55-07:00",
435
+ * "CustomerMasterKeySpec": "HMAC_384",
436
+ * "Description": "",
437
+ * "Enabled": true,
438
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
439
+ * "KeyManager": "CUSTOMER",
440
+ * "KeySpec": "HMAC_384",
441
+ * "KeyState": "Enabled",
442
+ * "KeyUsage": "GENERATE_VERIFY_MAC",
443
+ * "MacAlgorithms": [
444
+ * "HMAC_SHA_384"
445
+ * ],
446
+ * "MultiRegion": false,
447
+ * "Origin": "AWS_KMS"
448
+ * }
449
+ * }
450
+ * *\/
451
+ * // example id: to-create-an-hmac-kms-key-1630628752841
452
+ * ```
453
+ *
454
+ * @example To create a multi-Region primary KMS key
455
+ * ```javascript
456
+ * // This example creates a multi-Region primary symmetric encryption key. Because the default values for all parameters create a symmetric encryption key, only the MultiRegion parameter is required for this KMS key.
457
+ * const input = {
458
+ * "MultiRegion": true
459
+ * };
460
+ * const command = new CreateKeyCommand(input);
461
+ * const response = await client.send(command);
462
+ * /* response ==
463
+ * {
464
+ * "KeyMetadata": {
465
+ * "AWSAccountId": "111122223333",
466
+ * "Arn": "arn:aws:kms:us-west-2:111122223333:key/mrk-1234abcd12ab34cd56ef12345678990ab",
467
+ * "CreationDate": "2021-09-02T016:15:21-09:00",
468
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
469
+ * "Description": "",
470
+ * "Enabled": true,
471
+ * "EncryptionAlgorithms": [
472
+ * "SYMMETRIC_DEFAULT"
473
+ * ],
474
+ * "KeyId": "mrk-1234abcd12ab34cd56ef12345678990ab",
475
+ * "KeyManager": "CUSTOMER",
476
+ * "KeySpec": "SYMMETRIC_DEFAULT",
477
+ * "KeyState": "Enabled",
478
+ * "KeyUsage": "ENCRYPT_DECRYPT",
479
+ * "MultiRegion": true,
480
+ * "MultiRegionConfiguration": {
481
+ * "MultiRegionKeyType": "PRIMARY",
482
+ * "PrimaryKey": {
483
+ * "Arn": "arn:aws:kms:us-west-2:111122223333:key/mrk-1234abcd12ab34cd56ef12345678990ab",
484
+ * "Region": "us-west-2"
485
+ * },
486
+ * "ReplicaKeys": []
487
+ * },
488
+ * "Origin": "AWS_KMS"
489
+ * }
490
+ * }
491
+ * *\/
492
+ * // example id: to-create-a-multi-region-primary-kms-key-4
493
+ * ```
494
+ *
495
+ * @example To create a KMS key for imported key material
496
+ * ```javascript
497
+ * // This example creates a KMS key with no key material. When the operation is complete, you can import your own key material into the KMS key. To create this KMS key, set the Origin parameter to EXTERNAL.
498
+ * const input = {
499
+ * "Origin": "EXTERNAL"
500
+ * };
501
+ * const command = new CreateKeyCommand(input);
502
+ * const response = await client.send(command);
503
+ * /* response ==
504
+ * {
505
+ * "KeyMetadata": {
506
+ * "AWSAccountId": "111122223333",
507
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
508
+ * "CreationDate": "2019-12-02T07:48:55-07:00",
509
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
510
+ * "Description": "",
511
+ * "Enabled": false,
512
+ * "EncryptionAlgorithms": [
513
+ * "SYMMETRIC_DEFAULT"
514
+ * ],
515
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
516
+ * "KeyManager": "CUSTOMER",
517
+ * "KeySpec": "SYMMETRIC_DEFAULT",
518
+ * "KeyState": "PendingImport",
519
+ * "KeyUsage": "ENCRYPT_DECRYPT",
520
+ * "MultiRegion": false,
521
+ * "Origin": "EXTERNAL"
522
+ * }
523
+ * }
524
+ * *\/
525
+ * // example id: to-create-a-kms-key-for-imported-key-material-5
526
+ * ```
527
+ *
528
+ * @example To create a KMS key in an AWS CloudHSM key store
529
+ * ```javascript
530
+ * // This example creates a KMS key in the specified AWS CloudHSM key store. The operation creates the KMS key and its metadata in AWS KMS and creates the key material in the AWS CloudHSM cluster associated with the custom key store. This example requires the CustomKeyStoreId and Origin parameters.
531
+ * const input = {
532
+ * "CustomKeyStoreId": "cks-1234567890abcdef0",
533
+ * "Origin": "AWS_CLOUDHSM"
534
+ * };
535
+ * const command = new CreateKeyCommand(input);
536
+ * const response = await client.send(command);
537
+ * /* response ==
538
+ * {
539
+ * "KeyMetadata": {
540
+ * "AWSAccountId": "111122223333",
541
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
542
+ * "CloudHsmClusterId": "cluster-1a23b4cdefg",
543
+ * "CreationDate": "2019-12-02T07:48:55-07:00",
544
+ * "CustomKeyStoreId": "cks-1234567890abcdef0",
545
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
546
+ * "Description": "",
547
+ * "Enabled": true,
548
+ * "EncryptionAlgorithms": [
549
+ * "SYMMETRIC_DEFAULT"
550
+ * ],
551
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
552
+ * "KeyManager": "CUSTOMER",
553
+ * "KeySpec": "SYMMETRIC_DEFAULT",
554
+ * "KeyState": "Enabled",
555
+ * "KeyUsage": "ENCRYPT_DECRYPT",
556
+ * "MultiRegion": false,
557
+ * "Origin": "AWS_CLOUDHSM"
558
+ * }
559
+ * }
560
+ * *\/
561
+ * // example id: to-create-a-kms-key-in-an-aws-cloudhsm-custom-key-store-6
562
+ * ```
563
+ *
564
+ * @example To create a KMS key in an external key store
565
+ * ```javascript
566
+ * // This example creates a KMS key in the specified external key store. It uses the XksKeyId parameter to associate the KMS key with an existing symmetric encryption key in your external key manager. This CustomKeyStoreId, Origin, and XksKeyId parameters are required in this operation.
567
+ * const input = {
568
+ * "CustomKeyStoreId": "cks-9876543210fedcba9",
569
+ * "Origin": "EXTERNAL_KEY_STORE",
570
+ * "XksKeyId": "bb8562717f809024"
571
+ * };
572
+ * const command = new CreateKeyCommand(input);
573
+ * const response = await client.send(command);
574
+ * /* response ==
575
+ * {
576
+ * "KeyMetadata": {
577
+ * "AWSAccountId": "111122223333",
578
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/0987dcba-09fe-87dc-65ba-ab0987654321",
579
+ * "CreationDate": "2022-02-02T07:48:55-07:00",
580
+ * "CustomKeyStoreId": "cks-9876543210fedcba9",
581
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
582
+ * "Description": "",
583
+ * "Enabled": true,
584
+ * "EncryptionAlgorithms": [
585
+ * "SYMMETRIC_DEFAULT"
586
+ * ],
587
+ * "KeyId": "0987dcba-09fe-87dc-65ba-ab0987654321",
588
+ * "KeyManager": "CUSTOMER",
589
+ * "KeySpec": "SYMMETRIC_DEFAULT",
590
+ * "KeyState": "Enabled",
591
+ * "KeyUsage": "ENCRYPT_DECRYPT",
592
+ * "MultiRegion": false,
593
+ * "Origin": "EXTERNAL_KEY_STORE",
594
+ * "XksKeyConfiguration": {
595
+ * "Id": "bb8562717f809024"
596
+ * }
597
+ * }
598
+ * }
599
+ * *\/
600
+ * // example id: to-create-a-kms-key-in-an-external-custom-key-store-7
601
+ * ```
602
+ *
198
603
  */
199
604
  export declare class CreateKeyCommand extends $Command<CreateKeyCommandInput, CreateKeyCommandOutput, KMSClientResolvedConfig> {
200
605
  readonly input: CreateKeyCommandInput;
@@ -116,6 +116,100 @@ export interface DecryptCommandOutput extends DecryptResponse, __MetadataBearer
116
116
  * @see {@link DecryptCommandOutput} for command's `response` shape.
117
117
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
118
118
  *
119
+ * @throws {@link DependencyTimeoutException} (server fault)
120
+ * <p>The system timed out while trying to fulfill the request. You can retry the
121
+ * request.</p>
122
+ *
123
+ * @throws {@link DisabledException} (client fault)
124
+ * <p>The request was rejected because the specified KMS key is not enabled.</p>
125
+ *
126
+ * @throws {@link IncorrectKeyException} (client fault)
127
+ * <p>The request was rejected because the specified KMS key cannot decrypt the data. The
128
+ * <code>KeyId</code> in a <a>Decrypt</a> request and the <code>SourceKeyId</code>
129
+ * in a <a>ReEncrypt</a> request must identify the same KMS key that was used to
130
+ * encrypt the ciphertext.</p>
131
+ *
132
+ * @throws {@link InvalidCiphertextException} (client fault)
133
+ * <p>From the <a>Decrypt</a> or <a>ReEncrypt</a> operation, the request
134
+ * was rejected because the specified ciphertext, or additional authenticated data incorporated
135
+ * into the ciphertext, such as the encryption context, is corrupted, missing, or otherwise
136
+ * invalid.</p>
137
+ * <p>From the <a>ImportKeyMaterial</a> operation, the request was rejected because
138
+ * KMS could not decrypt the encrypted (wrapped) key material. </p>
139
+ *
140
+ * @throws {@link InvalidGrantTokenException} (client fault)
141
+ * <p>The request was rejected because the specified grant token is not valid.</p>
142
+ *
143
+ * @throws {@link InvalidKeyUsageException} (client fault)
144
+ * <p>The request was rejected for one of the following reasons: </p>
145
+ * <ul>
146
+ * <li>
147
+ * <p>The <code>KeyUsage</code> value of the KMS key is incompatible with the API
148
+ * operation.</p>
149
+ * </li>
150
+ * <li>
151
+ * <p>The encryption algorithm or signing algorithm specified for the operation is
152
+ * incompatible with the type of key material in the KMS key <code>(KeySpec</code>).</p>
153
+ * </li>
154
+ * </ul>
155
+ * <p>For encrypting, decrypting, re-encrypting, and generating data keys, the
156
+ * <code>KeyUsage</code> must be <code>ENCRYPT_DECRYPT</code>. For signing and verifying
157
+ * messages, the <code>KeyUsage</code> must be <code>SIGN_VERIFY</code>. For generating and
158
+ * verifying message authentication codes (MACs), the <code>KeyUsage</code> must be
159
+ * <code>GENERATE_VERIFY_MAC</code>. To find the <code>KeyUsage</code> of a KMS key, use the
160
+ * <a>DescribeKey</a> operation.</p>
161
+ * <p>To find the encryption or signing algorithms supported for a particular KMS key, use the
162
+ * <a>DescribeKey</a> operation.</p>
163
+ *
164
+ * @throws {@link KeyUnavailableException} (server fault)
165
+ * <p>The request was rejected because the specified KMS key was not available. You can retry
166
+ * the request.</p>
167
+ *
168
+ * @throws {@link KMSInternalException} (server fault)
169
+ * <p>The request was rejected because an internal exception occurred. The request can be
170
+ * retried.</p>
171
+ *
172
+ * @throws {@link KMSInvalidStateException} (client fault)
173
+ * <p>The request was rejected because the state of the specified resource is not valid for this
174
+ * request.</p>
175
+ * <p>This exceptions means one of the following:</p>
176
+ * <ul>
177
+ * <li>
178
+ * <p>The key state of the KMS key is not compatible with the operation. </p>
179
+ * <p>To find the key state, use the <a>DescribeKey</a> operation. For more
180
+ * information about which key states are compatible with each KMS operation, see
181
+ * <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>
182
+ * <i>Key Management Service Developer Guide</i>
183
+ * </i>.</p>
184
+ * </li>
185
+ * <li>
186
+ * <p>For cryptographic operations on KMS keys in custom key stores, this exception represents a general failure with many possible causes. To identify the cause, see the error message that accompanies the exception.</p>
187
+ * </li>
188
+ * </ul>
189
+ *
190
+ * @throws {@link NotFoundException} (client fault)
191
+ * <p>The request was rejected because the specified entity or resource could not be
192
+ * found.</p>
193
+ *
194
+ *
195
+ * @example To decrypt data
196
+ * ```javascript
197
+ * // The following example decrypts data that was encrypted with a KMS key.
198
+ * const input = {
199
+ * "CiphertextBlob": "<binary data>",
200
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
201
+ * };
202
+ * const command = new DecryptCommand(input);
203
+ * const response = await client.send(command);
204
+ * /* response ==
205
+ * {
206
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
207
+ * "Plaintext": "<binary data>"
208
+ * }
209
+ * *\/
210
+ * // example id: to-decrypt-data-1478281622886
211
+ * ```
212
+ *
119
213
  */
120
214
  export declare class DecryptCommand extends $Command<DecryptCommandInput, DecryptCommandOutput, KMSClientResolvedConfig> {
121
215
  readonly input: DecryptCommandInput;
@@ -76,6 +76,48 @@ export interface DeleteAliasCommandOutput extends __MetadataBearer {
76
76
  * @see {@link DeleteAliasCommandOutput} for command's `response` shape.
77
77
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
78
78
  *
79
+ * @throws {@link DependencyTimeoutException} (server fault)
80
+ * <p>The system timed out while trying to fulfill the request. You can retry the
81
+ * request.</p>
82
+ *
83
+ * @throws {@link KMSInternalException} (server fault)
84
+ * <p>The request was rejected because an internal exception occurred. The request can be
85
+ * retried.</p>
86
+ *
87
+ * @throws {@link KMSInvalidStateException} (client fault)
88
+ * <p>The request was rejected because the state of the specified resource is not valid for this
89
+ * request.</p>
90
+ * <p>This exceptions means one of the following:</p>
91
+ * <ul>
92
+ * <li>
93
+ * <p>The key state of the KMS key is not compatible with the operation. </p>
94
+ * <p>To find the key state, use the <a>DescribeKey</a> operation. For more
95
+ * information about which key states are compatible with each KMS operation, see
96
+ * <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>
97
+ * <i>Key Management Service Developer Guide</i>
98
+ * </i>.</p>
99
+ * </li>
100
+ * <li>
101
+ * <p>For cryptographic operations on KMS keys in custom key stores, this exception represents a general failure with many possible causes. To identify the cause, see the error message that accompanies the exception.</p>
102
+ * </li>
103
+ * </ul>
104
+ *
105
+ * @throws {@link NotFoundException} (client fault)
106
+ * <p>The request was rejected because the specified entity or resource could not be
107
+ * found.</p>
108
+ *
109
+ *
110
+ * @example To delete an alias
111
+ * ```javascript
112
+ * // The following example deletes the specified alias.
113
+ * const input = {
114
+ * "AliasName": "alias/ExampleAlias"
115
+ * };
116
+ * const command = new DeleteAliasCommand(input);
117
+ * await client.send(command);
118
+ * // example id: to-delete-an-alias-1478285209338
119
+ * ```
120
+ *
79
121
  */
80
122
  export declare class DeleteAliasCommand extends $Command<DeleteAliasCommandInput, DeleteAliasCommandOutput, KMSClientResolvedConfig> {
81
123
  readonly input: DeleteAliasCommandInput;
@@ -87,6 +87,68 @@ export interface DeleteCustomKeyStoreCommandOutput extends DeleteCustomKeyStoreR
87
87
  * @see {@link DeleteCustomKeyStoreCommandOutput} for command's `response` shape.
88
88
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
89
89
  *
90
+ * @throws {@link CustomKeyStoreHasCMKsException} (client fault)
91
+ * <p>The request was rejected because the custom key store contains KMS keys. After verifying
92
+ * that you do not need to use the KMS keys, use the <a>ScheduleKeyDeletion</a>
93
+ * operation to delete the KMS keys. After they are deleted, you can delete the custom key
94
+ * store.</p>
95
+ *
96
+ * @throws {@link CustomKeyStoreInvalidStateException} (client fault)
97
+ * <p>The request was rejected because of the <code>ConnectionState</code> of the custom key
98
+ * store. To get the <code>ConnectionState</code> of a custom key store, use the <a>DescribeCustomKeyStores</a> operation.</p>
99
+ * <p>This exception is thrown under the following conditions:</p>
100
+ * <ul>
101
+ * <li>
102
+ * <p>You requested the <a>ConnectCustomKeyStore</a> operation on a custom key
103
+ * store with a <code>ConnectionState</code> of <code>DISCONNECTING</code> or
104
+ * <code>FAILED</code>. This operation is valid for all other <code>ConnectionState</code>
105
+ * values. To reconnect a custom key store in a <code>FAILED</code> state, disconnect it
106
+ * (<a>DisconnectCustomKeyStore</a>), then connect it
107
+ * (<code>ConnectCustomKeyStore</code>).</p>
108
+ * </li>
109
+ * <li>
110
+ * <p>You requested the <a>CreateKey</a> operation in a custom key store that is
111
+ * not connected. This operations is valid only when the custom key store
112
+ * <code>ConnectionState</code> is <code>CONNECTED</code>.</p>
113
+ * </li>
114
+ * <li>
115
+ * <p>You requested the <a>DisconnectCustomKeyStore</a> operation on a custom key
116
+ * store with a <code>ConnectionState</code> of <code>DISCONNECTING</code> or
117
+ * <code>DISCONNECTED</code>. This operation is valid for all other
118
+ * <code>ConnectionState</code> values.</p>
119
+ * </li>
120
+ * <li>
121
+ * <p>You requested the <a>UpdateCustomKeyStore</a> or <a>DeleteCustomKeyStore</a> operation on a custom key store that is not
122
+ * disconnected. This operation is valid only when the custom key store
123
+ * <code>ConnectionState</code> is <code>DISCONNECTED</code>.</p>
124
+ * </li>
125
+ * <li>
126
+ * <p>You requested the <a>GenerateRandom</a> operation in an CloudHSM key store
127
+ * that is not connected. This operation is valid only when the CloudHSM key store
128
+ * <code>ConnectionState</code> is <code>CONNECTED</code>. </p>
129
+ * </li>
130
+ * </ul>
131
+ *
132
+ * @throws {@link CustomKeyStoreNotFoundException} (client fault)
133
+ * <p>The request was rejected because KMS cannot find a custom key store with the specified
134
+ * key store name or ID.</p>
135
+ *
136
+ * @throws {@link KMSInternalException} (server fault)
137
+ * <p>The request was rejected because an internal exception occurred. The request can be
138
+ * retried.</p>
139
+ *
140
+ *
141
+ * @example To delete a custom key store from AWS KMS
142
+ * ```javascript
143
+ * // This example deletes a custom key store from AWS KMS. This operation does not affect the backing key store, such as a CloudHSM cluster, external key store proxy, or your external key manager. This operation doesn't return any data. To verify that the operation was successful, use the DescribeCustomKeyStores operation.
144
+ * const input = {
145
+ * "CustomKeyStoreId": "cks-1234567890abcdef0"
146
+ * };
147
+ * const command = new DeleteCustomKeyStoreCommand(input);
148
+ * await client.send(command);
149
+ * // example id: to-delete-a-custom-key-store-from-aws-kms-1628630837145
150
+ * ```
151
+ *
90
152
  */
91
153
  export declare class DeleteCustomKeyStoreCommand extends $Command<DeleteCustomKeyStoreCommandInput, DeleteCustomKeyStoreCommandOutput, KMSClientResolvedConfig> {
92
154
  readonly input: DeleteCustomKeyStoreCommandInput;