aws-sdk-kms 1.76.0 → 1.88.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.
@@ -22,6 +22,7 @@ require 'aws-sdk-core/plugins/endpoint_pattern.rb'
22
22
  require 'aws-sdk-core/plugins/response_paging.rb'
23
23
  require 'aws-sdk-core/plugins/stub_responses.rb'
24
24
  require 'aws-sdk-core/plugins/idempotency_token.rb'
25
+ require 'aws-sdk-core/plugins/invocation_id.rb'
25
26
  require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
26
27
  require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
27
28
  require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
@@ -72,6 +73,7 @@ module Aws::KMS
72
73
  add_plugin(Aws::Plugins::ResponsePaging)
73
74
  add_plugin(Aws::Plugins::StubResponses)
74
75
  add_plugin(Aws::Plugins::IdempotencyToken)
76
+ add_plugin(Aws::Plugins::InvocationId)
75
77
  add_plugin(Aws::Plugins::JsonvalueConverter)
76
78
  add_plugin(Aws::Plugins::ClientMetricsPlugin)
77
79
  add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
@@ -87,6 +89,11 @@ module Aws::KMS
87
89
 
88
90
  # @overload initialize(options)
89
91
  # @param [Hash] options
92
+ #
93
+ # @option options [Array<Seahorse::Client::Plugin>] :plugins ([]])
94
+ # A list of plugins to apply to the client. Each plugin is either a
95
+ # class name or an instance of a plugin class.
96
+ #
90
97
  # @option options [required, Aws::CredentialProvider] :credentials
91
98
  # Your AWS credentials. This can be an instance of any one of the
92
99
  # following classes:
@@ -196,10 +203,16 @@ module Aws::KMS
196
203
  # When set to 'true' the request body will not be compressed
197
204
  # for supported operations.
198
205
  #
199
- # @option options [String] :endpoint
200
- # The client endpoint is normally constructed from the `:region`
201
- # option. You should only configure an `:endpoint` when connecting
202
- # to test or custom endpoints. This should be a valid HTTP(S) URI.
206
+ # @option options [String, URI::HTTPS, URI::HTTP] :endpoint
207
+ # Normally you should not configure the `:endpoint` option
208
+ # directly. This is normally constructed from the `:region`
209
+ # option. Configuring `:endpoint` is normally reserved for
210
+ # connecting to test or custom endpoints. The endpoint should
211
+ # be a URI formatted like:
212
+ #
213
+ # 'http://example.com'
214
+ # 'https://example.com'
215
+ # 'http://example.com:123'
203
216
  #
204
217
  # @option options [Integer] :endpoint_cache_max_entries (1000)
205
218
  # Used for the maximum size limit of the LRU cache storing endpoints data
@@ -289,25 +302,31 @@ module Aws::KMS
289
302
  # throttling. This is a provisional mode that may change behavior
290
303
  # in the future.
291
304
  #
292
- #
293
305
  # @option options [String] :sdk_ua_app_id
294
306
  # A unique and opaque application ID that is appended to the
295
- # User-Agent header as app/<sdk_ua_app_id>. It should have a
296
- # maximum length of 50.
307
+ # User-Agent header as app/sdk_ua_app_id. It should have a
308
+ # maximum length of 50. This variable is sourced from environment
309
+ # variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
297
310
  #
298
311
  # @option options [String] :secret_access_key
299
312
  #
300
313
  # @option options [String] :session_token
301
314
  #
315
+ # @option options [Array] :sigv4a_signing_region_set
316
+ # A list of regions that should be signed with SigV4a signing. When
317
+ # not passed, a default `:sigv4a_signing_region_set` is searched for
318
+ # in the following locations:
319
+ #
320
+ # * `Aws.config[:sigv4a_signing_region_set]`
321
+ # * `ENV['AWS_SIGV4A_SIGNING_REGION_SET']`
322
+ # * `~/.aws/config`
323
+ #
302
324
  # @option options [Boolean] :simple_json (false)
303
325
  # Disables request parameter conversion, validation, and formatting.
304
- # Also disable response data type conversions. This option is useful
305
- # when you want to ensure the highest level of performance by
306
- # avoiding overhead of walking request parameters and response data
307
- # structures.
308
- #
309
- # When `:simple_json` is enabled, the request parameters hash must
310
- # be formatted exactly as the DynamoDB API expects.
326
+ # Also disables response data type conversions. The request parameters
327
+ # hash must be formatted exactly as the API expects.This option is useful
328
+ # when you want to ensure the highest level of performance by avoiding
329
+ # overhead of walking request parameters and response data structures.
311
330
  #
312
331
  # @option options [Boolean] :stub_responses (false)
313
332
  # Causes the client to return stubbed responses. By default
@@ -347,50 +366,65 @@ module Aws::KMS
347
366
  # @option options [Aws::KMS::EndpointProvider] :endpoint_provider
348
367
  # The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::KMS::EndpointParameters`
349
368
  #
350
- # @option options [URI::HTTP,String] :http_proxy A proxy to send
351
- # requests through. Formatted like 'http://proxy.com:123'.
352
- #
353
- # @option options [Float] :http_open_timeout (15) The number of
354
- # seconds to wait when opening a HTTP session before raising a
355
- # `Timeout::Error`.
356
- #
357
- # @option options [Float] :http_read_timeout (60) The default
358
- # number of seconds to wait for response data. This value can
359
- # safely be set per-request on the session.
360
- #
361
- # @option options [Float] :http_idle_timeout (5) The number of
362
- # seconds a connection is allowed to sit idle before it is
363
- # considered stale. Stale connections are closed and removed
364
- # from the pool before making a request.
365
- #
366
- # @option options [Float] :http_continue_timeout (1) The number of
367
- # seconds to wait for a 100-continue response before sending the
368
- # request body. This option has no effect unless the request has
369
- # "Expect" header set to "100-continue". Defaults to `nil` which
370
- # disables this behaviour. This value can safely be set per
371
- # request on the session.
372
- #
373
- # @option options [Float] :ssl_timeout (nil) Sets the SSL timeout
374
- # in seconds.
375
- #
376
- # @option options [Boolean] :http_wire_trace (false) When `true`,
377
- # HTTP debug output will be sent to the `:logger`.
369
+ # @option options [Float] :http_continue_timeout (1)
370
+ # The number of seconds to wait for a 100-continue response before sending the
371
+ # request body. This option has no effect unless the request has "Expect"
372
+ # header set to "100-continue". Defaults to `nil` which disables this
373
+ # behaviour. This value can safely be set per request on the session.
374
+ #
375
+ # @option options [Float] :http_idle_timeout (5)
376
+ # The number of seconds a connection is allowed to sit idle before it
377
+ # is considered stale. Stale connections are closed and removed from the
378
+ # pool before making a request.
379
+ #
380
+ # @option options [Float] :http_open_timeout (15)
381
+ # The default number of seconds to wait for response data.
382
+ # This value can safely be set per-request on the session.
383
+ #
384
+ # @option options [URI::HTTP,String] :http_proxy
385
+ # A proxy to send requests through. Formatted like 'http://proxy.com:123'.
386
+ #
387
+ # @option options [Float] :http_read_timeout (60)
388
+ # The default number of seconds to wait for response data.
389
+ # This value can safely be set per-request on the session.
390
+ #
391
+ # @option options [Boolean] :http_wire_trace (false)
392
+ # When `true`, HTTP debug output will be sent to the `:logger`.
393
+ #
394
+ # @option options [Proc] :on_chunk_received
395
+ # When a Proc object is provided, it will be used as callback when each chunk
396
+ # of the response body is received. It provides three arguments: the chunk,
397
+ # the number of bytes received, and the total number of
398
+ # bytes in the response (or nil if the server did not send a `content-length`).
399
+ #
400
+ # @option options [Proc] :on_chunk_sent
401
+ # When a Proc object is provided, it will be used as callback when each chunk
402
+ # of the request body is sent. It provides three arguments: the chunk,
403
+ # the number of bytes read from the body, and the total number of
404
+ # bytes in the body.
405
+ #
406
+ # @option options [Boolean] :raise_response_errors (true)
407
+ # When `true`, response errors are raised.
408
+ #
409
+ # @option options [String] :ssl_ca_bundle
410
+ # Full path to the SSL certificate authority bundle file that should be used when
411
+ # verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
412
+ # `:ssl_ca_directory` the the system default will be used if available.
413
+ #
414
+ # @option options [String] :ssl_ca_directory
415
+ # Full path of the directory that contains the unbundled SSL certificate
416
+ # authority files for verifying peer certificates. If you do
417
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the system
418
+ # default will be used if available.
378
419
  #
