@aws-sdk/client-kms 3.287.0 → 3.289.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 +16 -0
  2. package/dist-types/commands/ConnectCustomKeyStoreCommand.d.ts +11 -0
  3. package/dist-types/commands/CreateAliasCommand.d.ts +12 -0
  4. package/dist-types/commands/CreateCustomKeyStoreCommand.d.ts +68 -0
  5. package/dist-types/commands/CreateGrantCommand.d.ts +22 -0
  6. package/dist-types/commands/CreateKeyCommand.d.ts +283 -0
  7. package/dist-types/commands/DecryptCommand.d.ts +18 -0
  8. package/dist-types/commands/DeleteAliasCommand.d.ts +11 -0
  9. package/dist-types/commands/DeleteCustomKeyStoreCommand.d.ts +11 -0
  10. package/dist-types/commands/DeleteImportedKeyMaterialCommand.d.ts +11 -0
  11. package/dist-types/commands/DescribeCustomKeyStoresCommand.d.ts +101 -0
  12. package/dist-types/commands/DescribeKeyCommand.d.ts +228 -0
  13. package/dist-types/commands/DisableKeyCommand.d.ts +11 -0
  14. package/dist-types/commands/DisableKeyRotationCommand.d.ts +11 -0
  15. package/dist-types/commands/DisconnectCustomKeyStoreCommand.d.ts +11 -0
  16. package/dist-types/commands/EnableKeyCommand.d.ts +11 -0
  17. package/dist-types/commands/EnableKeyRotationCommand.d.ts +11 -0
  18. package/dist-types/commands/EncryptCommand.d.ts +18 -0
  19. package/dist-types/commands/GenerateDataKeyCommand.d.ts +19 -0
  20. package/dist-types/commands/GenerateDataKeyPairCommand.d.ts +21 -0
  21. package/dist-types/commands/GenerateDataKeyPairWithoutPlaintextCommand.d.ts +20 -0
  22. package/dist-types/commands/GenerateDataKeyWithoutPlaintextCommand.d.ts +18 -0
  23. package/dist-types/commands/GenerateMacCommand.d.ts +20 -0
  24. package/dist-types/commands/GenerateRandomCommand.d.ts +16 -0
  25. package/dist-types/commands/GetKeyPolicyCommand.d.ts +17 -0
  26. package/dist-types/commands/GetKeyRotationStatusCommand.d.ts +16 -0
  27. package/dist-types/commands/GetParametersForImportCommand.d.ts +21 -0
  28. package/dist-types/commands/GetPublicKeyCommand.d.ts +23 -0
  29. package/dist-types/commands/ImportKeyMaterialCommand.d.ts +14 -0
  30. package/dist-types/commands/ListAliasesCommand.d.ts +56 -0
  31. package/dist-types/commands/ListGrantsCommand.d.ts +69 -0
  32. package/dist-types/commands/ListKeyPoliciesCommand.d.ts +19 -0
  33. package/dist-types/commands/ListKeysCommand.d.ts +44 -0
  34. package/dist-types/commands/ListResourceTagsCommand.d.ts +30 -0
  35. package/dist-types/commands/ListRetirableGrantsCommand.d.ts +30 -0
  36. package/dist-types/commands/PutKeyPolicyCommand.d.ts +13 -0
  37. package/dist-types/commands/ReEncryptCommand.d.ts +19 -0
  38. package/dist-types/commands/ReplicateKeyCommand.d.ts +48 -0
  39. package/dist-types/commands/RetireGrantCommand.d.ts +12 -0
  40. package/dist-types/commands/RevokeGrantCommand.d.ts +12 -0
  41. package/dist-types/commands/ScheduleKeyDeletionCommand.d.ts +18 -0
  42. package/dist-types/commands/SignCommand.d.ts +42 -0
  43. package/dist-types/commands/TagResourceCommand.d.ts +17 -0
  44. package/dist-types/commands/UntagResourceCommand.d.ts +15 -0
  45. package/dist-types/commands/UpdateAliasCommand.d.ts +12 -0
  46. package/dist-types/commands/UpdateCustomKeyStoreCommand.d.ts +77 -0
  47. package/dist-types/commands/UpdateKeyDescriptionCommand.d.ts +12 -0
  48. package/dist-types/commands/UpdatePrimaryRegionCommand.d.ts +16 -0
  49. package/dist-types/commands/VerifyCommand.d.ts +44 -0
  50. package/dist-types/commands/VerifyMacCommand.d.ts +21 -0
  51. package/package.json +29 -29
