aws-sdk-kms 1.78.0 → 1.80.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-kms/client.rb +422 -70
- data/lib/aws-sdk-kms/client_api.rb +85 -0
- data/lib/aws-sdk-kms/endpoints.rb +28 -0
- data/lib/aws-sdk-kms/errors.rb +16 -0
- data/lib/aws-sdk-kms/plugins/endpoints.rb +4 -0
- data/lib/aws-sdk-kms/types.rb +231 -14
- data/lib/aws-sdk-kms.rb +1 -1
- data/sig/client.rbs +30 -1
- data/sig/errors.rbs +3 -0
- data/sig/types.rbs +41 -0
- metadata +4 -4
data/lib/aws-sdk-kms/client.rb
CHANGED
@@ -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)
|
@@ -196,10 +198,17 @@ module Aws::KMS
|
|
196
198
|
# When set to 'true' the request body will not be compressed
|
197
199
|
# for supported operations.
|
198
200
|
#
|
199
|
-
# @option options [String] :endpoint
|
200
|
-
#
|
201
|
-
#
|
202
|
-
#
|
201
|
+
# @option options [String, URI::HTTPS, URI::HTTP] :endpoint
|
202
|
+
# Normally you should not configure the `:endpoint` option
|
203
|
+
# directly. This is normally constructed from the `:region`
|
204
|
+
# option. Configuring `:endpoint` is normally reserved for
|
205
|
+
# connecting to test or custom endpoints. The endpoint should
|
206
|
+
# be a URI formatted like:
|
207
|
+
#
|
208
|
+
# 'http://example.com'
|
209
|
+
# 'https://example.com'
|
210
|
+
# 'http://example.com:123'
|
211
|
+
#
|
203
212
|
#
|
204
213
|
# @option options [Integer] :endpoint_cache_max_entries (1000)
|
205
214
|
# Used for the maximum size limit of the LRU cache storing endpoints data
|
@@ -347,50 +356,65 @@ module Aws::KMS
|
|
347
356
|
# @option options [Aws::KMS::EndpointProvider] :endpoint_provider
|
348
357
|
# 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
358
|
#
|
350
|
-
# @option options [
|
351
|
-
#
|
352
|
-
#
|
353
|
-
#
|
354
|
-
#
|
355
|
-
#
|
356
|
-
#
|
357
|
-
#
|
358
|
-
#
|
359
|
-
#
|
360
|
-
#
|
361
|
-
# @option options [Float] :
|
362
|
-
#
|
363
|
-
#
|
364
|
-
#
|
365
|
-
#
|
366
|
-
#
|
367
|
-
#
|
368
|
-
#
|
369
|
-
#
|
370
|
-
#
|
371
|
-
#
|
372
|
-
#
|
373
|
-
#
|
374
|
-
#
|
375
|
-
#
|
376
|
-
#
|
377
|
-
#
|
359
|
+
# @option options [Float] :http_continue_timeout (1)
|
360
|
+
# The number of seconds to wait for a 100-continue response before sending the
|
361
|
+
# request body. This option has no effect unless the request has "Expect"
|
362
|
+
# header set to "100-continue". Defaults to `nil` which disables this
|
363
|
+
# behaviour. This value can safely be set per request on the session.
|
364
|
+
#
|
365
|
+
# @option options [Float] :http_idle_timeout (5)
|
366
|
+
# The number of seconds a connection is allowed to sit idle before it
|
367
|
+
# is considered stale. Stale connections are closed and removed from the
|
368
|
+
# pool before making a request.
|
369
|
+
#
|
370
|
+
# @option options [Float] :http_open_timeout (15)
|
371
|
+
# The default number of seconds to wait for response data.
|
372
|
+
# This value can safely be set per-request on the session.
|
373
|
+
#
|
374
|
+
# @option options [URI::HTTP,String] :http_proxy
|
375
|
+
# A proxy to send requests through. Formatted like 'http://proxy.com:123'.
|
376
|
+
#
|
377
|
+
# @option options [Float] :http_read_timeout (60)
|
378
|
+
# The default number of seconds to wait for response data.
|
379
|
+
# This value can safely be set per-request on the session.
|
380
|
+
#
|
381
|
+
# @option options [Boolean] :http_wire_trace (false)
|
382
|
+
# When `true`, HTTP debug output will be sent to the `:logger`.
|
383
|
+
#
|
384
|
+
# @option options [Proc] :on_chunk_received
|
385
|
+
# When a Proc object is provided, it will be used as callback when each chunk
|
386
|
+
# of the response body is received. It provides three arguments: the chunk,
|
387
|
+
# the number of bytes received, and the total number of
|
388
|
+
# bytes in the response (or nil if the server did not send a `content-length`).
|
389
|
+
#
|
390
|
+
# @option options [Proc] :on_chunk_sent
|
391
|
+
# When a Proc object is provided, it will be used as callback when each chunk
|
392
|
+
# of the request body is sent. It provides three arguments: the chunk,
|
393
|
+
# the number of bytes read from the body, and the total number of
|
394
|
+
# bytes in the body.
|
395
|
+
#
|
396
|
+
# @option options [Boolean] :raise_response_errors (true)
|
397
|
+
# When `true`, response errors are raised.
|
398
|
+
#
|
399
|
+
# @option options [String] :ssl_ca_bundle
|
400
|
+
# Full path to the SSL certificate authority bundle file that should be used when
|
401
|
+
# verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
|
402
|
+
# `:ssl_ca_directory` the the system default will be used if available.
|
403
|
+
#
|
404
|
+
# @option options [String] :ssl_ca_directory
|
405
|
+
# Full path of the directory that contains the unbundled SSL certificate
|
406
|
+
# authority files for verifying peer certificates. If you do
|
407
|
+
# not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the system
|
408
|
+
# default will be used if available.
|
378
409
|
#
|
379
|
-
# @option options [
|
380
|
-
#
|
381
|
-
# connection.
|
410
|
+
# @option options [String] :ssl_ca_store
|
411
|
+
# Sets the X509::Store to verify peer certificate.
|
382
412
|
#
|
383
|
-
# @option options [
|
384
|
-
#
|
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.
|
413
|
+
# @option options [Float] :ssl_timeout
|
414
|
+
# Sets the SSL timeout in seconds
|
388
415
|
#
|
389
|
-
# @option options [
|
390
|
-
#
|
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.
|
416
|
+
# @option options [Boolean] :ssl_verify_peer (true)
|
417
|
+
# When `true`, SSL peer certificates are verified when establishing a connection.
|
394
418
|
#
|
395
419
|
def initialize(*args)
|
396
420
|
super
|
@@ -3619,6 +3643,10 @@ module Aws::KMS
|
|
3619
3643
|
#
|
3620
3644
|
# * GetKeyRotationStatus
|
3621
3645
|
#
|
3646
|
+
# * ListKeyRotations
|
3647
|
+
#
|
3648
|
+
# * RotateKeyOnDemand
|
3649
|
+
#
|
3622
3650
|
# **Eventual consistency**: The KMS API follows an eventual consistency
|
3623
3651
|
# model. For more information, see [KMS eventual consistency][12].
|
3624
3652
|
#
|
@@ -3851,12 +3879,20 @@ module Aws::KMS
|
|
3851
3879
|
# Enables [automatic rotation of the key material][1] of the specified
|
3852
3880
|
# symmetric encryption KMS key.
|
3853
3881
|
#
|
3854
|
-
#
|
3855
|
-
# KMS rotates the key material of the KMS key one year
|
3856
|
-
# 365 days) from the enable date and every year
|
3857
|
-
#
|
3858
|
-
#
|
3859
|
-
#
|
3882
|
+
# By default, when you enable automatic rotation of a [customer managed
|
3883
|
+
# KMS key][2], KMS rotates the key material of the KMS key one year
|
3884
|
+
# (approximately 365 days) from the enable date and every year
|
3885
|
+
# thereafter. You can use the optional `RotationPeriodInDays` parameter
|
3886
|
+
# to specify a custom rotation period when you enable key rotation, or
|
3887
|
+
# you can use `RotationPeriodInDays` to modify the rotation period of a
|
3888
|
+
# key that you previously enabled automatic key rotation on.
|
3889
|
+
#
|
3890
|
+
# You can monitor rotation of the key material for your KMS keys in
|
3891
|
+
# CloudTrail and Amazon CloudWatch. To disable rotation of the key
|
3892
|
+
# material in a customer managed KMS key, use the DisableKeyRotation
|
3893
|
+
# operation. You can use the GetKeyRotationStatus operation to identify
|
3894
|
+
# any in progress rotations. You can use the ListKeyRotations operation
|
3895
|
+
# to view the details of completed rotations.
|
3860
3896
|
#
|
3861
3897
|
# Automatic key rotation is supported only on [symmetric encryption KMS
|
3862
3898
|
# keys][3]. You cannot enable automatic rotation of [asymmetric KMS
|
@@ -3865,10 +3901,11 @@ module Aws::KMS
|
|
3865
3901
|
# disable automatic rotation of a set of related [multi-Region keys][8],
|
3866
3902
|
# set the property on the primary key.
|
3867
3903
|
#
|
3868
|
-
# You cannot enable or disable automatic rotation [Amazon Web
|
3869
|
-
# managed KMS keys][9]. KMS always rotates the key material of
|
3870
|
-
# Web Services managed keys every year. Rotation of [Amazon Web
|
3871
|
-
# owned KMS keys][10]
|
3904
|
+
# You cannot enable or disable automatic rotation of [Amazon Web
|
3905
|
+
# Services managed KMS keys][9]. KMS always rotates the key material of
|
3906
|
+
# Amazon Web Services managed keys every year. Rotation of [Amazon Web
|
3907
|
+
# Services owned KMS keys][10] is managed by the Amazon Web Services
|
3908
|
+
# service that owns the key.
|
3872
3909
|
#
|
3873
3910
|
# <note markdown="1"> In May 2022, KMS changed the rotation schedule for Amazon Web Services
|
3874
3911
|
# managed keys from every three years (approximately 1,095 days) to
|
@@ -3897,12 +3934,22 @@ module Aws::KMS
|
|
3897
3934
|
#
|
3898
3935
|
# * GetKeyRotationStatus
|
3899
3936
|
#
|
3937
|
+
# * ListKeyRotations
|
3938
|
+
#
|
3939
|
+
# * RotateKeyOnDemand
|
3940
|
+
#
|
3941
|
+
# <note markdown="1"> You can perform on-demand (RotateKeyOnDemand) rotation of the key
|
3942
|
+
# material in customer managed KMS keys, regardless of whether or not
|
3943
|
+
# automatic key rotation is enabled.
|
3944
|
+
#
|
3945
|
+
# </note>
|
3946
|
+
#
|
3900
3947
|
# **Eventual consistency**: The KMS API follows an eventual consistency
|
3901
3948
|
# model. For more information, see [KMS eventual consistency][13].
|
3902
3949
|
#
|
3903
3950
|
#
|
3904
3951
|
#
|
3905
|
-
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
|
3952
|
+
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-enable-disable
|
3906
3953
|
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
|
3907
3954
|
# [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks
|
3908
3955
|
# [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
|
@@ -3943,21 +3990,42 @@ module Aws::KMS
|
|
3943
3990
|
# [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
|
3944
3991
|
# [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
|
3945
3992
|
#
|
3993
|
+
# @option params [Integer] :rotation_period_in_days
|
3994
|
+
# Use this parameter to specify a custom period of time between each
|
3995
|
+
# rotation date. If no value is specified, the default value is 365
|
3996
|
+
# days.
|
3997
|
+
#
|
3998
|
+
# The rotation period defines the number of days after you enable
|
3999
|
+
# automatic key rotation that KMS will rotate your key material, and the
|
4000
|
+
# number of days between each automatic rotation thereafter.
|
4001
|
+
#
|
4002
|
+
# You can use the [ `kms:RotationPeriodInDays` ][1] condition key to
|
4003
|
+
# further constrain the values that principals can specify in the
|
4004
|
+
# `RotationPeriodInDays` parameter.
|
4005
|
+
#
|
4006
|
+
#
|
4007
|
+
#
|
4008
|
+
#
|
4009
|
+
#
|
4010
|
+
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/conditions-kms.html#conditions-kms-rotation-period-in-days
|
4011
|
+
#
|
3946
4012
|
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
3947
4013
|
#
|
3948
4014
|
#
|
3949
4015
|
# @example Example: To enable automatic rotation of key material
|
3950
4016
|
#
|
3951
|
-
# # The following example enables automatic
|
4017
|
+
# # The following example enables automatic rotation with a rotation period of 365 days for the specified KMS key.
|
3952
4018
|
#
|
3953
4019
|
# 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
|
4020
|
+
# 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.
|
4021
|
+
# 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
4022
|
# })
|
3956
4023
|
#
|
3957
4024
|
# @example Request syntax with placeholder values
|
3958
4025
|
#
|
3959
4026
|
# resp = client.enable_key_rotation({
|
3960
4027
|
# key_id: "KeyIdType", # required
|
4028
|
+
# rotation_period_in_days: 1,
|
3961
4029
|
# })
|
3962
4030
|
#
|
3963
4031
|
# @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotation AWS API Documentation
|
@@ -5629,14 +5697,10 @@ module Aws::KMS
|
|
5629
5697
|
req.send_request(options)
|
5630
5698
|
end
|
5631
5699
|
|
5632
|
-
#
|
5633
|
-
# key material][1] is
|
5634
|
-
#
|
5635
|
-
#
|
5636
|
-
# KMS rotates the key material of the KMS key one year (approximately
|
5637
|
-
# 365 days) from the enable date and every year thereafter. You can
|
5638
|
-
# monitor rotation of the key material for your KMS keys in CloudTrail
|
5639
|
-
# and Amazon CloudWatch.
|
5700
|
+
# Provides detailed information about the rotation status for a KMS key,
|
5701
|
+
# including whether [automatic rotation of the key material][1] is
|
5702
|
+
# enabled for the specified KMS key, the [rotation period][2], and the
|
5703
|
+
# next scheduled rotation date.
|
5640
5704
|
#
|
5641
5705
|
# Automatic key rotation is supported only on [symmetric encryption KMS
|
5642
5706
|
# keys][3]. You cannot enable automatic rotation of [asymmetric KMS
|
@@ -5652,6 +5716,13 @@ module Aws::KMS
|
|
5652
5716
|
# Services managed KMS keys every year. The key rotation status for
|
5653
5717
|
# Amazon Web Services managed KMS keys is always `true`.
|
5654
5718
|
#
|
5719
|
+
# You can perform on-demand (RotateKeyOnDemand) rotation of the key
|
5720
|
+
# material in customer managed KMS keys, regardless of whether or not
|
5721
|
+
# automatic key rotation is enabled. You can use GetKeyRotationStatus to
|
5722
|
+
# identify the date and time that an in progress on-demand rotation was
|
5723
|
+
# initiated. You can use ListKeyRotations to view the details of
|
5724
|
+
# completed rotations.
|
5725
|
+
#
|
5655
5726
|
# <note markdown="1"> In May 2022, KMS changed the rotation schedule for Amazon Web Services
|
5656
5727
|
# managed keys from every three years to every year. For details, see
|
5657
5728
|
# EnableKeyRotation.
|
@@ -5688,13 +5759,17 @@ module Aws::KMS
|
|
5688
5759
|
#
|
5689
5760
|
# * EnableKeyRotation
|
5690
5761
|
#
|
5762
|
+
# * ListKeyRotations
|
5763
|
+
#
|
5764
|
+
# * RotateKeyOnDemand
|
5765
|
+
#
|
5691
5766
|
# **Eventual consistency**: The KMS API follows an eventual consistency
|
5692
5767
|
# model. For more information, see [KMS eventual consistency][12].
|
5693
5768
|
#
|
5694
5769
|
#
|
5695
5770
|
#
|
5696
5771
|
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
|
5697
|
-
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/
|
5772
|
+
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotation-period
|
5698
5773
|
# [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks
|
5699
5774
|
# [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
|
5700
5775
|
# [5]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
|
@@ -5725,11 +5800,16 @@ module Aws::KMS
|
|
5725
5800
|
# @return [Types::GetKeyRotationStatusResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
5726
5801
|
#
|
5727
5802
|
# * {Types::GetKeyRotationStatusResponse#key_rotation_enabled #key_rotation_enabled} => Boolean
|
5803
|
+
# * {Types::GetKeyRotationStatusResponse#key_id #key_id} => String
|
5804
|
+
# * {Types::GetKeyRotationStatusResponse#rotation_period_in_days #rotation_period_in_days} => Integer
|
5805
|
+
# * {Types::GetKeyRotationStatusResponse#next_rotation_date #next_rotation_date} => Time
|
5806
|
+
# * {Types::GetKeyRotationStatusResponse#on_demand_rotation_start_date #on_demand_rotation_start_date} => Time
|
5728
5807
|
#
|
5729
5808
|
#
|
5730
5809
|
# @example Example: To retrieve the rotation status for a KMS key
|
5731
5810
|
#
|
5732
|
-
# # The following example retrieves
|
5811
|
+
# # The following example retrieves detailed information about the rotation status for a KMS key, including whether
|
5812
|
+
# # automatic key rotation is enabled for the specified KMS key, the rotation period, and the next scheduled rotation date.
|
5733
5813
|
#
|
5734
5814
|
# resp = client.get_key_rotation_status({
|
5735
5815
|
# 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.
|
@@ -5737,7 +5817,11 @@ module Aws::KMS
|
|
5737
5817
|
#
|
5738
5818
|
# resp.to_h outputs the following:
|
5739
5819
|
# {
|
5740
|
-
#
|
5820
|
+
# key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # Identifies the specified symmetric encryption KMS key.
|
5821
|
+
# 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.
|
5822
|
+
# next_rotation_date: Time.parse("2024-04-05T15:14:47.757000+00:00"), # The next date that the key material will be automatically rotated.
|
5823
|
+
# 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.
|
5824
|
+
# rotation_period_in_days: 365, # The number of days between each automatic rotation. The default value is 365 days.
|
5741
5825
|
# }
|
5742
5826
|
#
|
5743
5827
|
# @example Request syntax with placeholder values
|
@@ -5749,6 +5833,10 @@ module Aws::KMS
|
|
5749
5833
|
# @example Response structure
|
5750
5834
|
#
|
5751
5835
|
# resp.key_rotation_enabled #=> Boolean
|
5836
|
+
# resp.key_id #=> String
|
5837
|
+
# resp.rotation_period_in_days #=> Integer
|
5838
|
+
# resp.next_rotation_date #=> Time
|
5839
|
+
# resp.on_demand_rotation_start_date #=> Time
|
5752
5840
|
#
|
5753
5841
|
# @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatus AWS API Documentation
|
5754
5842
|
#
|
@@ -6897,6 +6985,129 @@ module Aws::KMS
|
|
6897
6985
|
req.send_request(options)
|
6898
6986
|
end
|
6899
6987
|
|
6988
|
+
# Returns information about all completed key material rotations for the
|
6989
|
+
# specified KMS key.
|
6990
|
+
#
|
6991
|
+
# You must specify the KMS key in all requests. You can refine the key
|
6992
|
+
# rotations list by limiting the number of rotations returned.
|
6993
|
+
#
|
6994
|
+
# For detailed information about automatic and on-demand key rotations,
|
6995
|
+
# see [Rotating KMS keys][1] in the *Key Management Service Developer
|
6996
|
+
# Guide*.
|
6997
|
+
#
|
6998
|
+
# **Cross-account use**: No. You cannot perform this operation on a KMS
|
6999
|
+
# key in a different Amazon Web Services account.
|
7000
|
+
#
|
7001
|
+
# **Required permissions**: [kms:ListKeyRotations][2] (key policy)
|
7002
|
+
#
|
7003
|
+
# **Related operations:**
|
7004
|
+
#
|
7005
|
+
# * EnableKeyRotation
|
7006
|
+
#
|
7007
|
+
# * DisableKeyRotation
|
7008
|
+
#
|
7009
|
+
# * GetKeyRotationStatus
|
7010
|
+
#
|
7011
|
+
# * RotateKeyOnDemand
|
7012
|
+
#
|
7013
|
+
# **Eventual consistency**: The KMS API follows an eventual consistency
|
7014
|
+
# model. For more information, see [KMS eventual consistency][3].
|
7015
|
+
#
|
7016
|
+
#
|
7017
|
+
#
|
7018
|
+
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
|
7019
|
+
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
|
7020
|
+
# [3]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html
|
7021
|
+
#
|
7022
|
+
# @option params [required, String] :key_id
|
7023
|
+
# Gets the key rotations for the specified KMS key.
|
7024
|
+
#
|
7025
|
+
# Specify the key ID or key ARN of the KMS key.
|
7026
|
+
#
|
7027
|
+
# For example:
|
7028
|
+
#
|
7029
|
+
# * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
|
7030
|
+
#
|
7031
|
+
# * Key ARN:
|
7032
|
+
# `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
|
7033
|
+
#
|
7034
|
+
# To get the key ID and key ARN for a KMS key, use ListKeys or
|
7035
|
+
# DescribeKey.
|
7036
|
+
#
|
7037
|
+
# @option params [Integer] :limit
|
7038
|
+
# Use this parameter to specify the maximum number of items to return.
|
7039
|
+
# When this value is present, KMS does not return more than the
|
7040
|
+
# specified number of items, but it might return fewer.
|
7041
|
+
#
|
7042
|
+
# This value is optional. If you include a value, it must be between 1
|
7043
|
+
# and 1000, inclusive. If you do not include a value, it defaults to
|
7044
|
+
# 100.
|
7045
|
+
#
|
7046
|
+
# @option params [String] :marker
|
7047
|
+
# Use this parameter in a subsequent request after you receive a
|
7048
|
+
# response with truncated results. Set it to the value of `NextMarker`
|
7049
|
+
# from the truncated response you just received.
|
7050
|
+
#
|
7051
|
+
# @return [Types::ListKeyRotationsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
7052
|
+
#
|
7053
|
+
# * {Types::ListKeyRotationsResponse#rotations #rotations} => Array<Types::RotationsListEntry>
|
7054
|
+
# * {Types::ListKeyRotationsResponse#next_marker #next_marker} => String
|
7055
|
+
# * {Types::ListKeyRotationsResponse#truncated #truncated} => Boolean
|
7056
|
+
#
|
7057
|
+
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
|
7058
|
+
#
|
7059
|
+
#
|
7060
|
+
# @example Example: To retrieve information about all completed key material rotations
|
7061
|
+
#
|
7062
|
+
# # The following example returns information about all completed key material rotations for the specified KMS key.
|
7063
|
+
#
|
7064
|
+
# resp = client.list_key_rotations({
|
7065
|
+
# key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
|
7066
|
+
# })
|
7067
|
+
#
|
7068
|
+
# resp.to_h outputs the following:
|
7069
|
+
# {
|
7070
|
+
# rotations: [
|
7071
|
+
# {
|
7072
|
+
# key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
|
7073
|
+
# rotation_date: Time.parse("2024-03-02T10:11:36.564000+00:00"),
|
7074
|
+
# rotation_type: "AUTOMATIC",
|
7075
|
+
# },
|
7076
|
+
# {
|
7077
|
+
# key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
|
7078
|
+
# rotation_date: Time.parse("2024-04-05T15:14:47.757000+00:00"),
|
7079
|
+
# rotation_type: "ON_DEMAND",
|
7080
|
+
# },
|
7081
|
+
# ], # A list of key rotations.
|
7082
|
+
# 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.
|
7083
|
+
# }
|
7084
|
+
#
|
7085
|
+
# @example Request syntax with placeholder values
|
7086
|
+
#
|
7087
|
+
# resp = client.list_key_rotations({
|
7088
|
+
# key_id: "KeyIdType", # required
|
7089
|
+
# limit: 1,
|
7090
|
+
# marker: "MarkerType",
|
7091
|
+
# })
|
7092
|
+
#
|
7093
|
+
# @example Response structure
|
7094
|
+
#
|
7095
|
+
# resp.rotations #=> Array
|
7096
|
+
# resp.rotations[0].key_id #=> String
|
7097
|
+
# resp.rotations[0].rotation_date #=> Time
|
7098
|
+
# resp.rotations[0].rotation_type #=> String, one of "AUTOMATIC", "ON_DEMAND"
|
7099
|
+
# resp.next_marker #=> String
|
7100
|
+
# resp.truncated #=> Boolean
|
7101
|
+
#
|
7102
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyRotations AWS API Documentation
|
7103
|
+
#
|
7104
|
+
# @overload list_key_rotations(params = {})
|
7105
|
+
# @param [Hash] params ({})
|
7106
|
+
def list_key_rotations(params = {}, options = {})
|
7107
|
+
req = build_request(:list_key_rotations, params)
|
7108
|
+
req.send_request(options)
|
7109
|
+
end
|
7110
|
+
|
6900
7111
|
# Gets a list of all KMS keys in the caller's Amazon Web Services
|
6901
7112
|
# account and Region.
|
6902
7113
|
#
|
@@ -8372,6 +8583,147 @@ module Aws::KMS
|
|
8372
8583
|
req.send_request(options)
|
8373
8584
|
end
|
8374
8585
|
|
8586
|
+
# Immediately initiates rotation of the key material of the specified
|
8587
|
+
# symmetric encryption KMS key.
|
8588
|
+
#
|
8589
|
+
# You can perform [on-demand rotation][1] of the key material in
|
8590
|
+
# customer managed KMS keys, regardless of whether or not [automatic key
|
8591
|
+
# rotation][2] is enabled. On-demand rotations do not change existing
|
8592
|
+
# automatic rotation schedules. For example, consider a KMS key that has
|
8593
|
+
# automatic key rotation enabled with a rotation period of 730 days. If
|
8594
|
+
# the key is scheduled to automatically rotate on April 14, 2024, and
|
8595
|
+
# you perform an on-demand rotation on April 10, 2024, the key will
|
8596
|
+
# automatically rotate, as scheduled, on April 14, 2024 and every 730
|
8597
|
+
# days thereafter.
|
8598
|
+
#
|
8599
|
+
# <note markdown="1"> You can perform on-demand key rotation a **maximum of 10 times** per
|
8600
|
+
# KMS key. You can use the KMS console to view the number of remaining
|
8601
|
+
# on-demand rotations available for a KMS key.
|
8602
|
+
#
|
8603
|
+
# </note>
|
8604
|
+
#
|
8605
|
+
# You can use GetKeyRotationStatus to identify any in progress on-demand
|
8606
|
+
# rotations. You can use ListKeyRotations to identify the date that
|
8607
|
+
# completed on-demand rotations were performed. You can monitor rotation
|
8608
|
+
# of the key material for your KMS keys in CloudTrail and Amazon
|
8609
|
+
# CloudWatch.
|
8610
|
+
#
|
8611
|
+
# On-demand key rotation is supported only on [symmetric encryption KMS
|
8612
|
+
# keys][3]. You cannot perform on-demand rotation of [asymmetric KMS
|
8613
|
+
# keys][4], [HMAC KMS keys][5], KMS keys with [imported key
|
8614
|
+
# material][6], or KMS keys in a [custom key store][7]. To perform
|
8615
|
+
# on-demand rotation of a set of related [multi-Region keys][8], invoke
|
8616
|
+
# the on-demand rotation on the primary key.
|
8617
|
+
#
|
8618
|
+
# You cannot initiate on-demand rotation of [Amazon Web Services managed
|
8619
|
+
# KMS keys][9]. KMS always rotates the key material of Amazon Web
|
8620
|
+
# Services managed keys every year. Rotation of [Amazon Web Services
|
8621
|
+
# owned KMS keys][10] is managed by the Amazon Web Services service that
|
8622
|
+
# owns the key.
|
8623
|
+
#
|
8624
|
+
# The KMS key that you use for this operation must be in a compatible
|
8625
|
+
# key state. For details, see [Key states of KMS keys][11] in the *Key
|
8626
|
+
# Management Service Developer Guide*.
|
8627
|
+
#
|
8628
|
+
# **Cross-account use**: No. You cannot perform this operation on a KMS
|
8629
|
+
# key in a different Amazon Web Services account.
|
8630
|
+
#
|
8631
|
+
# **Required permissions**: [kms:RotateKeyOnDemand][12] (key policy)
|
8632
|
+
#
|
8633
|
+
# **Related operations:**
|
8634
|
+
#
|
8635
|
+
# * EnableKeyRotation
|
8636
|
+
#
|
8637
|
+
# * DisableKeyRotation
|
8638
|
+
#
|
8639
|
+
# * GetKeyRotationStatus
|
8640
|
+
#
|
8641
|
+
# * ListKeyRotations
|
8642
|
+
#
|
8643
|
+
# **Eventual consistency**: The KMS API follows an eventual consistency
|
8644
|
+
# model. For more information, see [KMS eventual consistency][13].
|
8645
|
+
#
|
8646
|
+
#
|
8647
|
+
#
|
8648
|
+
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-on-demand
|
8649
|
+
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotating-keys-enable-disable
|
8650
|
+
# [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks
|
8651
|
+
# [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
|
8652
|
+
# [5]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
|
8653
|
+
# [6]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
|
8654
|
+
# [7]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
|
8655
|
+
# [8]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
|
8656
|
+
# [9]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
|
8657
|
+
# [10]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk
|
8658
|
+
# [11]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
|
8659
|
+
# [12]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
|
8660
|
+
# [13]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html
|
8661
|
+
#
|
8662
|
+
# @option params [required, String] :key_id
|
8663
|
+
# Identifies a symmetric encryption KMS key. You cannot perform
|
8664
|
+
# on-demand rotation of [asymmetric KMS keys][1], [HMAC KMS keys][2],
|
8665
|
+
# KMS keys with [imported key material][3], or KMS keys in a [custom key
|
8666
|
+
# store][4]. To perform on-demand rotation of a set of related
|
8667
|
+
# [multi-Region keys][5], invoke the on-demand rotation on the primary
|
8668
|
+
# key.
|
8669
|
+
#
|
8670
|
+
# Specify the key ID or key ARN of the KMS key.
|
8671
|
+
#
|
8672
|
+
# For example:
|
8673
|
+
#
|
8674
|
+
# * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
|
8675
|
+
#
|
8676
|
+
# * Key ARN:
|
8677
|
+
# `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
|
8678
|
+
#
|
8679
|
+
# To get the key ID and key ARN for a KMS key, use ListKeys or
|
8680
|
+
# DescribeKey.
|
8681
|
+
#
|
8682
|
+
#
|
8683
|
+
#
|
8684
|
+
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
|
8685
|
+
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
|
8686
|
+
# [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
|
8687
|
+
# [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
|
8688
|
+
# [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
|
8689
|
+
#
|
8690
|
+
# @return [Types::RotateKeyOnDemandResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
8691
|
+
#
|
8692
|
+
# * {Types::RotateKeyOnDemandResponse#key_id #key_id} => String
|
8693
|
+
#
|
8694
|
+
#
|
8695
|
+
# @example Example: To perform on-demand rotation of key material
|
8696
|
+
#
|
8697
|
+
# # The following example immediately initiates rotation of the key material for the specified KMS key.
|
8698
|
+
#
|
8699
|
+
# resp = client.rotate_key_on_demand({
|
8700
|
+
# 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.
|
8701
|
+
# })
|
8702
|
+
#
|
8703
|
+
# resp.to_h outputs the following:
|
8704
|
+
# {
|
8705
|
+
# key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The KMS key that you initiated on-demand rotation on.
|
8706
|
+
# }
|
8707
|
+
#
|
8708
|
+
# @example Request syntax with placeholder values
|
8709
|
+
#
|
8710
|
+
# resp = client.rotate_key_on_demand({
|
8711
|
+
# key_id: "KeyIdType", # required
|
8712
|
+
# })
|
8713
|
+
#
|
8714
|
+
# @example Response structure
|
8715
|
+
#
|
8716
|
+
# resp.key_id #=> String
|
8717
|
+
#
|
8718
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RotateKeyOnDemand AWS API Documentation
|
8719
|
+
#
|
8720
|
+
# @overload rotate_key_on_demand(params = {})
|
8721
|
+
# @param [Hash] params ({})
|
8722
|
+
def rotate_key_on_demand(params = {}, options = {})
|
8723
|
+
req = build_request(:rotate_key_on_demand, params)
|
8724
|
+
req.send_request(options)
|
8725
|
+
end
|
8726
|
+
|
8375
8727
|
# Schedules the deletion of a KMS key. By default, KMS applies a waiting
|
8376
8728
|
# period of 30 days, but you can specify a waiting period of 7-30 days.
|
8377
8729
|
# When this operation is successful, the key state of the KMS key
|
@@ -10105,7 +10457,7 @@ module Aws::KMS
|
|
10105
10457
|
params: params,
|
10106
10458
|
config: config)
|
10107
10459
|
context[:gem_name] = 'aws-sdk-kms'
|
10108
|
-
context[:gem_version] = '1.
|
10460
|
+
context[:gem_version] = '1.80.0'
|
10109
10461
|
Seahorse::Client::Request.new(handlers, context)
|
10110
10462
|
end
|
10111
10463
|
|