379
- # @option options [Boolean] :ssl_verify_peer (true) When `true`,
380
- # SSL peer certificates are verified when establishing a
381
- # connection.
420
+ # @option options [String] :ssl_ca_store
421
+ # Sets the X509::Store to verify peer certificate.
382
422
  #
383
- # @option options [String] :ssl_ca_bundle Full path to the SSL
384
- # certificate authority bundle file that should be used when
385
- # verifying peer certificates. If you do not pass
386
- # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
387
- # will be used if available.
423
+ # @option options [Float] :ssl_timeout
424
+ # Sets the SSL timeout in seconds
388
425
  #
389
- # @option options [String] :ssl_ca_directory Full path of the
390
- # directory that contains the unbundled SSL certificate
391
- # authority files for verifying peer certificates. If you do
392
- # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
393
- # system default will be used if available.
426
+ # @option options [Boolean] :ssl_verify_peer (true)
427
+ # When `true`, SSL peer certificates are verified when establishing a connection.
394
428
  #
395
429
  def initialize(*args)
396
430
  super
@@ -1396,7 +1430,7 @@ module Aws::KMS
1396
1430
  # key_id: "KeyIdType", # required
1397
1431
  # grantee_principal: "PrincipalIdType", # required
1398
1432
  # retiring_principal: "PrincipalIdType",
1399
- # operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, Sign, Verify, GetPublicKey, CreateGrant, RetireGrant, DescribeKey, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext, GenerateMac, VerifyMac
1433
+ # operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, Sign, Verify, GetPublicKey, CreateGrant, RetireGrant, DescribeKey, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext, GenerateMac, VerifyMac, DeriveSharedSecret
1400
1434
  # constraints: {
1401
1435
  # encryption_context_subset: {
1402
1436
  # "EncryptionContextKey" => "EncryptionContextValue",
@@ -1483,12 +1517,17 @@ module Aws::KMS
1483
1517
  # key pair, or an SM2 key pair (China Regions only). The private key
1484
1518
  # in an asymmetric KMS key never leaves KMS unencrypted. However, you
1485
1519
  # can use the GetPublicKey operation to download the public key so it
1486
- # can be used outside of KMS. KMS keys with RSA or SM2 key pairs can
1487
- # be used to encrypt or decrypt data or sign and verify messages (but
1488
- # not both). KMS keys with ECC key pairs can be used only to sign and
1489
- # verify messages. For information about asymmetric KMS keys, see
1490
- # [Asymmetric KMS keys][3] in the *Key Management Service Developer
1491
- # Guide*.
1520
+ # can be used outside of KMS. Each KMS key can have only one key
1521
+ # usage. KMS keys with RSA key pairs can be used to encrypt and
1522
+ # decrypt data or sign and verify messages (but not both). KMS keys
1523
+ # with NIST-recommended ECC key pairs can be used to sign and verify
1524
+ # messages or derive shared secrets (but not both). KMS keys with
1525
+ # `ECC_SECG_P256K1` can be used only to sign and verify messages. KMS
1526
+ # keys with SM2 key pairs (China Regions only) can be used to either
1527
+ # encrypt and decrypt data, sign and verify messages, or derive shared
1528
+ # secrets (you must choose one key usage type). For information about
1529
+ # asymmetric KMS keys, see [Asymmetric KMS keys][3] in the *Key
1530
+ # Management Service Developer Guide*.
1492
1531
  #
1493
1532
  #
1494
1533
  #
@@ -1710,14 +1749,17 @@ module Aws::KMS
1710
1749
  #
1711
1750
  # * For HMAC KMS keys (symmetric), specify `GENERATE_VERIFY_MAC`.
1712
1751
  #
1713
- # * For asymmetric KMS keys with RSA key material, specify
1752
+ # * For asymmetric KMS keys with RSA key pairs, specify
1714
1753
  # `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
1715
1754
  #
1716
- # * For asymmetric KMS keys with ECC key material, specify
1755
+ # * For asymmetric KMS keys with NIST-recommended elliptic curve key
1756
+ # pairs, specify `SIGN_VERIFY` or `KEY_AGREEMENT`.
1757
+ #
1758
+ # * For asymmetric KMS keys with `ECC_SECG_P256K1` key pairs specify
1717
1759
  # `SIGN_VERIFY`.
1718
1760
  #
1719
- # * For asymmetric KMS keys with SM2 key material (China Regions only),
1720
- # specify `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
1761
+ # * For asymmetric KMS keys with SM2 key pairs (China Regions only),
1762
+ # specify `ENCRYPT_DECRYPT`, `SIGN_VERIFY`, or `KEY_AGREEMENT`.
1721
1763
  #
1722
1764
  #
1723
1765
  #
@@ -1770,7 +1812,8 @@ module Aws::KMS
1770
1812
  #
1771
1813
  # * `HMAC_512`
1772
1814
  #
1773
- # * Asymmetric RSA key pairs
1815
+ # * Asymmetric RSA key pairs (encryption and decryption -or- signing and
1816
+ # verification)
1774
1817
  #
1775
1818
  # * `RSA_2048`
1776
1819
  #
@@ -1778,7 +1821,8 @@ module Aws::KMS
1778
1821
  #
1779
1822
  # * `RSA_4096`
1780
1823
  #
1781
- # * Asymmetric NIST-recommended elliptic curve key pairs
1824
+ # * Asymmetric NIST-recommended elliptic curve key pairs (signing and
1825
+ # verification -or- deriving shared secrets)
1782
1826
  #
1783
1827
  # * `ECC_NIST_P256` (secp256r1)
1784
1828
  #
@@ -1786,15 +1830,16 @@ module Aws::KMS
1786
1830
  #
1787
1831
  # * `ECC_NIST_P521` (secp521r1)
1788
1832
  #
1789
- # * Other asymmetric elliptic curve key pairs
1833
+ # * Other asymmetric elliptic curve key pairs (signing and verification)
1790
1834
  #
1791
1835
  # * `ECC_SECG_P256K1` (secp256k1), commonly used for cryptocurrencies.
1792
1836
  #
1793
1837
  # ^
1794
1838
  #
1795
- # * SM2 key pairs (China Regions only)
1839
+ # * SM2 key pairs (encryption and decryption -or- signing and
1840
+ # verification -or- deriving shared secrets)
1796
1841
  #
1797
- # * `SM2`
1842
+ # * `SM2` (China Regions only)
1798
1843
  #
1799
1844
  # ^
1800
1845
  #
@@ -2258,7 +2303,7 @@ module Aws::KMS
2258
2303
  # resp = client.create_key({
2259
2304
  # policy: "PolicyType",
2260
2305
  # description: "DescriptionType",
2261
- # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
2306
+ # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC, KEY_AGREEMENT
2262
2307
  # customer_master_key_spec: "RSA_2048", # accepts RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
2263
2308
  # key_spec: "RSA_2048", # accepts RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
2264
2309
  # origin: "AWS_KMS", # accepts AWS_KMS, EXTERNAL, AWS_CLOUDHSM, EXTERNAL_KEY_STORE
@@ -2282,7 +2327,7 @@ module Aws::KMS
2282
2327
  # resp.key_metadata.creation_date #=> Time
2283
2328
  # resp.key_metadata.enabled #=> Boolean
2284
2329
  # resp.key_metadata.description #=> String
2285
- # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
2330
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC", "KEY_AGREEMENT"
2286
2331
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
2287
2332
  # resp.key_metadata.deletion_date #=> Time
2288
2333
  # resp.key_metadata.valid_to #=> Time
@@ -2297,6 +2342,8 @@ module Aws::KMS
2297
2342
  # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
2298
2343
  # resp.key_metadata.signing_algorithms #=> Array
2299
2344
  # resp.key_metadata.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512", "SM2DSA"