@@ -41,6 +41,22 @@ export interface CancelKeyDeletionCommandOutput extends CancelKeyDeletionRespons
41
41
  * @see {@link CancelKeyDeletionCommandOutput} for command's `response` shape.
42
42
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
43
43
  *
44
+ * @example To cancel deletion of a KMS key
45
+ * ```javascript
46
+ * // The following example cancels deletion of the specified KMS key.
47
+ * const input = {
48
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
49
+ * };
50
+ * const command = new CancelKeyDeletionCommand(input);
51
+ * const response = await client.send(command);
52
+ * /* response ==
53
+ * {
54
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
55
+ * }
56
+ * *\/
57
+ * // example id: to-cancel-deletion-of-a-cmk-1477428535102
58
+ * ```
59
+ *
44
60
  */
45
61
  export declare class CancelKeyDeletionCommand extends $Command<CancelKeyDeletionCommandInput, CancelKeyDeletionCommandOutput, KMSClientResolvedConfig> {
46
62
  readonly input: CancelKeyDeletionCommandInput;
@@ -115,6 +115,17 @@ export interface ConnectCustomKeyStoreCommandOutput extends ConnectCustomKeyStor
115
115
  * @see {@link ConnectCustomKeyStoreCommandOutput} for command's `response` shape.
116
116
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
117
117
  *
118
+ * @example To connect a custom key store
119
+ * ```javascript
120
+ * // This example connects an AWS KMS custom key store to its backing key store. For an AWS CloudHSM key store, it connects the key store to its AWS CloudHSM cluster. For an external key store, it connects the key store to the external key store proxy that communicates with your external key manager. This operation does not return any data. To verify that the custom key store is connected, use the <code>DescribeCustomKeyStores</code> operation.
121
+ * const input = {
122
+ * "CustomKeyStoreId": "cks-1234567890abcdef0"
123
+ * };
124
+ * const command = new ConnectCustomKeyStoreCommand(input);
125
+ * await client.send(command);
126
+ * // example id: to-connect-a-custom-key-store-1628626947750
127
+ * ```
128
+ *
118
129
  */
119
130
  export declare class ConnectCustomKeyStoreCommand extends $Command<ConnectCustomKeyStoreCommandInput, ConnectCustomKeyStoreCommandOutput, KMSClientResolvedConfig> {
120
131
  readonly input: ConnectCustomKeyStoreCommandInput;
@@ -85,6 +85,18 @@ export interface CreateAliasCommandOutput extends __MetadataBearer {
85
85
  * @see {@link CreateAliasCommandOutput} for command's `response` shape.
86
86
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
87
87
  *
88
+ * @example To create an alias
89
+ * ```javascript
90
+ * // The following example creates an alias for the specified KMS key.
91
+ * const input = {
92
+ * "AliasName": "alias/ExampleAlias",
93
+ * "TargetKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
94
+ * };
95
+ * const command = new CreateAliasCommand(input);
96
+ * await client.send(command);
97
+ * // example id: to-create-an-alias-1477505685119
98
+ * ```
99
+ *
88
100
  */
89
101
  export declare class CreateAliasCommand extends $Command<CreateAliasCommandInput, CreateAliasCommandOutput, KMSClientResolvedConfig> {
90
102
  readonly input: CreateAliasCommandInput;
@@ -116,6 +116,74 @@ export interface CreateCustomKeyStoreCommandOutput extends CreateCustomKeyStoreR
116
116
  * @see {@link CreateCustomKeyStoreCommandOutput} for command's `response` shape.
117
117
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
118
118
  *
119
+ * @example To create an AWS CloudHSM key store
120
+ * ```javascript
121
+ * // This example creates a custom key store that is associated with an AWS CloudHSM cluster.
122
+ * const input = {
123
+ * "CloudHsmClusterId": "cluster-1a23b4cdefg",
124
+ * "CustomKeyStoreName": "ExampleKeyStore",
125
+ * "KeyStorePassword": "kmsPswd",
126
+ * "TrustAnchorCertificate": "<certificate-goes-here>"
127
+ * };
128
+ * const command = new CreateCustomKeyStoreCommand(input);
129
+ * const response = await client.send(command);
130
+ * /* response ==
131
+ * {
132
+ * "CustomKeyStoreId": "cks-1234567890abcdef0"
133
+ * }
134
+ * *\/
135
+ * // example id: to-create-an-aws-cloudhsm-custom-key-store-1
136
+ * ```
137
+ *
138
+ * @example To create an external key store with VPC endpoint service connectivity
139
+ * ```javascript
140
+ * // This example creates an external key store that uses an Amazon VPC endpoint service to communicate with AWS KMS.
141
+ * const input = {
142
+ * "CustomKeyStoreName": "ExampleVPCEndpointKeyStore",
143
+ * "CustomKeyStoreType": "EXTERNAL_KEY_STORE",
144
+ * "XksProxyAuthenticationCredential": {
145
+ * "AccessKeyId": "ABCDE12345670EXAMPLE",
146
+ * "RawSecretAccessKey": "DXjSUawnel2fr6SKC7G25CNxTyWKE5PF9XX6H/u9pSo="
147
+ * },
148
+ * "XksProxyConnectivity": "VPC_ENDPOINT_SERVICE",
149
+ * "XksProxyUriEndpoint": "https://myproxy-private.xks.example.com",
150
+ * "XksProxyUriPath": "/example-prefix/kms/xks/v1",
151
+ * "XksProxyVpcEndpointServiceName": "com.amazonaws.vpce.us-east-1.vpce-svc-example1"
152
+ * };
153
+ * const command = new CreateCustomKeyStoreCommand(input);
154
+ * const response = await client.send(command);
155
+ * /* response ==
156
+ * {
157
+ * "CustomKeyStoreId": "cks-1234567890abcdef0"
158
+ * }
159
+ * *\/
160
+ * // example id: to-create-an-external-custom-key-store-with-vpc-connectivity-2
161
+ * ```
162
+ *
163
+ * @example To create an external key store with public endpoint connectivity
164
+ * ```javascript
165
+ * // This example creates an external key store with public endpoint connectivity.
166
+ * const input = {
167
+ * "CustomKeyStoreName": "ExamplePublicEndpointKeyStore",
168
+ * "CustomKeyStoreType": "EXTERNAL_KEY_STORE",
169
+ * "XksProxyAuthenticationCredential": {
170
+ * "AccessKeyId": "ABCDE12345670EXAMPLE",
171
+ * "RawSecretAccessKey": "DXjSUawnel2fr6SKC7G25CNxTyWKE5PF9XX6H/u9pSo="
172
+ * },
173
+ * "XksProxyConnectivity": "PUBLIC_ENDPOINT",
174
+ * "XksProxyUriEndpoint": "https://myproxy.xks.example.com",
175
+ * "XksProxyUriPath": "/kms/xks/v1"
176
+ * };
177
+ * const command = new CreateCustomKeyStoreCommand(input);
178
+ * const response = await client.send(command);
179
+ * /* response ==
180
+ * {
181
+ * "CustomKeyStoreId": "cks-987654321abcdef0"
182
+ * }
183
+ * *\/
184
+ * // example id: to-create-an-external-custom-key-store-with-a-public-endpoint-3
185
+ * ```
186
+ *
119
187
  */
120
188
  export declare class CreateCustomKeyStoreCommand extends $Command<CreateCustomKeyStoreCommandInput, CreateCustomKeyStoreCommandOutput, KMSClientResolvedConfig> {
121
189
  readonly input: CreateCustomKeyStoreCommandInput;
@@ -90,6 +90,28 @@ export interface CreateGrantCommandOutput extends CreateGrantResponse, __Metadat
90
90
  * @see {@link CreateGrantCommandOutput} for command's `response` shape.
91
91
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
92
92
  *
93
+ * @example To create a grant
94
+ * ```javascript
95
+ * // The following example creates a grant that allows the specified IAM role to encrypt data with the specified KMS key.
96
+ * const input = {
97
+ * "GranteePrincipal": "arn:aws:iam::111122223333:role/ExampleRole",
98
+ * "KeyId": "arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab",
99
+ * "Operations": [
100
+ * "Encrypt",
101
+ * "Decrypt"
102
+ * ]
103
+ * };
104
+ * const command = new CreateGrantCommand(input);
105
+ * const response = await client.send(command);
106
+ * /* response ==
107
+ * {
108
+ * "GrantId": "0c237476b39f8bc44e45212e08498fbe3151305030726c0590dd8d3e9f3d6a60",
109
+ * "GrantToken": "AQpAM2RhZTk1MGMyNTk2ZmZmMzEyYWVhOWViN2I1MWM4Mzc0MWFiYjc0ZDE1ODkyNGFlNTIzODZhMzgyZjBlNGY3NiKIAgEBAgB4Pa6VDCWW__MSrqnre1HIN0Grt00ViSSuUjhqOC8OT3YAAADfMIHcBgkqhkiG9w0BBwaggc4wgcsCAQAwgcUGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMmqLyBTAegIn9XlK5AgEQgIGXZQjkBcl1dykDdqZBUQ6L1OfUivQy7JVYO2-ZJP7m6f1g8GzV47HX5phdtONAP7K_HQIflcgpkoCqd_fUnE114mSmiagWkbQ5sqAVV3ov-VeqgrvMe5ZFEWLMSluvBAqdjHEdMIkHMlhlj4ENZbzBfo9Wxk8b8SnwP4kc4gGivedzFXo-dwN8fxjjq_ZZ9JFOj2ijIbj5FyogDCN0drOfi8RORSEuCEmPvjFRMFAwcmwFkN2NPp89amA"
110
+ * }
111
+ * *\/
112
+ * // example id: to-create-a-grant-1477972226782
113
+ * ```
114
+ *
93
115
  */
94
116
  export declare class CreateGrantCommand extends $Command<CreateGrantCommandInput, CreateGrantCommandOutput, KMSClientResolvedConfig> {
95
117
  readonly input: CreateGrantCommandInput;
@@ -195,6 +195,289 @@ 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
+ * @example To create a KMS key
199
+ * ```javascript
200
+ * // The following example creates a symmetric KMS key for encryption and decryption. No parameters are required for this operation.
201
+ * const input = {};
202
+ * const command = new CreateKeyCommand(input);
203
+ * const response = await client.send(command);
204
+ * /* response ==
205
+ * {
206
+ * "KeyMetadata": {
207
+ * "AWSAccountId": "111122223333",
208
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
209
+ * "CreationDate": "2017-07-05T14:04:55-07:00",
210
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
211
+ * "Description": "",
212
+ * "Enabled": true,
213
+ * "EncryptionAlgorithms": [
214
+ * "SYMMETRIC_DEFAULT"
215
+ * ],
216
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
217
+ * "KeyManager": "CUSTOMER",
218
+ * "KeySpec": "SYMMETRIC_DEFAULT",
219
+ * "KeyState": "Enabled",
220
+ * "KeyUsage": "ENCRYPT_DECRYPT",
221
+ * "MultiRegion": false,
222
+ * "Origin": "AWS_KMS"
223
+ * }
224
+ * }
225
+ * *\/
226
+ * // example id: to-create-a-cmk-1
227
+ * ```
228
+ *
229
+ * @example To create an asymmetric RSA KMS key for encryption and decryption
230
+ * ```javascript
231
+ * // 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.
232
+ * const input = {
233
+ * "KeySpec": "RSA_4096",
234
+ * "KeyUsage": "ENCRYPT_DECRYPT"
235
+ * };
236
+ * const command = new CreateKeyCommand(input);
237
+ * const response = await client.send(command);
238
+ * /* response ==
239
+ * {
240
+ * "KeyMetadata": {
241
+ * "AWSAccountId": "111122223333",
242
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
243
+ * "CreationDate": "2021-04-05T14:04:55-07:00",
244
+ * "CustomerMasterKeySpec": "RSA_4096",
245
+ * "Description": "",
246
+ * "Enabled": true,
247
+ * "EncryptionAlgorithms": [
248
+ * "RSAES_OAEP_SHA_1",
249
+ * "RSAES_OAEP_SHA_256"
250
+ * ],
251
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
252
+ * "KeyManager": "CUSTOMER",
253
+ * "KeySpec": "RSA_4096",
254
+ * "KeyState": "Enabled",
255
+ * "KeyUsage": "ENCRYPT_DECRYPT",
256
+ * "MultiRegion": false,
257
+ * "Origin": "AWS_KMS"
258
+ * }
259
+ * }
260
+ * *\/
261
+ * // example id: to-create-an-asymmetric-rsa-kms-key-for-encryption-and-decryption-2
262
+ * ```
263
+ *
264
+ * @example To create an asymmetric elliptic curve KMS key for signing and verification
265
+ * ```javascript
266
+ * // 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.
267
+ * const input = {
268
+ * "KeySpec": "ECC_NIST_P521",
269
+ * "KeyUsage": "SIGN_VERIFY"
270
+ * };
271
+ * const command = new CreateKeyCommand(input);
272
+ * const response = await client.send(command);
273
+ * /* response ==
274
+ * {
275
+ * "KeyMetadata": {
276
+ * "AWSAccountId": "111122223333",
277
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
278
+ * "CreationDate": "2019-12-02T07:48:55-07:00",
279
+ * "CustomerMasterKeySpec": "ECC_NIST_P521",
280
+ * "Description": "",
281
+ * "Enabled": true,
282
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
283
+ * "KeyManager": "CUSTOMER",
284
+ * "KeySpec": "ECC_NIST_P521",
285
+ * "KeyState": "Enabled",
286
+ * "KeyUsage": "SIGN_VERIFY",
287
+ * "MultiRegion": false,
288
+ * "Origin": "AWS_KMS",
289
+ * "SigningAlgorithms": [
290
+ * "ECDSA_SHA_512"
291
+ * ]
292
+ * }
293
+ * }
294
+ * *\/
295
+ * // example id: to-create-an-asymmetric-elliptic-curve-kms-key-for-signing-and-verification-3
296
+ * ```
297
+ *
298
+ * @example To create an HMAC KMS key
299
+ * ```javascript
300
+ * // 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.
301
+ * const input = {
302
+ * "KeySpec": "HMAC_384",
303
+ * "KeyUsage": "GENERATE_VERIFY_MAC"
304
+ * };
305
+ * const command = new CreateKeyCommand(input);
306
+ * const response = await client.send(command);
307
+ * /* response ==
308
+ * {
309
+ * "KeyMetadata": {
310
+ * "AWSAccountId": "111122223333",
311
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
312
+ * "CreationDate": "2022-04-05T14:04:55-07:00",
313
+ * "CustomerMasterKeySpec": "HMAC_384",
314
+ * "Description": "",
315
+ * "Enabled": true,
316
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
317
+ * "KeyManager": "CUSTOMER",
318
+ * "KeySpec": "HMAC_384",
319
+ * "KeyState": "Enabled",
320
+ * "KeyUsage": "GENERATE_VERIFY_MAC",
321
+ * "MacAlgorithms": [
322
+ * "HMAC_SHA_384"
323
+ * ],
324
+ * "MultiRegion": false,
325
+ * "Origin": "AWS_KMS"
326
+ * }
327
+ * }
328
+ * *\/
329
+ * // example id: to-create-an-hmac-kms-key-1630628752841
330
+ * ```
331
+ *
332
+ * @example To create a multi-Region primary KMS key
333
+ * ```javascript
334
+ * // 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.
335
+ * const input = {
336
+ * "MultiRegion": true
337
+ * };
338
+ * const command = new CreateKeyCommand(input);
339
+ * const response = await client.send(command);
340
+ * /* response ==
341
+ * {
342
+ * "KeyMetadata": {
343
+ * "AWSAccountId": "111122223333",
344
+ * "Arn": "arn:aws:kms:us-west-2:111122223333:key/mrk-1234abcd12ab34cd56ef12345678990ab",
345
+ * "CreationDate": "2021-09-02T016:15:21-09:00",
346
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
347
+ * "Description": "",
348
+ * "Enabled": true,
349
+ * "EncryptionAlgorithms": [
350
+ * "SYMMETRIC_DEFAULT"
351
+ * ],
352
+ * "KeyId": "mrk-1234abcd12ab34cd56ef12345678990ab",
353
+ * "KeyManager": "CUSTOMER",
354
+ * "KeySpec": "SYMMETRIC_DEFAULT",
355
+ * "KeyState": "Enabled",
356
+ * "KeyUsage": "ENCRYPT_DECRYPT",
357
+ * "MultiRegion": true,
358
+ * "MultiRegionConfiguration": {
359
+ * "MultiRegionKeyType": "PRIMARY",
360
+ * "PrimaryKey": {
361
+ * "Arn": "arn:aws:kms:us-west-2:111122223333:key/mrk-1234abcd12ab34cd56ef12345678990ab",
362
+ * "Region": "us-west-2"
363
+ * },
364
+ * "ReplicaKeys": []
365
+ * },
366
+ * "Origin": "AWS_KMS"
367
+ * }
368
+ * }
369
+ * *\/
370
+ * // example id: to-create-a-multi-region-primary-kms-key-4
371
+ * ```
372
+ *
373
+ * @example To create a KMS key for imported key material
374
+ * ```javascript
375
+ * // 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.
376
+ * const input = {
377
+ * "Origin": "EXTERNAL"
378
+ * };
379
+ * const command = new CreateKeyCommand(input);
380
+ * const response = await client.send(command);
381
+ * /* response ==
382
+ * {
383
+ * "KeyMetadata": {
384
+ * "AWSAccountId": "111122223333",
385
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
386
+ * "CreationDate": "2019-12-02T07:48:55-07:00",
387
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
388
+ * "Description": "",
389
+ * "Enabled": false,
390
+ * "EncryptionAlgorithms": [
391
+ * "SYMMETRIC_DEFAULT"
392
+ * ],
393
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
394
+ * "KeyManager": "CUSTOMER",
395
+ * "KeySpec": "SYMMETRIC_DEFAULT",
396
+ * "KeyState": "PendingImport",
397
+ * "KeyUsage": "ENCRYPT_DECRYPT",
398
+ * "MultiRegion": false,
399
+ * "Origin": "EXTERNAL"
400
+ * }
401
+ * }
402
+ * *\/
403
+ * // example id: to-create-a-kms-key-for-imported-key-material-5
404
+ * ```
405
+ *
406
+ * @example To create a KMS key in an AWS CloudHSM key store
407
+ * ```javascript
408
+ * // 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.
409
+ * const input = {
410
+ * "CustomKeyStoreId": "cks-1234567890abcdef0",
411
+ * "Origin": "AWS_CLOUDHSM"
412
+ * };
413
+ * const command = new CreateKeyCommand(input);
414
+ * const response = await client.send(command);
415
+ * /* response ==
416
+ * {
417
+ * "KeyMetadata": {
418
+ * "AWSAccountId": "111122223333",
419
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
420
+ * "CloudHsmClusterId": "cluster-1a23b4cdefg",
421
+ * "CreationDate": "2019-12-02T07:48:55-07:00",
422
+ * "CustomKeyStoreId": "cks-1234567890abcdef0",
423
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
424
+ * "Description": "",
425
+ * "Enabled": true,
426
+ * "EncryptionAlgorithms": [
427
+ * "SYMMETRIC_DEFAULT"
428
+ * ],
429
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
430
+ * "KeyManager": "CUSTOMER",
431
+ * "KeySpec": "SYMMETRIC_DEFAULT",
432
+ * "KeyState": "Enabled",
433
+ * "KeyUsage": "ENCRYPT_DECRYPT",
434
+ * "MultiRegion": false,
435
+ * "Origin": "AWS_CLOUDHSM"
436
+ * }
437
+ * }
438
+ * *\/
439
+ * // example id: to-create-a-kms-key-in-an-aws-cloudhsm-custom-key-store-6
440
+ * ```
441
+ *
442
+ * @example To create a KMS key in an external key store
443
+ * ```javascript
444
+ * // 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.
445
+ * const input = {
446
+ * "CustomKeyStoreId": "cks-9876543210fedcba9",
447
+ * "Origin": "EXTERNAL_KEY_STORE",
448
+ * "XksKeyId": "bb8562717f809024"
449
+ * };
450
+ * const command = new CreateKeyCommand(input);
451
+ * const response = await client.send(command);
452
+ * /* response ==
453
+ * {
454
+ * "KeyMetadata": {
455
+ * "AWSAccountId": "111122223333",
456
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/0987dcba-09fe-87dc-65ba-ab0987654321",
457
+ * "CreationDate": "2022-02-02T07:48:55-07:00",
458
+ * "CustomKeyStoreId": "cks-9876543210fedcba9",
459
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
460
+ * "Description": "",
461
+ * "Enabled": true,
462
+ * "EncryptionAlgorithms": [
463
+ * "SYMMETRIC_DEFAULT"
464
+ * ],
465
+ * "KeyId": "0987dcba-09fe-87dc-65ba-ab0987654321",
466
+ * "KeyManager": "CUSTOMER",
467
+ * "KeySpec": "SYMMETRIC_DEFAULT",
468
+ * "KeyState": "Enabled",
469
+ * "KeyUsage": "ENCRYPT_DECRYPT",
470
+ * "MultiRegion": false,
471
+ * "Origin": "EXTERNAL_KEY_STORE",
472
+ * "XksKeyConfiguration": {
473
+ * "Id": "bb8562717f809024"
474
+ * }
475
+ * }
476
+ * }
477
+ * *\/
478
+ * // example id: to-create-a-kms-key-in-an-external-custom-key-store-7
479
+ * ```
480
+ *
198
481
  */
199
482
  export declare class CreateKeyCommand extends $Command<CreateKeyCommandInput, CreateKeyCommandOutput, KMSClientResolvedConfig> {
200
483
  readonly input: CreateKeyCommandInput;
@@ -116,6 +116,24 @@ 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
+ * @example To decrypt data
120
+ * ```javascript
121
+ * // The following example decrypts data that was encrypted with a KMS key.
122
+ * const input = {
123
+ * "CiphertextBlob": "<binary data>",
124
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
125
+ * };
126
+ * const command = new DecryptCommand(input);
127
+ * const response = await client.send(command);
128
+ * /* response ==
129
+ * {
130
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
131
+ * "Plaintext": "<binary data>"
132
+ * }
133
+ * *\/
134
+ * // example id: to-decrypt-data-1478281622886
135
+ * ```
136
+ *
119
137
  */
120
138
  export declare class DecryptCommand extends $Command<DecryptCommandInput, DecryptCommandOutput, KMSClientResolvedConfig> {
121
139
  readonly input: DecryptCommandInput;
@@ -76,6 +76,17 @@ 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
+ * @example To delete an alias
80
+ * ```javascript
81
+ * // The following example deletes the specified alias.
82
+ * const input = {
83
+ * "AliasName": "alias/ExampleAlias"
84
+ * };
85
+ * const command = new DeleteAliasCommand(input);
86
+ * await client.send(command);
87
+ * // example id: to-delete-an-alias-1478285209338
88
+ * ```
89
+ *
79
90
  */
80
91
  export declare class DeleteAliasCommand extends $Command<DeleteAliasCommandInput, DeleteAliasCommandOutput, KMSClientResolvedConfig> {
81
92
  readonly input: DeleteAliasCommandInput;
@@ -87,6 +87,17 @@ 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
+ * @example To delete a custom key store from AWS KMS
91
+ * ```javascript
92
+ * // 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.
93
+ * const input = {
94
+ * "CustomKeyStoreId": "cks-1234567890abcdef0"
95
+ * };
96
+ * const command = new DeleteCustomKeyStoreCommand(input);
97
+ * await client.send(command);
98
+ * // example id: to-delete-a-custom-key-store-from-aws-kms-1628630837145
99
+ * ```
100
+ *
90
101
  */
91
102
  export declare class DeleteCustomKeyStoreCommand extends $Command<DeleteCustomKeyStoreCommandInput, DeleteCustomKeyStoreCommandOutput, KMSClientResolvedConfig> {
92
103
  readonly input: DeleteCustomKeyStoreCommandInput;
@@ -57,6 +57,17 @@ export interface DeleteImportedKeyMaterialCommandOutput extends __MetadataBearer
57
57
  * @see {@link DeleteImportedKeyMaterialCommandOutput} for command's `response` shape.
58
58
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
59
59
  *
60
+ * @example To delete imported key material
61
+ * ```javascript
62
+ * // The following example deletes the imported key material from the specified KMS key.
63
+ * const input = {
64
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
65
+ * };
66
+ * const command = new DeleteImportedKeyMaterialCommand(input);
67
+ * await client.send(command);
68
+ * // example id: to-delete-imported-key-material-1478561674507
69
+ * ```
70
+ *
60
71
  */
61
72
  export declare class DeleteImportedKeyMaterialCommand extends $Command<DeleteImportedKeyMaterialCommandInput, DeleteImportedKeyMaterialCommandOutput, KMSClientResolvedConfig> {
62
73
  readonly input: DeleteImportedKeyMaterialCommandInput;
@@ -87,6 +87,107 @@ export interface DescribeCustomKeyStoresCommandOutput extends DescribeCustomKeyS
87
87
  * @see {@link DescribeCustomKeyStoresCommandOutput} for command's `response` shape.
88
88
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
89
89
  *
90
+ * @example To get detailed information about custom key stores in the account and Region
91
+ * ```javascript
92
+ * // This example gets detailed information about all AWS KMS custom key stores in an AWS account and Region. To get all key stores, do not enter a custom key store name or ID.
93
+ * const input = {};
94
+ * const command = new DescribeCustomKeyStoresCommand(input);
95
+ * const response = await client.send(command);
96
+ * /* response ==
97
+ * {
98
+ * "CustomKeyStores": []
99
+ * }
100
+ * *\/
101
+ * // example id: to-get-detailed-information-about-custom-key-stores-in-the-account-and-region-1
102
+ * ```
103
+ *
104
+ * @example To get detailed information about an AWS CloudHSM key store by specifying its friendly name
105
+ * ```javascript
106
+ * // This example gets detailed information about a particular AWS CloudHSM key store by specifying its friendly name. To limit the output to a particular custom key store, provide either the custom key store name or ID.
107
+ * const input = {
108
+ * "CustomKeyStoreName": "ExampleKeyStore"
109
+ * };
110
+ * const command = new DescribeCustomKeyStoresCommand(input);
111
+ * const response = await client.send(command);
112
+ * /* response ==
113
+ * {
114
+ * "CustomKeyStores": [
115
+ * {
116
+ * "CloudHsmClusterId": "cluster-1a23b4cdefg",
117
+ * "ConnectionState": "CONNECTED",
118
+ * "CreationDate": "1.499288695918E9",
119
+ * "CustomKeyStoreId": "cks-1234567890abcdef0",
120
+ * "CustomKeyStoreName": "ExampleKeyStore",
121
+ * "CustomKeyStoreType": "AWS_CLOUDHSM",
122
+ * "TrustAnchorCertificate": "<certificate appears here>"
123
+ * }
124
+ * ]
125
+ * }
126
+ * *\/
127
+ * // example id: to-get-detailed-information-about-a-cloudhsm-custom-key-store-by-name-2
128
+ * ```
129
+ *
130
+ * @example To get detailed information about an external key store by specifying its ID
131
+ * ```javascript
132
+ * // This example gets detailed information about an external key store by specifying its ID. The example external key store proxy uses public endpoint connectivity.
133
+ * const input = {
134
+ * "CustomKeyStoreId": "cks-9876543210fedcba9"
135
+ * };
136
+ * const command = new DescribeCustomKeyStoresCommand(input);
137
+ * const response = await client.send(command);
138
+ * /* response ==
139
+ * {
140
+ * "CustomKeyStores": [
141
+ * {
142
+ * "ConnectionState": "CONNECTED",
143
+ * "CreationDate": "1.599288695918E9",
144
+ * "CustomKeyStoreId": "cks-9876543210fedcba9",
145
+ * "CustomKeyStoreName": "ExampleExternalKeyStore",
146
+ * "CustomKeyStoreType": "EXTERNAL_KEY_STORE",
147
+ * "XksProxyConfiguration": {
148
+ * "AccessKeyId": "ABCDE12345670EXAMPLE",
149
+ * "Connectivity": "PUBLIC_ENDPOINT",
150
+ * "UriEndpoint": "https://myproxy.xks.example.com",
151
+ * "UriPath": "/kms/xks/v1"
152
+ * }
153
+ * }
154
+ * ]
155
+ * }
156
+ * *\/
157
+ * // example id: to-get-detailed-information-about-an-external-key-store--3
158
+ * ```
159
+ *
160
+ * @example To get detailed information about an external key store VPC endpoint connectivity by specifying its friendly name
161
+ * ```javascript
162
+ * // This example gets detailed information about a particular external key store by specifying its friendly name. To limit the output to a particular custom key store, provide either the custom key store name or ID. The proxy URI path for this external key store includes an optional prefix. Also, because this example external key store uses VPC endpoint connectivity, the response includes the associated VPC endpoint service name.
163
+ * const input = {
164
+ * "CustomKeyStoreName": "VPCExternalKeystore"
165
+ * };
166
+ * const command = new DescribeCustomKeyStoresCommand(input);
167
+ * const response = await client.send(command);
168
+ * /* response ==
169
+ * {
170
+ * "CustomKeyStores": [
171
+ * {
172
+ * "ConnectionState": "CONNECTED",
173
+ * "CreationDate": "1.643057863.842",
174
+ * "CustomKeyStoreId": "cks-876543210fedcba98",
175
+ * "CustomKeyStoreName": "ExampleVPCExternalKeyStore",
176
+ * "CustomKeyStoreType": "EXTERNAL_KEY_STORE",
177
+ * "XksProxyConfiguration": {
178
+ * "AccessKeyId": "ABCDE12345670EXAMPLE",
179
+ * "Connectivity": "VPC_ENDPOINT_SERVICE",
180
+ * "UriEndpoint": "https://myproxy-private.xks.example.com",
181
+ * "UriPath": "/example-prefix/kms/xks/v1",
182
+ * "VpcEndpointServiceName": "com.amazonaws.vpce.us-east-1.vpce-svc-example1"
183
+ * }
184
+ * }
185
+ * ]
186
+ * }
187
+ * *\/
188
+ * // example id: to-get-detailed-information-about-an-external-custom-key-store-by-name-4
189
+ * ```
190
+ *
90
191
  */
91
192
  export declare class DescribeCustomKeyStoresCommand extends $Command<DescribeCustomKeyStoresCommandInput, DescribeCustomKeyStoresCommandOutput, KMSClientResolvedConfig> {
92
193
  readonly input: DescribeCustomKeyStoresCommandInput;