2345
+ # resp.key_metadata.key_agreement_algorithms #=> Array
2346
+ # resp.key_metadata.key_agreement_algorithms[0] #=> String, one of "ECDH"
2300
2347
  # resp.key_metadata.multi_region #=> Boolean
2301
2348
  # resp.key_metadata.multi_region_configuration.multi_region_key_type #=> String, one of "PRIMARY", "REPLICA"
2302
2349
  # resp.key_metadata.multi_region_configuration.primary_key.arn #=> String
@@ -2893,6 +2940,270 @@ module Aws::KMS
2893
2940
  req.send_request(options)
2894
2941
  end
2895
2942
 
2943
+ # Derives a shared secret using a key agreement algorithm.
2944
+ #
2945
+ # <note markdown="1"> You must use an asymmetric NIST-recommended elliptic curve (ECC) or
2946
+ # SM2 (China Regions only) KMS key pair with a `KeyUsage` value of
2947
+ # `KEY_AGREEMENT` to call DeriveSharedSecret.
2948
+ #
2949
+ # </note>
2950
+ #
2951
+ # DeriveSharedSecret uses the [Elliptic Curve Cryptography Cofactor
2952
+ # Diffie-Hellman Primitive][1] (ECDH) to establish a key agreement
2953
+ # between two peers by deriving a shared secret from their elliptic
2954
+ # curve public-private key pairs. You can use the raw shared secret that
2955
+ # DeriveSharedSecret returns to derive a symmetric key that can encrypt
2956
+ # and decrypt data that is sent between the two peers, or that can
2957
+ # generate and verify HMACs. KMS recommends that you follow [NIST
2958
+ # recommendations for key derivation][2] when using the raw shared
2959
+ # secret to derive a symmetric key.
2960
+ #
2961
+ # The following workflow demonstrates how to establish key agreement
2962
+ # over an insecure communication channel using DeriveSharedSecret.
2963
+ #
2964
+ # 1. **Alice** calls CreateKey to create an asymmetric KMS key pair
2965
+ # with a `KeyUsage` value of `KEY_AGREEMENT`.
2966
+ #
2967
+ # The asymmetric KMS key must use a NIST-recommended elliptic curve
2968
+ # (ECC) or SM2 (China Regions only) key spec.
2969
+ #
2970
+ # 2. **Bob** creates an elliptic curve key pair.
2971
+ #
2972
+ # Bob can call CreateKey to create an asymmetric KMS key pair or
2973
+ # generate a key pair outside of KMS. Bob's key pair must use the
2974
+ # same NIST-recommended elliptic curve (ECC) or SM2 (China Regions
2975
+ # ony) curve as Alice.
2976
+ #
2977
+ # 3. Alice and Bob **exchange their public keys** through an insecure
2978
+ # communication channel (like the internet).
2979
+ #
2980
+ # Use GetPublicKey to download the public key of your asymmetric KMS
2981
+ # key pair.
2982
+ #
2983
+ # <note markdown="1"> KMS strongly recommends verifying that the public key you receive
2984
+ # came from the expected party before using it to derive a shared
2985
+ # secret.
2986
+ #
2987
+ # </note>
2988
+ #
2989
+ # 4. **Alice** calls DeriveSharedSecret.
2990
+ #
2991
+ # KMS uses the private key from the KMS key pair generated in **Step
2992
+ # 1**, Bob's public key, and the Elliptic Curve Cryptography
2993
+ # Cofactor Diffie-Hellman Primitive to derive the shared secret. The
2994
+ # private key in your KMS key pair never leaves KMS unencrypted.
2995
+ # DeriveSharedSecret returns the raw shared secret.
2996
+ #
2997
+ # 5. **Bob** uses the Elliptic Curve Cryptography Cofactor
2998
+ # Diffie-Hellman Primitive to calculate the same raw secret using
2999
+ # his private key and Alice's public key.
3000
+ #
3001
+ # To derive a shared secret you must provide a key agreement algorithm,
3002
+ # the private key of the caller's asymmetric NIST-recommended elliptic
3003
+ # curve or SM2 (China Regions only) KMS key pair, and the public key
3004
+ # from your peer's NIST-recommended elliptic curve or SM2 (China
3005
+ # Regions only) key pair. The public key can be from another asymmetric
3006
+ # KMS key pair or from a key pair generated outside of KMS, but both key
3007
+ # pairs must be on the same elliptic curve.
3008
+ #
3009
+ # The KMS key that you use for this operation must be in a compatible
3010
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
3011
+ # Management Service Developer Guide*.
3012
+ #
3013
+ # **Cross-account use**: Yes. To perform this operation with a KMS key
3014
+ # in a different Amazon Web Services account, specify the key ARN or
3015
+ # alias ARN in the value of the `KeyId` parameter.
3016
+ #
3017
+ # **Required permissions**: [kms:DeriveSharedSecret][4] (key policy)
3018
+ #
3019
+ # **Related operations:**
3020
+ #
3021
+ # * CreateKey
3022
+ #
3023
+ # * GetPublicKey
3024
+ #
3025
+ # * DescribeKey
3026
+ #
3027
+ # **Eventual consistency**: The KMS API follows an eventual consistency
3028
+ # model. For more information, see [KMS eventual consistency][5].
3029
+ #
3030
+ #
3031
+ #
3032
+ # [1]: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Ar3.pdf#page=60
3033
+ # [2]: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Cr2.pdf
3034
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
3035
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3036
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html
3037
+ #
3038
+ # @option params [required, String] :key_id
3039
+ # Identifies an asymmetric NIST-recommended ECC or SM2 (China Regions
3040
+ # only) KMS key. KMS uses the private key in the specified key pair to
3041
+ # derive the shared secret. The key usage of the KMS key must be
3042
+ # `KEY_AGREEMENT`. To find the `KeyUsage` of a KMS key, use the
3043
+ # DescribeKey operation.
3044
+ #
3045
+ # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3046
+ # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
3047
+ # KMS key in a different Amazon Web Services account, you must use the
3048
+ # key ARN or alias ARN.
3049
+ #
3050
+ # For example:
3051
+ #
3052
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
3053
+ #
3054
+ # * Key ARN:
3055
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
3056
+ #
3057
+ # * Alias name: `alias/ExampleAlias`
3058
+ #
3059
+ # * Alias ARN: `arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias`
3060
+ #
3061
+ # To get the key ID and key ARN for a KMS key, use ListKeys or
3062
+ # DescribeKey. To get the alias name and alias ARN, use ListAliases.
3063
+ #
3064
+ # @option params [required, String] :key_agreement_algorithm
3065
+ # Specifies the key agreement algorithm used to derive the shared
3066
+ # secret. The only valid value is `ECDH`.
3067
+ #
3068
+ # @option params [required, String, StringIO, File] :public_key
3069
+ # Specifies the public key in your peer's NIST-recommended elliptic
3070
+ # curve (ECC) or SM2 (China Regions only) key pair.
3071
+ #
3072
+ # The public key must be a DER-encoded X.509 public key, also known as
3073
+ # `SubjectPublicKeyInfo` (SPKI), as defined in [RFC 5280][1].
3074
+ #
3075
+ # GetPublicKey returns the public key of an asymmetric KMS key pair in
3076
+ # the required DER-encoded format.
3077
+ #
3078
+ # <note markdown="1"> If you use [Amazon Web Services CLI version 1][2], you must provide
3079
+ # the DER-encoded X.509 public key in a file. Otherwise, the Amazon Web
3080
+ # Services CLI Base64-encodes the public key a second time, resulting in
3081
+ # a `ValidationException`.
3082
+ #
3083
+ # </note>
3084
+ #
3085
+ # You can specify the public key as binary data in a file using fileb
3086
+ # (`fileb://<path-to-file>`) or in-line using a Base64 encoded string.
3087
+ #
3088
+ #
3089
+ #
3090
+ # [1]: https://tools.ietf.org/html/rfc5280
3091
+ # [2]: https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-welcome.html
3092
+ #
3093
+ # @option params [Array<String>] :grant_tokens
3094
+ # A list of grant tokens.
3095
+ #
3096
+ # Use a grant token when your permission to call this operation comes
3097
+ # from a new grant that has not yet achieved *eventual consistency*. For
3098
+ # more information, see [Grant token][1] and [Using a grant token][2] in
3099
+ # the *Key Management Service Developer Guide*.
3100
+ #
3101
+ #
3102
+ #
3103
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token
3104
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
3105
+ #
3106
+ # @option params [Boolean] :dry_run
3107
+ # Checks if your request will succeed. `DryRun` is an optional
3108
+ # parameter.
3109
+ #
3110
+ # To learn more about how to use this parameter, see [Testing your KMS
3111
+ # API calls][1] in the *Key Management Service Developer Guide*.
3112
+ #
3113
+ #
3114
+ #
3115
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html
3116
+ #
3117
+ # @option params [Types::RecipientInfo] :recipient
3118
+ # A signed [attestation document][1] from an Amazon Web Services Nitro
3119
+ # enclave and the encryption algorithm to use with the enclave's public
3120
+ # key. The only valid encryption algorithm is `RSAES_OAEP_SHA_256`.
3121
+ #
3122
+ # This parameter only supports attestation documents for Amazon Web
3123
+ # Services Nitro Enclaves. To call DeriveSharedSecret for an Amazon Web
3124
+ # Services Nitro Enclaves, use the [Amazon Web Services Nitro Enclaves
3125
+ # SDK][2] to generate the attestation document and then use the
3126
+ # Recipient parameter from any Amazon Web Services SDK to provide the
3127
+ # attestation document for the enclave.
3128
+ #
3129
+ # When you use this parameter, instead of returning a plaintext copy of
3130
+ # the shared secret, KMS encrypts the plaintext shared secret under the
3131
+ # public key in the attestation document, and returns the resulting
3132
+ # ciphertext in the `CiphertextForRecipient` field in the response. This
3133
+ # ciphertext can be decrypted only with the private key in the enclave.
3134
+ # The `CiphertextBlob` field in the response contains the encrypted
3135
+ # shared secret derived from the KMS key specified by the `KeyId`
3136
+ # parameter and public key specified by the `PublicKey` parameter. The
3137
+ # `SharedSecret` field in the response is null or empty.
3138
+ #
3139
+ # For information about the interaction between KMS and Amazon Web
3140
+ # Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves
3141
+ # uses KMS][3] in the *Key Management Service Developer Guide*.
3142
+ #
3143
+ #
3144
+ #
3145
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc
3146
+ # [2]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk
3147
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html
3148
+ #
3149
+ # @return [Types::DeriveSharedSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
3150
+ #
3151
+ # * {Types::DeriveSharedSecretResponse#key_id #key_id} => String
3152
+ # * {Types::DeriveSharedSecretResponse#shared_secret #shared_secret} => String
3153
+ # * {Types::DeriveSharedSecretResponse#ciphertext_for_recipient #ciphertext_for_recipient} => String
3154
+ # * {Types::DeriveSharedSecretResponse#key_agreement_algorithm #key_agreement_algorithm} => String
3155
+ # * {Types::DeriveSharedSecretResponse#key_origin #key_origin} => String
3156
+ #
3157
+ #
3158
+ # @example Example: To derive a shared secret
3159
+ #
3160
+ # # The following example derives a shared secret using a key agreement algorithm.
3161
+ #
3162
+ # resp = client.derive_shared_secret({
3163
+ # key_agreement_algorithm: "ECDH", # The key agreement algorithm used to derive the shared secret. The only valid value is ECDH.
3164
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The key identifier for an asymmetric KMS key pair. The private key in the specified key pair is used to derive the shared secret.
3165
+ # public_key: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvH3Yj0wbkLEpUl95Cv1cJVjsVNSjwGq3tCLnzXfhVwVvmzGN8pYj3U8nKwgouaHbBWNJYjP5VutbbkKS4Kv4GojwZBJyHN17kmxo8yTjRmjR15SKIQ8cqRA2uaERMLnpztIXdZp232PQPbWGxDyXYJ0aJ5EFSag", # The public key in your peer's asymmetric key pair.
3166
+ # })
3167
+ #
3168
+ # resp.to_h outputs the following:
3169
+ # {
3170
+ # key_agreement_algorithm: "ECDH", # The key agreement algorithm used to derive the shared secret.
3171
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The asymmetric KMS key pair used to derive the shared secret.
3172
+ # key_origin: "AWS_KMS", # The source of the key material for the specified KMS key.
3173
+ # shared_secret: "MEYCIQCKZLWyTk5runarx6XiAkU9gv3lbwPO/pHa+DXFehzdDwIhANwpsIV2g/9SPWLLsF6p/hiSskuIXMTRwqrMdVKWTMHG", # The raw secret derived from the specified key agreement algorithm, private key in the asymmetric KMS key, and your peer's public key.
3174
+ # }
3175
+ #
3176
+ # @example Request syntax with placeholder values
3177
+ #
3178
+ # resp = client.derive_shared_secret({
3179
+ # key_id: "KeyIdType", # required
3180
+ # key_agreement_algorithm: "ECDH", # required, accepts ECDH
3181
+ # public_key: "data", # required
3182
+ # grant_tokens: ["GrantTokenType"],
3183
+ # dry_run: false,
3184
+ # recipient: {
3185
+ # key_encryption_algorithm: "RSAES_OAEP_SHA_256", # accepts RSAES_OAEP_SHA_256
3186
+ # attestation_document: "data",
3187
+ # },
3188
+ # })
3189
+ #
3190
+ # @example Response structure
3191
+ #
3192
+ # resp.key_id #=> String
3193
+ # resp.shared_secret #=> String
3194
+ # resp.ciphertext_for_recipient #=> String
3195
+ # resp.key_agreement_algorithm #=> String, one of "ECDH"
3196
+ # resp.key_origin #=> String, one of "AWS_KMS", "EXTERNAL", "AWS_CLOUDHSM", "EXTERNAL_KEY_STORE"
3197
+ #
3198
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeriveSharedSecret AWS API Documentation
3199
+ #
3200
+ # @overload derive_shared_secret(params = {})
3201
+ # @param [Hash] params ({})
3202
+ def derive_shared_secret(params = {}, options = {})
3203
+ req = build_request(:derive_shared_secret, params)
3204
+ req.send_request(options)
3205
+ end
3206
+
2896
3207
  # Gets information about [custom key stores][1] in the account and
2897
3208
  # Region.
2898
3209
  #
@@ -3477,7 +3788,7 @@ module Aws::KMS
3477
3788
  # resp.key_metadata.creation_date #=> Time
3478
3789
  # resp.key_metadata.enabled #=> Boolean
3479
3790
  # resp.key_metadata.description #=> String
3480
- # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
3791
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC", "KEY_AGREEMENT"
3481
3792
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
3482
3793
  # resp.key_metadata.deletion_date #=> Time
3483
3794
  # resp.key_metadata.valid_to #=> Time
@@ -3492,6 +3803,8 @@ module Aws::KMS
3492
3803
  # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
3493
3804
  # resp.key_metadata.signing_algorithms #=> Array
3494
3805
  # resp.key_metadata.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512", "SM2DSA"
3806
+ # resp.key_metadata.key_agreement_algorithms #=> Array
3807
+ # resp.key_metadata.key_agreement_algorithms[0] #=> String, one of "ECDH"
3495
3808
  # resp.key_metadata.multi_region #=> Boolean
3496
3809
  # resp.key_metadata.multi_region_configuration.multi_region_key_type #=> String, one of "PRIMARY", "REPLICA"
3497
3810
  # resp.key_metadata.multi_region_configuration.primary_key.arn #=> String
@@ -3619,6 +3932,10 @@ module Aws::KMS
3619
3932
  #
3620
3933
  # * GetKeyRotationStatus
3621
3934
  #
3935
+ # * ListKeyRotations
3936
+ #
3937
+ # * RotateKeyOnDemand
3938
+ #
3622
3939
  # **Eventual consistency**: The KMS API follows an eventual consistency
3623
3940
  # model. For more information, see [KMS eventual consistency][12].
3624
3941
  #
@@ -3851,12 +4168,20 @@ module Aws::KMS
3851
4168
  # Enables [automatic rotation of the key material][1] of the specified
3852
4169
  # symmetric encryption KMS key.
3853
4170
  #
3854
- # When you enable automatic rotation of a [customer managed KMS key][2],
3855
- # KMS rotates the key material of the KMS key one year (approximately
3856
- # 365 days) from the enable date and every year thereafter. You can
3857
- # monitor rotation of the key material for your KMS keys in CloudTrail
3858
- # and Amazon CloudWatch. To disable rotation of the key material in a
3859
- # customer managed KMS key, use the DisableKeyRotation operation.
4171
+ # By default, when you enable automatic rotation of a [customer managed
4172
+ # KMS key][2], KMS rotates the key material of the KMS key one year
4173
+ # (approximately 365 days) from the enable date and every year
4174
+ # thereafter. You can use the optional `RotationPeriodInDays` parameter
4175
+ # to specify a custom rotation period when you enable key rotation, or
4176
+ # you can use `RotationPeriodInDays` to modify the rotation period of a
4177
+ # key that you previously enabled automatic key rotation on.
4178
+ #
4179
+ # You can monitor rotation of the key material for your KMS keys in
4180
+ # CloudTrail and Amazon CloudWatch. To disable rotation of the key
4181
+ # material in a customer managed KMS key, use the DisableKeyRotation
4182
+ # operation. You can use the GetKeyRotationStatus operation to identify
4183
+ # any in progress rotations. You can use the ListKeyRotations operation
4184
+ # to view the details of completed rotations.
3860
4185
  #
3861
4186
  # Automatic key rotation is supported only on [symmetric encryption KMS
3862
4187
  # keys][3]. You cannot enable automatic rotation of [asymmetric KMS
@@ -3865,10 +4190,11 @@ module Aws::KMS
3865
4190
  # disable automatic rotation of a set of related [multi-Region keys][8],
3866
4191
  # set the property on the primary key.
3867
4192
  #
3868
- # You cannot enable or disable automatic rotation [Amazon Web Services
3869
- # managed KMS keys][9]. KMS always rotates the key material of Amazon
3870
- # Web Services managed keys every year. Rotation of [Amazon Web Services
3871
- # owned KMS keys][10] varies.
4193
+ # You cannot enable or disable automatic rotation of [Amazon Web
4194
+ # Services managed KMS keys][9]. KMS always rotates the key material of
4195
+ # Amazon Web Services managed keys every year. Rotation of [Amazon Web
4196
+ # Services owned KMS keys][10] is managed by the Amazon Web Services
4197
+ # service that owns the key.
3872
4198
  #
3873
4199
  # <note markdown="1"> In May 2022, KMS changed the rotation schedule for Amazon Web Services
3874
4200
  # managed keys from every three years (approximately 1,095 days) to
@@ -3897,12 +4223,22 @@ module Aws::KMS
3897
4223
  #
3898
4224
  # * GetKeyRotationStatus
3899
4225
  #
4226
+ # * ListKeyRotations
4227
+ #
4228
+ # * RotateKeyOnDemand
4229
+ #
4230
+ # <note markdown="1"> You can perform on-demand (RotateKeyOnDemand) rotation of the key
4231
+ # material in customer managed KMS keys, regardless of whether or not
4232
+ # automatic key rotation is enabled.
4233
+ #
4234
+ # </note>
4235
+ #
3900
4236
  # **Eventual consistency**: The KMS API follows an eventual consistency
3901
4237
  # model. For more information, see [KMS eventual consistency][13].
3902
4238
  #
3903
4239
  #
3904
4240
  #
3905
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
4241
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-enable-disable
3906
4242
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
3907
4243
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks
3908
4244
  # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
@@ -3943,21 +4279,42 @@ module Aws::KMS
3943
4279
  # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
3944
4280
  # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
3945
4281
  #
4282
+ # @option params [Integer] :rotation_period_in_days
4283
+ # Use this parameter to specify a custom period of time between each
4284
+ # rotation date. If no value is specified, the default value is 365
4285
+ # days.
4286
+ #
4287
+ # The rotation period defines the number of days after you enable
4288
+ # automatic key rotation that KMS will rotate your key material, and the
4289
+ # number of days between each automatic rotation thereafter.
4290
+ #
4291
+ # You can use the [ `kms:RotationPeriodInDays` ][1] condition key to
4292
+ # further constrain the values that principals can specify in the
4293
+ # `RotationPeriodInDays` parameter.
4294
+ #
4295
+ #
4296
+ #
4297
+ #
4298
+ #
4299
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/conditions-kms.html#conditions-kms-rotation-period-in-days
4300
+ #
3946
4301
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
3947
4302
  #
3948
4303
  #
3949
4304
  # @example Example: To enable automatic rotation of key material
3950
4305
  #
3951
- # # The following example enables automatic annual rotation of the key material for the specified KMS key.
4306
+ # # The following example enables automatic rotation with a rotation period of 365 days for the specified KMS key.
3952
4307
  #
3953
4308
  # resp = client.enable_key_rotation({
3954
- # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The identifier of the KMS key whose key material will be rotated annually. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
4309
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The identifier of the KMS key whose key material will be automatically rotated. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
4310
+ # rotation_period_in_days: 365, # The number of days between each rotation date. Specify a value between 9 and 2560. If no value is specified, the default value is 365 days.
3955
4311
  # })
3956
4312
  #
3957
4313
  # @example Request syntax with placeholder values
3958
4314
  #
3959
4315
  # resp = client.enable_key_rotation({
3960
4316
  # key_id: "KeyIdType", # required
4317
+ # rotation_period_in_days: 1,
3961
4318
  # })
3962
4319
  #
3963
4320
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotation AWS API Documentation
@@ -4714,8 +5071,11 @@ module Aws::KMS
4714
5071
  # key. The only valid encryption algorithm is `RSAES_OAEP_SHA_256`.
4715
5072
  #
4716
5073
  # This parameter only supports attestation documents for Amazon Web
4717
- # Services Nitro Enclaves. To include this parameter, use the [Amazon
4718
- # Web Services Nitro Enclaves SDK][2] or any Amazon Web Services SDK.
5074
+ # Services Nitro Enclaves. To call DeriveSharedSecret for an Amazon Web
5075
+ # Services Nitro Enclaves, use the [Amazon Web Services Nitro Enclaves
5076
+ # SDK][2] to generate the attestation document and then use the
5077
+ # Recipient parameter from any Amazon Web Services SDK to provide the
5078
+ # attestation document for the enclave.
4719
5079
  #
4720
5080
  # When you use this parameter, instead of returning a plaintext copy of
4721
5081
  # the private data key, KMS encrypts the plaintext private data key
@@ -5583,13 +5943,15 @@ module Aws::KMS
5583
5943
  # To get the key ID and key ARN for a KMS key, use ListKeys or
5584
5944
  # DescribeKey.
5585
5945
  #
5586
- # @option params [required, String] :policy_name
5587
- # Specifies the name of the key policy. The only valid name is
5588
- # `default`. To get the names of key policies, use ListKeyPolicies.
5946
+ # @option params [String] :policy_name
5947
+ # Specifies the name of the key policy. If no policy name is specified,
5948
+ # the default value is `default`. The only valid name is `default`. To
5949
+ # get the names of key policies, use ListKeyPolicies.
5589
5950
  #
5590
5951
  # @return [Types::GetKeyPolicyResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
5591
5952
  #
5592
5953
  # * {Types::GetKeyPolicyResponse#policy #policy} => String
5954
+ # * {Types::GetKeyPolicyResponse#policy_name #policy_name} => String
5593
5955
  #
5594
5956
  #
5595
5957
  # @example Example: To retrieve a key policy
@@ -5610,12 +5972,13 @@ module Aws::KMS
5610
5972
  #
5611
5973
  # resp = client.get_key_policy({
5612
5974
  # key_id: "KeyIdType", # required
5613
- # policy_name: "PolicyNameType", # required
5975
+ # policy_name: "PolicyNameType",
5614
5976
  # })
5615
5977
  #
5616
5978
  # @example Response structure
5617
5979
  #
5618
5980
  # resp.policy #=> String
5981
+ # resp.policy_name #=> String
5619
5982
  #
5620
5983
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicy AWS API Documentation
5621
5984
  #
@@ -5626,14 +5989,10 @@ module Aws::KMS
5626
5989
  req.send_request(options)
5627
5990
  end
5628
5991
 
5629
- # Gets a Boolean value that indicates whether [automatic rotation of the
5630
- # key material][1] is enabled for the specified KMS key.
5631
- #
5632
- # When you enable automatic rotation for [customer managed KMS keys][2],
5633
- # KMS rotates the key material of the KMS key one year (approximately
5634
- # 365 days) from the enable date and every year thereafter. You can
5635
- # monitor rotation of the key material for your KMS keys in CloudTrail
5636
- # and Amazon CloudWatch.
5992
+ # Provides detailed information about the rotation status for a KMS key,
5993
+ # including whether [automatic rotation of the key material][1] is
5994
+ # enabled for the specified KMS key, the [rotation period][2], and the
5995
+ # next scheduled rotation date.
5637
5996
  #
5638
5997
  # Automatic key rotation is supported only on [symmetric encryption KMS
5639
5998
  # keys][3]. You cannot enable automatic rotation of [asymmetric KMS
@@ -5649,6 +6008,13 @@ module Aws::KMS
5649
6008
  # Services managed KMS keys every year. The key rotation status for
5650
6009
  # Amazon Web Services managed KMS keys is always `true`.
5651
6010
  #
6011
+ # You can perform on-demand (RotateKeyOnDemand) rotation of the key
6012
+ # material in customer managed KMS keys, regardless of whether or not
6013
+ # automatic key rotation is enabled. You can use GetKeyRotationStatus to
6014
+ # identify the date and time that an in progress on-demand rotation was
6015
+ # initiated. You can use ListKeyRotations to view the details of
6016
+ # completed rotations.
6017
+ #
5652
6018
  # <note markdown="1"> In May 2022, KMS changed the rotation schedule for Amazon Web Services
5653
6019
  # managed keys from every three years to every year. For details, see
5654
6020
  # EnableKeyRotation.
@@ -5685,13 +6051,17 @@ module Aws::KMS
5685
6051
  #
5686
6052
  # * EnableKeyRotation
5687
6053
  #
6054
+ # * ListKeyRotations
6055
+ #
6056
+ # * RotateKeyOnDemand
6057
+ #
5688
6058
  # **Eventual consistency**: The KMS API follows an eventual consistency
5689
6059
  # model. For more information, see [KMS eventual consistency][12].
5690
6060
  #
5691
6061
  #
5692
6062
  #
5693
6063
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
5694
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
6064
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotation-period
5695
6065
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks
5696
6066
  # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
5697
6067
  # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
@@ -5722,11 +6092,16 @@ module Aws::KMS
5722
6092
  # @return [Types::GetKeyRotationStatusResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
5723
6093
  #
5724
6094
  # * {Types::GetKeyRotationStatusResponse#key_rotation_enabled #key_rotation_enabled} => Boolean
6095
+ # * {Types::GetKeyRotationStatusResponse#key_id #key_id} => String
6096
+ # * {Types::GetKeyRotationStatusResponse#rotation_period_in_days #rotation_period_in_days} => Integer
6097
+ # * {Types::GetKeyRotationStatusResponse#next_rotation_date #next_rotation_date} => Time
6098
+ # * {Types::GetKeyRotationStatusResponse#on_demand_rotation_start_date #on_demand_rotation_start_date} => Time
5725
6099
  #
5726
6100
  #
5727
6101
  # @example Example: To retrieve the rotation status for a KMS key
5728
6102
  #
5729
- # # The following example retrieves the status of automatic annual rotation of the key material for the specified KMS key.
6103
+ # # The following example retrieves detailed information about the rotation status for a KMS key, including whether
6104
+ # # automatic key rotation is enabled for the specified KMS key, the rotation period, and the next scheduled rotation date.
5730
6105
  #
5731
6106
  # resp = client.get_key_rotation_status({
5732
6107
  # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The identifier of the KMS key whose key material rotation status you want to retrieve. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
@@ -5734,7 +6109,11 @@ module Aws::KMS
5734
6109
  #
5735
6110
  # resp.to_h outputs the following:
5736
6111
  # {
5737
- # key_rotation_enabled: true, # A boolean that indicates the key material rotation status. Returns true when automatic annual rotation of the key material is enabled, or false when it is not.
6112
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # Identifies the specified symmetric encryption KMS key.
6113
+ # key_rotation_enabled: true, # A boolean that indicates the key material rotation status. Returns true when automatic rotation of the key material is enabled, or false when it is not.
6114
+ # next_rotation_date: Time.parse("2024-04-05T15:14:47.757000+00:00"), # The next date that the key material will be automatically rotated.
6115
+ # on_demand_rotation_start_date: Time.parse("2024-03-02T10:11:36.564000+00:00"), # Identifies the date and time that an in progress on-demand rotation was initiated.
6116
+ # rotation_period_in_days: 365, # The number of days between each automatic rotation. The default value is 365 days.
5738
6117
  # }
5739
6118
  #
5740
6119
  # @example Request syntax with placeholder values
@@ -5746,6 +6125,10 @@ module Aws::KMS
5746
6125
  # @example Response structure
5747
6126
  #
5748
6127
  # resp.key_rotation_enabled #=> Boolean
6128
+ # resp.key_id #=> String
6129
+ # resp.rotation_period_in_days #=> Integer
6130
+ # resp.next_rotation_date #=> Time
6131
+ # resp.on_demand_rotation_start_date #=> Time
5749
6132
  #
5750
6133
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatus AWS API Documentation
5751
6134
  #
@@ -5996,8 +6379,8 @@ module Aws::KMS
5996
6379
  #
5997
6380
  # resp = client.get_parameters_for_import({
5998
6381
  # key_id: "KeyIdType", # required
5999
- # wrapping_algorithm: "RSAES_PKCS1_V1_5", # required, accepts RSAES_PKCS1_V1_5, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256, RSA_AES_KEY_WRAP_SHA_1, RSA_AES_KEY_WRAP_SHA_256
6000
- # wrapping_key_spec: "RSA_2048", # required, accepts RSA_2048, RSA_3072, RSA_4096
6382
+ # wrapping_algorithm: "RSAES_PKCS1_V1_5", # required, accepts RSAES_PKCS1_V1_5, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256, RSA_AES_KEY_WRAP_SHA_1, RSA_AES_KEY_WRAP_SHA_256, SM2PKE
6383
+ # wrapping_key_spec: "RSA_2048", # required, accepts RSA_2048, RSA_3072, RSA_4096, SM2
6001
6384
  # })
6002
6385
  #
6003
6386
  # @example Response structure
@@ -6039,7 +6422,8 @@ module Aws::KMS
6039
6422
  # * [KeySpec][2]: The type of key material in the public key, such as
6040
6423
  # `RSA_4096` or `ECC_NIST_P521`.
6041
6424
  #
6042
- # * [KeyUsage][3]: Whether the key is used for encryption or signing.
6425
+ # * [KeyUsage][3]: Whether the key is used for encryption, signing, or
6426
+ # deriving a shared secret.
6043
6427
  #
6044
6428
  # * [EncryptionAlgorithms][4] or [SigningAlgorithms][5]: A list of the
6045
6429
  # encryption algorithms or the signing algorithms for the key.
@@ -6128,6 +6512,7 @@ module Aws::KMS
6128
6512
  # * {Types::GetPublicKeyResponse#key_usage #key_usage} => String
6129
6513
  # * {Types::GetPublicKeyResponse#encryption_algorithms #encryption_algorithms} => Array&lt;String&gt;
6130
6514
  # * {Types::GetPublicKeyResponse#signing_algorithms #signing_algorithms} => Array&lt;String&gt;
6515
+ # * {Types::GetPublicKeyResponse#key_agreement_algorithms #key_agreement_algorithms} => Array&lt;String&gt;
6131
6516
  #
6132
6517
  #
6133
6518
  # @example Example: To download the public key of an asymmetric KMS key
@@ -6165,11 +6550,13 @@ module Aws::KMS
6165
6550
  # resp.public_key #=> String
6166
6551
  # resp.customer_master_key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
6167
6552
  # resp.key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
6168
- # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
6553
+ # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC", "KEY_AGREEMENT"
6169
6554
  # resp.encryption_algorithms #=> Array
6170
6555
  # resp.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
6171
6556
  # resp.signing_algorithms #=> Array
6172
6557
  # resp.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512", "SM2DSA"
6558
+ # resp.key_agreement_algorithms #=> Array
6559
+ # resp.key_agreement_algorithms[0] #=> String, one of "ECDH"
6173
6560
  #
6174
6561
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetPublicKey AWS API Documentation
6175
6562
  #
@@ -6196,9 +6583,7 @@ module Aws::KMS
6196
6583
  # import different key material. You might reimport key material to
6197
6584
  # replace key material that expired or key material that you deleted.
6198
6585
  # You might also reimport key material to change the expiration model or
6199
- # expiration date of the key material. Before reimporting key material,
6200
- # if necessary, call DeleteImportedKeyMaterial to delete the current
6201
- # imported key material.
6586
+ # expiration date of the key material.
6202
6587
  #
6203
6588
  # Each time you import key material into KMS, you can determine whether
6204
6589
  # (`ExpirationModel`) and when (`ValidTo`) the key material expires. To
@@ -6774,7 +7159,7 @@ module Aws::KMS
6774
7159
  # resp.grants[0].retiring_principal #=> String
6775
7160
  # resp.grants[0].issuing_account #=> String
6776
7161
  # resp.grants[0].operations #=> Array
6777
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac"
7162
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac", "DeriveSharedSecret"
6778
7163
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
6779
7164
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
6780
7165
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -6896,6 +7281,129 @@ module Aws::KMS
6896
7281
  req.send_request(options)
6897
7282
  end
6898
7283
 
7284
+ # Returns information about all completed key material rotations for the
7285
+ # specified KMS key.
7286
+ #
7287
+ # You must specify the KMS key in all requests. You can refine the key
7288
+ # rotations list by limiting the number of rotations returned.
7289
+ #
7290
+ # For detailed information about automatic and on-demand key rotations,
7291
+ # see [Rotating KMS keys][1] in the *Key Management Service Developer
7292
+ # Guide*.
7293
+ #
7294
+ # **Cross-account use**: No. You cannot perform this operation on a KMS
7295
+ # key in a different Amazon Web Services account.
7296
+ #
7297
+ # **Required permissions**: [kms:ListKeyRotations][2] (key policy)
7298
+ #
7299
+ # **Related operations:**
7300
+ #
7301
+ # * EnableKeyRotation
7302
+ #
7303
+ # * DisableKeyRotation
7304
+ #
7305
+ # * GetKeyRotationStatus
7306
+ #
7307
+ # * RotateKeyOnDemand
7308
+ #
7309
+ # **Eventual consistency**: The KMS API follows an eventual consistency
7310
+ # model. For more information, see [KMS eventual consistency][3].
7311
+ #
7312
+ #
7313
+ #
7314
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
7315
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
7316
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html
7317
+ #
7318
+ # @option params [required, String] :key_id
7319
+ # Gets the key rotations for the specified KMS key.
7320
+ #
7321
+ # Specify the key ID or key ARN of the KMS key.
7322
+ #
7323
+ # For example:
7324
+ #
7325
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
7326
+ #
7327
+ # * Key ARN:
7328
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
7329
+ #
7330
+ # To get the key ID and key ARN for a KMS key, use ListKeys or
7331
+ # DescribeKey.
7332
+ #
7333
+ # @option params [Integer] :limit
7334
+ # Use this parameter to specify the maximum number of items to return.
7335
+ # When this value is present, KMS does not return more than the
7336
+ # specified number of items, but it might return fewer.
7337
+ #
7338
+ # This value is optional. If you include a value, it must be between 1
7339
+ # and 1000, inclusive. If you do not include a value, it defaults to
7340
+ # 100.
7341
+ #
7342
+ # @option params [String] :marker
7343
+ # Use this parameter in a subsequent request after you receive a
7344
+ # response with truncated results. Set it to the value of `NextMarker`
7345
+ # from the truncated response you just received.
7346
+ #
7347
+ # @return [Types::ListKeyRotationsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
7348
+ #
7349
+ # * {Types::ListKeyRotationsResponse#rotations #rotations} => Array&lt;Types::RotationsListEntry&gt;
7350
+ # * {Types::ListKeyRotationsResponse#next_marker #next_marker} => String
7351
+ # * {Types::ListKeyRotationsResponse#truncated #truncated} => Boolean
7352
+ #
7353
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
7354
+ #
7355
+ #
7356
+ # @example Example: To retrieve information about all completed key material rotations
7357
+ #
7358
+ # # The following example returns information about all completed key material rotations for the specified KMS key.
7359
+ #
7360
+ # resp = client.list_key_rotations({
7361
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
7362
+ # })
7363
+ #
7364
+ # resp.to_h outputs the following:
7365
+ # {
7366
+ # rotations: [
7367
+ # {
7368
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
7369
+ # rotation_date: Time.parse("2024-03-02T10:11:36.564000+00:00"),
7370
+ # rotation_type: "AUTOMATIC",
7371
+ # },
7372
+ # {
7373
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
7374
+ # rotation_date: Time.parse("2024-04-05T15:14:47.757000+00:00"),
7375
+ # rotation_type: "ON_DEMAND",
7376
+ # },
7377
+ # ], # A list of key rotations.
7378
+ # truncated: false, # A flag that indicates whether there are more items in the list. When the value is true, the list in this response is truncated. To get more items, pass the value of the NextMarker element in this response to the Marker parameter in a subsequent request.
7379
+ # }
7380
+ #
7381
+ # @example Request syntax with placeholder values
7382
+ #
7383
+ # resp = client.list_key_rotations({
7384
+ # key_id: "KeyIdType", # required
7385
+ # limit: 1,
7386
+ # marker: "MarkerType",
7387
+ # })
7388
+ #
7389
+ # @example Response structure
7390
+ #
7391
+ # resp.rotations #=> Array
7392
+ # resp.rotations[0].key_id #=> String
7393
+ # resp.rotations[0].rotation_date #=> Time
7394
+ # resp.rotations[0].rotation_type #=> String, one of "AUTOMATIC", "ON_DEMAND"
7395
+ # resp.next_marker #=> String
7396
+ # resp.truncated #=> Boolean
7397
+ #
7398
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyRotations AWS API Documentation
7399
+ #
7400
+ # @overload list_key_rotations(params = {})
7401
+ # @param [Hash] params ({})
7402
+ def list_key_rotations(params = {}, options = {})
7403
+ req = build_request(:list_key_rotations, params)
7404
+ req.send_request(options)
7405
+ end
7406
+
6899
7407
  # Gets a list of all KMS keys in the caller's Amazon Web Services
6900
7408
  # account and Region.
6901
7409
  #
@@ -7273,7 +7781,7 @@ module Aws::KMS
7273
7781
  # resp.grants[0].retiring_principal #=> String
7274
7782
  # resp.grants[0].issuing_account #=> String
7275
7783
  # resp.grants[0].operations #=> Array
7276
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac"
7784
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac", "DeriveSharedSecret"
7277
7785
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
7278
7786
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
7279
7787
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -7333,8 +7841,9 @@ module Aws::KMS
7333
7841
  # To get the key ID and key ARN for a KMS key, use ListKeys or
7334
7842
  # DescribeKey.
7335
7843
  #
7336
- # @option params [required, String] :policy_name
7337
- # The name of the key policy. The only valid value is `default`.
7844
+ # @option params [String] :policy_name
7845
+ # The name of the key policy. If no policy name is specified, the
7846
+ # default value is `default`. The only valid value is `default`.
7338
7847
  #
7339
7848
  # @option params [required, String] :policy
7340
7849
  # The key policy to attach to the KMS key.
@@ -7416,7 +7925,7 @@ module Aws::KMS
7416
7925
  #
7417
7926
  # resp = client.put_key_policy({
7418
7927
  # key_id: "KeyIdType", # required
7419
- # policy_name: "PolicyNameType", # required
7928
+ # policy_name: "PolicyNameType",
7420
7929
  # policy: "PolicyType", # required
7421
7930
  # bypass_policy_lockout_safety_check: false,
7422
7931
  # })
@@ -8110,7 +8619,7 @@ module Aws::KMS
8110
8619
  # resp.replica_key_metadata.creation_date #=> Time
8111
8620
  # resp.replica_key_metadata.enabled #=> Boolean
8112
8621
  # resp.replica_key_metadata.description #=> String
8113
- # resp.replica_key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
8622
+ # resp.replica_key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC", "KEY_AGREEMENT"
8114
8623
  # resp.replica_key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
8115
8624
  # resp.replica_key_metadata.deletion_date #=> Time
8116
8625
  # resp.replica_key_metadata.valid_to #=> Time
@@ -8125,6 +8634,8 @@ module Aws::KMS
8125
8634
  # resp.replica_key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
8126
8635
  # resp.replica_key_metadata.signing_algorithms #=> Array
8127
8636
  # resp.replica_key_metadata.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512", "SM2DSA"
8637
+ # resp.replica_key_metadata.key_agreement_algorithms #=> Array
8638
+ # resp.replica_key_metadata.key_agreement_algorithms[0] #=> String, one of "ECDH"
8128
8639
  # resp.replica_key_metadata.multi_region #=> Boolean
8129
8640
  # resp.replica_key_metadata.multi_region_configuration.multi_region_key_type #=> String, one of "PRIMARY", "REPLICA"
8130
8641
  # resp.replica_key_metadata.multi_region_configuration.primary_key.arn #=> String
@@ -8302,7 +8813,7 @@ module Aws::KMS
8302
8813
  #
8303
8814
  #
8304
8815
  #
8305
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/managing-grants.html#grant-delete
8816
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete
8306
8817
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-eventual-consistency
8307
8818
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html
8308
8819
  # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html
@@ -8370,6 +8881,147 @@ module Aws::KMS
8370
8881
  req.send_request(options)
8371
8882
  end
8372
8883
 
8884
+ # Immediately initiates rotation of the key material of the specified
8885
+ # symmetric encryption KMS key.
8886
+ #
8887
+ # You can perform [on-demand rotation][1] of the key material in
8888
+ # customer managed KMS keys, regardless of whether or not [automatic key
8889
+ # rotation][2] is enabled. On-demand rotations do not change existing
8890
+ # automatic rotation schedules. For example, consider a KMS key that has
8891
+ # automatic key rotation enabled with a rotation period of 730 days. If
8892
+ # the key is scheduled to automatically rotate on April 14, 2024, and
8893
+ # you perform an on-demand rotation on April 10, 2024, the key will
8894
+ # automatically rotate, as scheduled, on April 14, 2024 and every 730
8895
+ # days thereafter.
8896
+ #
8897
+ # <note markdown="1"> You can perform on-demand key rotation a **maximum of 10 times** per
8898
+ # KMS key. You can use the KMS console to view the number of remaining
8899
+ # on-demand rotations available for a KMS key.
8900
+ #
8901
+ # </note>
8902
+ #
8903
+ # You can use GetKeyRotationStatus to identify any in progress on-demand
8904
+ # rotations. You can use ListKeyRotations to identify the date that
8905
+ # completed on-demand rotations were performed. You can monitor rotation
8906
+ # of the key material for your KMS keys in CloudTrail and Amazon
8907
+ # CloudWatch.
8908
+ #
8909
+ # On-demand key rotation is supported only on [symmetric encryption KMS
8910
+ # keys][3]. You cannot perform on-demand rotation of [asymmetric KMS
8911
+ # keys][4], [HMAC KMS keys][5], KMS keys with [imported key
8912
+ # material][6], or KMS keys in a [custom key store][7]. To perform
8913
+ # on-demand rotation of a set of related [multi-Region keys][8], invoke
8914
+ # the on-demand rotation on the primary key.
8915
+ #
8916
+ # You cannot initiate on-demand rotation of [Amazon Web Services managed
8917
+ # KMS keys][9]. KMS always rotates the key material of Amazon Web
8918
+ # Services managed keys every year. Rotation of [Amazon Web Services
8919
+ # owned KMS keys][10] is managed by the Amazon Web Services service that
8920
+ # owns the key.
8921
+ #
8922
+ # The KMS key that you use for this operation must be in a compatible
8923
+ # key state. For details, see [Key states of KMS keys][11] in the *Key
8924
+ # Management Service Developer Guide*.
8925
+ #
8926
+ # **Cross-account use**: No. You cannot perform this operation on a KMS
8927
+ # key in a different Amazon Web Services account.
8928
+ #
8929
+ # **Required permissions**: [kms:RotateKeyOnDemand][12] (key policy)
8930
+ #
8931
+ # **Related operations:**
8932
+ #
8933
+ # * EnableKeyRotation
8934
+ #
8935
+ # * DisableKeyRotation
8936
+ #
8937
+ # * GetKeyRotationStatus
8938
+ #
8939
+ # * ListKeyRotations
8940
+ #
8941
+ # **Eventual consistency**: The KMS API follows an eventual consistency
8942
+ # model. For more information, see [KMS eventual consistency][13].
8943
+ #
8944
+ #
8945
+ #
8946
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-on-demand
8947
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-enable-disable
8948
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks
8949
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
8950
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
8951
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
8952
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
8953
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
8954
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
8955
+ # [10]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk
8956
+ # [11]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
8957
+ # [12]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
8958
+ # [13]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html
8959
+ #
8960
+ # @option params [required, String] :key_id
8961
+ # Identifies a symmetric encryption KMS key. You cannot perform
8962
+ # on-demand rotation of [asymmetric KMS keys][1], [HMAC KMS keys][2],
8963
+ # KMS keys with [imported key material][3], or KMS keys in a [custom key
8964
+ # store][4]. To perform on-demand rotation of a set of related
8965
+ # [multi-Region keys][5], invoke the on-demand rotation on the primary
8966
+ # key.
8967
+ #
8968
+ # Specify the key ID or key ARN of the KMS key.
8969
+ #
8970
+ # For example:
8971
+ #
8972
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
8973
+ #
8974
+ # * Key ARN:
8975
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
8976
+ #
8977
+ # To get the key ID and key ARN for a KMS key, use ListKeys or
8978
+ # DescribeKey.
8979
+ #
8980
+ #
8981
+ #
8982
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
8983
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
8984
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
8985
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
8986
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
8987
+ #
8988
+ # @return [Types::RotateKeyOnDemandResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
8989
+ #
8990
+ # * {Types::RotateKeyOnDemandResponse#key_id #key_id} => String
8991
+ #
8992
+ #
8993
+ # @example Example: To perform on-demand rotation of key material
8994
+ #
8995
+ # # The following example immediately initiates rotation of the key material for the specified KMS key.
8996
+ #
8997
+ # resp = client.rotate_key_on_demand({
8998
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The identifier of the KMS key whose key material you want to initiate on-demand rotation on. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
8999
+ # })
9000
+ #
9001
+ # resp.to_h outputs the following:
9002
+ # {
9003
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The KMS key that you initiated on-demand rotation on.
9004
+ # }
9005
+ #
9006
+ # @example Request syntax with placeholder values
9007
+ #
9008
+ # resp = client.rotate_key_on_demand({
9009
+ # key_id: "KeyIdType", # required
9010
+ # })
9011
+ #
9012
+ # @example Response structure
9013
+ #
9014
+ # resp.key_id #=> String
9015
+ #
9016
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RotateKeyOnDemand AWS API Documentation
9017
+ #
9018
+ # @overload rotate_key_on_demand(params = {})
9019
+ # @param [Hash] params ({})
9020
+ def rotate_key_on_demand(params = {}, options = {})
9021
+ req = build_request(:rotate_key_on_demand, params)
9022
+ req.send_request(options)
9023
+ end
9024
+
8373
9025
  # Schedules the deletion of a KMS key. By default, KMS applies a waiting
8374
9026
  # period of 30 days, but you can specify a waiting period of 7-30 days.
8375
9027
  # When this operation is successful, the key state of the KMS key
@@ -10103,7 +10755,7 @@ module Aws::KMS
10103
10755
  params: params,
10104
10756
  config: config)
10105
10757
  context[:gem_name] = 'aws-sdk-kms'
10106
- context[:gem_version] = '1.76.0'
10758
+ context[:gem_version] = '1.88.0'
10107
10759
  Seahorse::Client::Request.new(handlers, context)
10108
10760
  end
10109
10761