aws-sdk-kms 1.121.0 → 1.129.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +40 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-kms/client.rb +498 -100
- data/lib/aws-sdk-kms/client_api.rb +52 -4
- data/lib/aws-sdk-kms/types.rb +363 -88
- data/lib/aws-sdk-kms.rb +1 -1
- data/sig/client.rbs +34 -14
- data/sig/types.rbs +30 -0
- metadata +3 -3
data/lib/aws-sdk-kms/client.rb
CHANGED
|
@@ -199,7 +199,7 @@ module Aws::KMS
|
|
|
199
199
|
# the required types.
|
|
200
200
|
#
|
|
201
201
|
# @option options [Boolean] :correct_clock_skew (true)
|
|
202
|
-
# Used only in `standard` and adaptive retry modes. Specifies whether to apply
|
|
202
|
+
# Used only in `standard` and `adaptive` retry modes. Specifies whether to apply
|
|
203
203
|
# a clock skew correction and retry requests with skewed client clocks.
|
|
204
204
|
#
|
|
205
205
|
# @option options [String] :defaults_mode ("legacy")
|
|
@@ -323,17 +323,15 @@ module Aws::KMS
|
|
|
323
323
|
# @option options [String] :retry_mode ("legacy")
|
|
324
324
|
# Specifies which retry algorithm to use. Values are:
|
|
325
325
|
#
|
|
326
|
-
# * `legacy` - The pre-existing retry behavior.
|
|
327
|
-
# no retry mode is provided.
|
|
326
|
+
# * `legacy` - The pre-existing retry behavior. This is the default
|
|
327
|
+
# value if no retry mode is provided.
|
|
328
328
|
#
|
|
329
329
|
# * `standard` - A standardized set of retry rules across the AWS SDKs.
|
|
330
330
|
# This includes support for retry quotas, which limit the number of
|
|
331
331
|
# unsuccessful retries a client can make.
|
|
332
332
|
#
|
|
333
|
-
# * `adaptive` -
|
|
334
|
-
#
|
|
335
|
-
# throttling. This is a provisional mode that may change behavior
|
|
336
|
-
# in the future.
|
|
333
|
+
# * `adaptive` - A retry mode that includes all the functionality of
|
|
334
|
+
# `standard` mode along with automatic client side throttling.
|
|
337
335
|
#
|
|
338
336
|
# @option options [String] :sdk_ua_app_id
|
|
339
337
|
# A unique and opaque application ID that is appended to the
|
|
@@ -1247,6 +1245,12 @@ module Aws::KMS
|
|
|
1247
1245
|
# temporary permissions because you can create one, use its permissions,
|
|
1248
1246
|
# and delete it without changing your key policies or IAM policies.
|
|
1249
1247
|
#
|
|
1248
|
+
# You can create a grant for an Amazon Web Services principal (IAM user,
|
|
1249
|
+
# IAM role, or Amazon Web Services account) by specifying the
|
|
1250
|
+
# `GranteePrincipal` parameter. You can also create a grant for an
|
|
1251
|
+
# Amazon Web Services service principal by specifying the
|
|
1252
|
+
# `GranteeServicePrincipal` parameter.
|
|
1253
|
+
#
|
|
1250
1254
|
# For detailed information about grants, including grant terminology,
|
|
1251
1255
|
# see [Grants in KMS][1] in the <i> <i>Key Management Service Developer
|
|
1252
1256
|
# Guide</i> </i>. For examples of creating grants in several programming
|
|
@@ -1320,7 +1324,7 @@ module Aws::KMS
|
|
|
1320
1324
|
# To get the key ID and key ARN for a KMS key, use ListKeys or
|
|
1321
1325
|
# DescribeKey.
|
|
1322
1326
|
#
|
|
1323
|
-
# @option params [
|
|
1327
|
+
# @option params [String] :grantee_principal
|
|
1324
1328
|
# The identity that gets the permissions specified in the grant.
|
|
1325
1329
|
#
|
|
1326
1330
|
# To specify the grantee principal, use the Amazon Resource Name (ARN)
|
|
@@ -1330,6 +1334,9 @@ module Aws::KMS
|
|
|
1330
1334
|
# [IAM ARNs][1] in the <i> <i>Identity and Access Management User
|
|
1331
1335
|
# Guide</i> </i>.
|
|
1332
1336
|
#
|
|
1337
|
+
# You must specify either `GranteePrincipal` or
|
|
1338
|
+
# `GranteeServicePrincipal`, but not both.
|
|
1339
|
+
#
|
|
1333
1340
|
#
|
|
1334
1341
|
#
|
|
1335
1342
|
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns
|
|
@@ -1350,6 +1357,9 @@ module Aws::KMS
|
|
|
1350
1357
|
# see RevokeGrant and [Retiring and revoking grants][3] in the *Key
|
|
1351
1358
|
# Management Service Developer Guide*.
|
|
1352
1359
|
#
|
|
1360
|
+
# You can specify either `RetiringPrincipal` or
|
|
1361
|
+
# `RetiringServicePrincipal`, but not both.
|
|
1362
|
+
#
|
|
1353
1363
|
#
|
|
1354
1364
|
#
|
|
1355
1365
|
# [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
|
@@ -1378,39 +1388,52 @@ module Aws::KMS
|
|
|
1378
1388
|
# This field may be displayed in plaintext in CloudTrail logs and other
|
|
1379
1389
|
# output.
|
|
1380
1390
|
#
|
|
1381
|
-
# KMS supports the
|
|
1382
|
-
#
|
|
1383
|
-
#
|
|
1384
|
-
#
|
|
1385
|
-
#
|
|
1386
|
-
#
|
|
1387
|
-
#
|
|
1388
|
-
#
|
|
1389
|
-
#
|
|
1390
|
-
#
|
|
1391
|
-
#
|
|
1392
|
-
#
|
|
1393
|
-
#
|
|
1394
|
-
#
|
|
1395
|
-
#
|
|
1396
|
-
#
|
|
1397
|
-
#
|
|
1398
|
-
#
|
|
1399
|
-
#
|
|
1400
|
-
#
|
|
1401
|
-
#
|
|
1402
|
-
#
|
|
1403
|
-
#
|
|
1404
|
-
#
|
|
1405
|
-
#
|
|
1406
|
-
#
|
|
1407
|
-
#
|
|
1391
|
+
# KMS supports the following grant constraints.
|
|
1392
|
+
#
|
|
1393
|
+
# * `EncryptionContextEquals` and `EncryptionContextSubset` — These
|
|
1394
|
+
# encryption context grant constraints allow the permissions in the
|
|
1395
|
+
# grant only when the encryption context in the request matches
|
|
1396
|
+
# (`EncryptionContextEquals`) or includes (`EncryptionContextSubset`)
|
|
1397
|
+
# the encryption context specified in the constraint.
|
|
1398
|
+
#
|
|
1399
|
+
# Encryption context grant constraints are supported only on [grant
|
|
1400
|
+
# operations][1] that include an `EncryptionContext` parameter, such
|
|
1401
|
+
# as cryptographic operations on symmetric encryption KMS keys. You
|
|
1402
|
+
# cannot use an encryption context grant constraint for cryptographic
|
|
1403
|
+
# operations with asymmetric KMS keys or HMAC KMS keys. Operations
|
|
1404
|
+
# with these keys don't support an encryption context. Grants with
|
|
1405
|
+
# encryption context grant constraints can include the DescribeKey and
|
|
1406
|
+
# RetireGrant operations, but the constraint doesn't apply to these
|
|
1407
|
+
# operations. If a grant with an encryption context grant constraint
|
|
1408
|
+
# includes the `CreateGrant` operation, the constraint requires that
|
|
1409
|
+
# any grants created with the `CreateGrant` permission have an equally
|
|
1410
|
+
# strict or stricter encryption context constraint.
|
|
1411
|
+
#
|
|
1412
|
+
# Each constraint value can include up to 8 encryption context pairs.
|
|
1413
|
+
# The encryption context value in each constraint cannot exceed 384
|
|
1414
|
+
# characters. For more information about encryption context, see
|
|
1415
|
+
# [Encryption context][2] in the <i> <i>Key Management Service
|
|
1416
|
+
# Developer Guide</i> </i>.
|
|
1417
|
+
#
|
|
1418
|
+
# * `SourceArn` — This grant constraint allows the permissions in the
|
|
1419
|
+
# grant only when the request is made on behalf of a specific Amazon
|
|
1420
|
+
# Web Services resource, identified by its [Amazon Resource Name
|
|
1421
|
+
# (ARN)][3]. This is effectively the same as having the
|
|
1422
|
+
# [aws:SourceArn][4] global condition key in the grant. The SourceArn
|
|
1423
|
+
# constraint is supported on grants for all types of KMS keys and can
|
|
1424
|
+
# also be applied to the DescribeKey operation when specified in the
|
|
1425
|
+
# request. However, it does not apply to RetireGrant operation.
|
|
1426
|
+
#
|
|
1427
|
+
# For information about grant constraints, see [Using grant
|
|
1428
|
+
# constraints][5] in the *Key Management Service Developer Guide*.
|
|
1408
1429
|
#
|
|
1409
1430
|
#
|
|
1410
1431
|
#
|
|
1411
1432
|
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations
|
|
1412
|
-
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/
|
|
1413
|
-
# [3]: https://docs.aws.amazon.com/
|
|
1433
|
+
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
|
|
1434
|
+
# [3]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
|
1435
|
+
# [4]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourcearn
|
|
1436
|
+
# [5]: https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints
|
|
1414
1437
|
#
|
|
1415
1438
|
# @option params [Array<String>] :grant_tokens
|
|
1416
1439
|
# A list of grant tokens.
|
|
@@ -1456,6 +1479,32 @@ module Aws::KMS
|
|
|
1456
1479
|
#
|
|
1457
1480
|
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/testing-permissions.html
|
|
1458
1481
|
#
|
|
1482
|
+
# @option params [String] :grantee_service_principal
|
|
1483
|
+
# The Amazon Web Services [service principal][1] that gets the
|
|
1484
|
+
# permissions specified in the grant.
|
|
1485
|
+
#
|
|
1486
|
+
# When you specify a `GranteeServicePrincipal`, you must also specify a
|
|
1487
|
+
# `SourceArn` grant constraint. In addition, you must specify either a
|
|
1488
|
+
# `RetiringPrincipal` or a `RetiringServicePrincipal`.
|
|
1489
|
+
#
|
|
1490
|
+
# You must specify either `GranteePrincipal` or
|
|
1491
|
+
# `GranteeServicePrincipal`, but not both.
|
|
1492
|
+
#
|
|
1493
|
+
#
|
|
1494
|
+
#
|
|
1495
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services
|
|
1496
|
+
#
|
|
1497
|
+
# @option params [String] :retiring_service_principal
|
|
1498
|
+
# The Amazon Web Services [service principal][1] that has permission to
|
|
1499
|
+
# use the RetireGrant operation to retire the grant.
|
|
1500
|
+
#
|
|
1501
|
+
# You can specify either `RetiringPrincipal` or
|
|
1502
|
+
# `RetiringServicePrincipal`, but not both.
|
|
1503
|
+
#
|
|
1504
|
+
#
|
|
1505
|
+
#
|
|
1506
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services
|
|
1507
|
+
#
|
|
1459
1508
|
# @return [Types::CreateGrantResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
1460
1509
|
#
|
|
1461
1510
|
# * {Types::CreateGrantResponse#grant_token #grant_token} => String
|
|
@@ -1481,11 +1530,38 @@ module Aws::KMS
|
|
|
1481
1530
|
# grant_token: "AQpAM2RhZTk1MGMyNTk2ZmZmMzEyYWVhOWViN2I1MWM4Mzc0MWFiYjc0ZDE1ODkyNGFlNTIzODZhMzgyZjBlNGY3NiKIAgEBAgB4Pa6VDCWW__MSrqnre1HIN0Grt00ViSSuUjhqOC8OT3YAAADfMIHcBgkqhkiG9w0BBwaggc4wgcsCAQAwgcUGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMmqLyBTAegIn9XlK5AgEQgIGXZQjkBcl1dykDdqZBUQ6L1OfUivQy7JVYO2-ZJP7m6f1g8GzV47HX5phdtONAP7K_HQIflcgpkoCqd_fUnE114mSmiagWkbQ5sqAVV3ov-VeqgrvMe5ZFEWLMSluvBAqdjHEdMIkHMlhlj4ENZbzBfo9Wxk8b8SnwP4kc4gGivedzFXo-dwN8fxjjq_ZZ9JFOj2ijIbj5FyogDCN0drOfi8RORSEuCEmPvjFRMFAwcmwFkN2NPp89amA", # The grant token.
|
|
1482
1531
|
# }
|
|
1483
1532
|
#
|
|
1533
|
+
# @example Example: To create a grant for a service principal
|
|
1534
|
+
#
|
|
1535
|
+
# # The following example creates a grant that allows the specified AWS service principal to encrypt and decrypt data with
|
|
1536
|
+
# # the specified KMS key. The grant includes a SourceArn constraint that restricts the grant permissions to requests
|
|
1537
|
+
# # associated with the specified DynamoDB table.
|
|
1538
|
+
#
|
|
1539
|
+
# resp = client.create_grant({
|
|
1540
|
+
# constraints: {
|
|
1541
|
+
# source_arn: "arn:aws:dynamodb:us-east-2:444455556666:table/ExampleTable",
|
|
1542
|
+
# }, # The SourceArn grant constraint restricts the grant permissions to requests associated with the specified AWS resource.
|
|
1543
|
+
# grantee_service_principal: "service-name.amazonaws.com", # The AWS service principal that is given permission to perform the operations specified in the grant.
|
|
1544
|
+
# key_id: "arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The identifier of the KMS key to which the grant applies. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
|
|
1545
|
+
# operations: [
|
|
1546
|
+
# "Encrypt",
|
|
1547
|
+
# "Decrypt",
|
|
1548
|
+
# "GenerateDataKey",
|
|
1549
|
+
# "DescribeKey",
|
|
1550
|
+
# ], # A list of operations that the grant allows.
|
|
1551
|
+
# retiring_service_principal: "service-name.amazonaws.com", # The AWS service principal that can retire the grant.
|
|
1552
|
+
# })
|
|
1553
|
+
#
|
|
1554
|
+
# resp.to_h outputs the following:
|
|
1555
|
+
# {
|
|
1556
|
+
# grant_id: "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2", # The unique identifier of the grant.
|
|
1557
|
+
# grant_token: "AQpAM2RhZTk1MGMyNTk2ZmZmMzEyYWVhOWViN2I1MWM4Mzc0MWFiYjc0ZDE1ODkyNGFlNTIzODZhMzgyZjBlNGY3NiKIAgEBAgB4Pa6VDCWW...", # The grant token.
|
|
1558
|
+
# }
|
|
1559
|
+
#
|
|
1484
1560
|
# @example Request syntax with placeholder values
|
|
1485
1561
|
#
|
|
1486
1562
|
# resp = client.create_grant({
|
|
1487
1563
|
# key_id: "KeyIdType", # required
|
|
1488
|
-
# grantee_principal: "PrincipalIdType",
|
|
1564
|
+
# grantee_principal: "PrincipalIdType",
|
|
1489
1565
|
# retiring_principal: "PrincipalIdType",
|
|
1490
1566
|
# operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, Sign, Verify, GetPublicKey, CreateGrant, RetireGrant, DescribeKey, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext, GenerateMac, VerifyMac, DeriveSharedSecret
|
|
1491
1567
|
# constraints: {
|
|
@@ -1495,10 +1571,13 @@ module Aws::KMS
|
|
|
1495
1571
|
# encryption_context_equals: {
|
|
1496
1572
|
# "EncryptionContextKey" => "EncryptionContextValue",
|
|
1497
1573
|
# },
|
|
1574
|
+
# source_arn: "GrantConstraintSourceArnType",
|
|
1498
1575
|
# },
|
|
1499
1576
|
# grant_tokens: ["GrantTokenType"],
|
|
1500
1577
|
# name: "GrantNameType",
|
|
1501
1578
|
# dry_run: false,
|
|
1579
|
+
# grantee_service_principal: "ServicePrincipalType",
|
|
1580
|
+
# retiring_service_principal: "ServicePrincipalType",
|
|
1502
1581
|
# })
|
|
1503
1582
|
#
|
|
1504
1583
|
# @example Response structure
|
|
@@ -1604,7 +1683,6 @@ module Aws::KMS
|
|
|
1604
1683
|
#
|
|
1605
1684
|
#
|
|
1606
1685
|
# Multi-Region primary keys
|
|
1607
|
-
# Imported key material
|
|
1608
1686
|
#
|
|
1609
1687
|
# : To create a multi-Region *primary key* in the local Amazon Web
|
|
1610
1688
|
# Services Region, use the `MultiRegion` parameter with a value of
|
|
@@ -1632,6 +1710,8 @@ module Aws::KMS
|
|
|
1632
1710
|
#
|
|
1633
1711
|
#
|
|
1634
1712
|
#
|
|
1713
|
+
# Imported key material
|
|
1714
|
+
#
|
|
1635
1715
|
# : To import your own key material into a KMS key, begin by creating a
|
|
1636
1716
|
# KMS key with no key material. To do this, use the `Origin` parameter
|
|
1637
1717
|
# of `CreateKey` with a value of `EXTERNAL`. Next, use
|
|
@@ -2559,11 +2639,13 @@ module Aws::KMS
|
|
|
2559
2639
|
# key state. For details, see [Key states of KMS keys][8] in the *Key
|
|
2560
2640
|
# Management Service Developer Guide*.
|
|
2561
2641
|
#
|
|
2562
|
-
# **Cross-account use**: Yes.
|
|
2563
|
-
#
|
|
2564
|
-
#
|
|
2642
|
+
# **Cross-account use**: Yes. To specify a KMS key in a different Amazon
|
|
2643
|
+
# Web Services account, use the [key ARN][9] or [alias ARN][10]. A short
|
|
2644
|
+
# [key ID][11] is also acceptable when decrypting symmetric ciphertexts,
|
|
2645
|
+
# though using a full key ARN is recommended to be more explicit about
|
|
2646
|
+
# the intended KMS key.
|
|
2565
2647
|
#
|
|
2566
|
-
# **Required permissions**: [kms:Decrypt][
|
|
2648
|
+
# **Required permissions**: [kms:Decrypt][12] (key policy)
|
|
2567
2649
|
#
|
|
2568
2650
|
# **Related operations:**
|
|
2569
2651
|
#
|
|
@@ -2576,7 +2658,7 @@ module Aws::KMS
|
|
|
2576
2658
|
# * ReEncrypt
|
|
2577
2659
|
#
|
|
2578
2660
|
# **Eventual consistency**: The KMS API follows an eventual consistency
|
|
2579
|
-
# model. For more information, see [KMS eventual consistency][
|
|
2661
|
+
# model. For more information, see [KMS eventual consistency][13].
|
|
2580
2662
|
#
|
|
2581
2663
|
#
|
|
2582
2664
|
#
|
|
@@ -2588,12 +2670,18 @@ module Aws::KMS
|
|
|
2588
2670
|
# [6]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk
|
|
2589
2671
|
# [7]: https://docs.aws.amazon.com/kms/latest/developerguide/cryptographic-attestation.html
|
|
2590
2672
|
# [8]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
|
|
2591
|
-
# [9]: https://docs.aws.amazon.com/kms/latest/developerguide/
|
|
2592
|
-
# [10]: https://docs.aws.amazon.com/kms/latest/developerguide/
|
|
2673
|
+
# [9]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN
|
|
2674
|
+
# [10]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-alias-ARN
|
|
2675
|
+
# [11]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id
|
|
2676
|
+
# [12]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
|
|
2677
|
+
# [13]: https://docs.aws.amazon.com/kms/latest/developerguide/accessing-kms.html#programming-eventual-consistency
|
|
2593
2678
|
#
|
|
2594
|
-
# @option params [
|
|
2679
|
+
# @option params [String, StringIO, File] :ciphertext_blob
|
|
2595
2680
|
# Ciphertext to be decrypted. The blob includes metadata.
|
|
2596
2681
|
#
|
|
2682
|
+
# This parameter is required in all cases except when `DryRun` is `true`
|
|
2683
|
+
# and `DryRunModifiers` is set to `IGNORE_CIPHERTEXT`.
|
|
2684
|
+
#
|
|
2597
2685
|
# @option params [Hash<String,String>] :encryption_context
|
|
2598
2686
|
# Specifies the encryption context to use when decrypting the data. An
|
|
2599
2687
|
# encryption context is valid only for [cryptographic operations][1]
|
|
@@ -2638,15 +2726,16 @@ module Aws::KMS
|
|
|
2638
2726
|
# `IncorrectKeyException`.
|
|
2639
2727
|
#
|
|
2640
2728
|
# This parameter is required only when the ciphertext was encrypted
|
|
2641
|
-
# under an asymmetric KMS key
|
|
2642
|
-
#
|
|
2643
|
-
# symmetric
|
|
2644
|
-
#
|
|
2645
|
-
#
|
|
2729
|
+
# under an asymmetric KMS key or when `DryRun` is `true` and
|
|
2730
|
+
# `DryRunModifiers` is set to `IGNORE_CIPHERTEXT`. If you used a
|
|
2731
|
+
# symmetric encryption KMS key, KMS can get the KMS key from metadata
|
|
2732
|
+
# that it adds to the symmetric ciphertext blob. However, it is always
|
|
2733
|
+
# recommended as a best practice. This practice ensures that you use the
|
|
2734
|
+
# KMS key that you intend.
|
|
2646
2735
|
#
|
|
2647
2736
|
# To specify a KMS key, use its key ID, key ARN, alias name, or alias
|
|
2648
2737
|
# ARN. When using an alias name, prefix it with `"alias/"`. To specify a
|
|
2649
|
-
# KMS key in a different Amazon Web Services account, you
|
|
2738
|
+
# KMS key in a different Amazon Web Services account, you should use the
|
|
2650
2739
|
# key ARN or alias ARN.
|
|
2651
2740
|
#
|
|
2652
2741
|
# For example:
|
|
@@ -2714,6 +2803,22 @@ module Aws::KMS
|
|
|
2714
2803
|
#
|
|
2715
2804
|
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/testing-permissions.html
|
|
2716
2805
|
#
|
|
2806
|
+
# @option params [Array<String>] :dry_run_modifiers
|
|
2807
|
+
# Specifies the modifiers to apply to the dry run operation.
|
|
2808
|
+
# `DryRunModifiers` is an optional parameter that only applies when
|
|
2809
|
+
# `DryRun` is set to `true`.
|
|
2810
|
+
#
|
|
2811
|
+
# When set to `IGNORE_CIPHERTEXT`, KMS performs only authorization
|
|
2812
|
+
# validation without ciphertext validation. This allows you to test
|
|
2813
|
+
# permissions without requiring a valid ciphertext blob.
|
|
2814
|
+
#
|
|
2815
|
+
# To learn more about how to use this parameter, see [Testing your
|
|
2816
|
+
# permissions][1] in the *Key Management Service Developer Guide*.
|
|
2817
|
+
#
|
|
2818
|
+
#
|
|
2819
|
+
#
|
|
2820
|
+
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/testing-permissions.html
|
|
2821
|
+
#
|
|
2717
2822
|
# @return [Types::DecryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
2718
2823
|
#
|
|
2719
2824
|
# * {Types::DecryptResponse#key_id #key_id} => String
|
|
@@ -2784,7 +2889,7 @@ module Aws::KMS
|
|
|
2784
2889
|
# @example Request syntax with placeholder values
|
|
2785
2890
|
#
|
|
2786
2891
|
# resp = client.decrypt({
|
|
2787
|
-
# ciphertext_blob: "data",
|
|
2892
|
+
# ciphertext_blob: "data",
|
|
2788
2893
|
# encryption_context: {
|
|
2789
2894
|
# "EncryptionContextKey" => "EncryptionContextValue",
|
|
2790
2895
|
# },
|
|
@@ -2796,6 +2901,7 @@ module Aws::KMS
|
|
|
2796
2901
|
# attestation_document: "data",
|
|
2797
2902
|
# },
|
|
2798
2903
|
# dry_run: false,
|
|
2904
|
+
# dry_run_modifiers: ["IGNORE_CIPHERTEXT"], # accepts IGNORE_CIPHERTEXT
|
|
2799
2905
|
# })
|
|
2800
2906
|
#
|
|
2801
2907
|
# @example Response structure
|
|
@@ -6130,6 +6236,143 @@ module Aws::KMS
|
|
|
6130
6236
|
req.send_request(options)
|
|
6131
6237
|
end
|
|
6132
6238
|
|
|
6239
|
+
# Returns usage information about the last successful cryptographic
|
|
6240
|
+
# operation performed with a specified KMS key, including the operation
|
|
6241
|
+
# type, timestamp, and associated CloudTrail event ID.
|
|
6242
|
+
#
|
|
6243
|
+
# The `TrackingStartDate` in the `GetKeyLastUsage` response indicates
|
|
6244
|
+
# the date from which KMS began recording cryptographic activity for a
|
|
6245
|
+
# given key. Use this value together with `KeyCreationDate` to
|
|
6246
|
+
# understand the key's usage history:
|
|
6247
|
+
#
|
|
6248
|
+
# * If the `KeyLastUsage` response element is *present*, the key has
|
|
6249
|
+
# been used for a successful cryptographic operation since the
|
|
6250
|
+
# `TrackingStartDate`. The response includes the operation type,
|
|
6251
|
+
# timestamp, and associated CloudTrail event ID.
|
|
6252
|
+
#
|
|
6253
|
+
# * If the `KeyLastUsage` response element is *empty* and
|
|
6254
|
+
# `KeyCreationDate` is on or after `TrackingStartDate`, the key has
|
|
6255
|
+
# not been used for a successful cryptographic operation since it was
|
|
6256
|
+
# created.
|
|
6257
|
+
#
|
|
6258
|
+
# * If the `KeyLastUsage` response element is *empty* and
|
|
6259
|
+
# `KeyCreationDate` is before `TrackingStartDate`, there is no record
|
|
6260
|
+
# of the key being used for a successful cryptographic operation since
|
|
6261
|
+
# the `TrackingStartDate`. However, the key may have been used before
|
|
6262
|
+
# tracking began. To determine whether the key was used before the
|
|
6263
|
+
# `TrackingStartDate`, examine your past CloudTrail logs.
|
|
6264
|
+
#
|
|
6265
|
+
# For multi-Region KMS keys, primary and replica keys track last usage
|
|
6266
|
+
# independently. Each key in a multi-Region key set maintains its own
|
|
6267
|
+
# usage information.
|
|
6268
|
+
#
|
|
6269
|
+
# The `ReEncrypt` operation uses two keys: a source key for decryption
|
|
6270
|
+
# and a destination key for encryption. Usage information is recorded
|
|
6271
|
+
# for both keys independently, each with the CloudTrail event ID from
|
|
6272
|
+
# the respective key owner's account.
|
|
6273
|
+
#
|
|
6274
|
+
# <note markdown="1"> Do not use `GetKeyLastUsage` as the sole indicator when scheduling a
|
|
6275
|
+
# key for deletion. Instead, first [disable the key][1] and monitor
|
|
6276
|
+
# CloudTrail for `DisabledException` entries, as there could be
|
|
6277
|
+
# infrequent workflows that are dependent on the key. By looking for
|
|
6278
|
+
# this exception, you can identify potential dependencies and workload
|
|
6279
|
+
# failures before they occur.
|
|
6280
|
+
#
|
|
6281
|
+
# </note>
|
|
6282
|
+
#
|
|
6283
|
+
# **Cross-account use**: No. You cannot perform this operation on a KMS
|
|
6284
|
+
# key in a different Amazon Web Services account.
|
|
6285
|
+
#
|
|
6286
|
+
# **Required permissions**: [kms:GetKeyLastUsage][2] (key policy)
|
|
6287
|
+
#
|
|
6288
|
+
# **Related operations:**
|
|
6289
|
+
#
|
|
6290
|
+
# * DescribeKey
|
|
6291
|
+
#
|
|
6292
|
+
# * DisableKey
|
|
6293
|
+
#
|
|
6294
|
+
# * ScheduleKeyDeletion
|
|
6295
|
+
#
|
|
6296
|
+
# **Eventual consistency**: The KMS API follows an eventual consistency
|
|
6297
|
+
# model. For more information, see [KMS eventual consistency][3].
|
|
6298
|
+
#
|
|
6299
|
+
#
|
|
6300
|
+
#
|
|
6301
|
+
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/enabling-keys.html
|
|
6302
|
+
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
|
|
6303
|
+
# [3]: https://docs.aws.amazon.com/kms/latest/developerguide/accessing-kms.html#programming-eventual-consistency
|
|
6304
|
+
#
|
|
6305
|
+
# @option params [required, String] :key_id
|
|
6306
|
+
# Identifies the KMS key to get usage information for. To specify a KMS
|
|
6307
|
+
# key, use its key ID or key ARN. Alias names are not supported.
|
|
6308
|
+
#
|
|
6309
|
+
# Specify the key ID or key ARN of the KMS key.
|
|
6310
|
+
#
|
|
6311
|
+
# For example:
|
|
6312
|
+
#
|
|
6313
|
+
# * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
|
|
6314
|
+
#
|
|
6315
|
+
# * Key ARN:
|
|
6316
|
+
# `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
|
|
6317
|
+
#
|
|
6318
|
+
# To get the key ID and key ARN for a KMS key, use ListKeys or
|
|
6319
|
+
# DescribeKey.
|
|
6320
|
+
#
|
|
6321
|
+
# @return [Types::GetKeyLastUsageResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
6322
|
+
#
|
|
6323
|
+
# * {Types::GetKeyLastUsageResponse#key_id #key_id} => String
|
|
6324
|
+
# * {Types::GetKeyLastUsageResponse#key_last_usage #key_last_usage} => Types::KeyLastUsageData
|
|
6325
|
+
# * {Types::GetKeyLastUsageResponse#tracking_start_date #tracking_start_date} => Time
|
|
6326
|
+
# * {Types::GetKeyLastUsageResponse#key_creation_date #key_creation_date} => Time
|
|
6327
|
+
#
|
|
6328
|
+
#
|
|
6329
|
+
# @example Example: To retrieve the last usage for a KMS key
|
|
6330
|
+
#
|
|
6331
|
+
# # The following example retrieves usage information about the last successful cryptographic operation performed with the
|
|
6332
|
+
# # specified KMS key, including the operation type, timestamp, and associated AWS CloudTrail event ID.
|
|
6333
|
+
#
|
|
6334
|
+
# resp = client.get_key_last_usage({
|
|
6335
|
+
# key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The identifier of the KMS key to get usage information for. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key. Alias names are not supported.
|
|
6336
|
+
# })
|
|
6337
|
+
#
|
|
6338
|
+
# resp.to_h outputs the following:
|
|
6339
|
+
# {
|
|
6340
|
+
# key_creation_date: Time.parse(1773253425.56), # The date and time when the KMS key was created.
|
|
6341
|
+
# key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The globally unique identifier for the KMS key.
|
|
6342
|
+
# key_last_usage: {
|
|
6343
|
+
# cloud_trail_event_id: "2cfd5892-ea8c-4342-ad49-4b9594b06a8b",
|
|
6344
|
+
# kms_request_id: "040cce3e-9ef3-4651-b8cf-e47c9bafdc9b",
|
|
6345
|
+
# operation: "Encrypt",
|
|
6346
|
+
# timestamp: Time.parse(1773253497.0),
|
|
6347
|
+
# }, # Contains usage information about the last time the KMS key was used for a successful cryptographic operation.
|
|
6348
|
+
# tracking_start_date: Time.parse(1773253425.56), # The date from which AWS KMS began recording cryptographic activity for this key, or the date the KMS key was created, whichever is later.
|
|
6349
|
+
# }
|
|
6350
|
+
#
|
|
6351
|
+
# @example Request syntax with placeholder values
|
|
6352
|
+
#
|
|
6353
|
+
# resp = client.get_key_last_usage({
|
|
6354
|
+
# key_id: "KeyIdType", # required
|
|
6355
|
+
# })
|
|
6356
|
+
#
|
|
6357
|
+
# @example Response structure
|
|
6358
|
+
#
|
|
6359
|
+
# resp.key_id #=> String
|
|
6360
|
+
# resp.key_last_usage.operation #=> String, one of "Decrypt", "DeriveSharedSecret", "Encrypt", "GenerateDataKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateDataKeyWithoutPlaintext", "GenerateMac", "ReEncrypt", "Sign", "Verify", "VerifyMac"
|
|
6361
|
+
# resp.key_last_usage.timestamp #=> Time
|
|
6362
|
+
# resp.key_last_usage.cloud_trail_event_id #=> String
|
|
6363
|
+
# resp.key_last_usage.kms_request_id #=> String
|
|
6364
|
+
# resp.tracking_start_date #=> Time
|
|
6365
|
+
# resp.key_creation_date #=> Time
|
|
6366
|
+
#
|
|
6367
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyLastUsage AWS API Documentation
|
|
6368
|
+
#
|
|
6369
|
+
# @overload get_key_last_usage(params = {})
|
|
6370
|
+
# @param [Hash] params ({})
|
|
6371
|
+
def get_key_last_usage(params = {}, options = {})
|
|
6372
|
+
req = build_request(:get_key_last_usage, params)
|
|
6373
|
+
req.send_request(options)
|
|
6374
|
+
end
|
|
6375
|
+
|
|
6133
6376
|
# Gets a key policy attached to the specified KMS key.
|
|
6134
6377
|
#
|
|
6135
6378
|
# **Cross-account use**: No. You cannot perform this operation on a KMS
|
|
@@ -7292,7 +7535,7 @@ module Aws::KMS
|
|
|
7292
7535
|
# Gets a list of all grants for the specified KMS key.
|
|
7293
7536
|
#
|
|
7294
7537
|
# You must specify the KMS key in all requests. You can filter the grant
|
|
7295
|
-
# list by grant ID or grantee principal.
|
|
7538
|
+
# list by grant ID, grantee principal, or grantee service principal.
|
|
7296
7539
|
#
|
|
7297
7540
|
# For detailed information about grants, including grant terminology,
|
|
7298
7541
|
# see [Grants in KMS][1] in the <i> <i>Key Management Service Developer
|
|
@@ -7300,12 +7543,18 @@ module Aws::KMS
|
|
|
7300
7543
|
# languages, see [Use CreateGrant with an Amazon Web Services SDK or
|
|
7301
7544
|
# CLI][2].
|
|
7302
7545
|
#
|
|
7303
|
-
# <note markdown="1">
|
|
7304
|
-
# contains the user or role designated as
|
|
7305
|
-
#
|
|
7306
|
-
# Web Services service, the `GranteePrincipal` field
|
|
7307
|
-
# [service principal][3], which might
|
|
7308
|
-
# grantee principals
|
|
7546
|
+
# <note markdown="1"> When a grant is created with the `GranteePrincipal` field, the
|
|
7547
|
+
# `ListGrants` response usually contains the user or role designated as
|
|
7548
|
+
# the grantee principal in the grant. However, if the grantee principal
|
|
7549
|
+
# is an Amazon Web Services service, the `GranteePrincipal` field
|
|
7550
|
+
# contains an Amazon Web Services [service principal][3], which might
|
|
7551
|
+
# correspond to several different grantee principals, such as an IAM
|
|
7552
|
+
# user, IAM role, or Amazon Web Services account.
|
|
7553
|
+
#
|
|
7554
|
+
# When a grant is created with the `GranteeServicePrincipal` field, the
|
|
7555
|
+
# `ListGrants` response always includes a `GranteeServicePrincipal` that
|
|
7556
|
+
# indicates the grantee is actually an Amazon Web Services [service
|
|
7557
|
+
# principal][3].
|
|
7309
7558
|
#
|
|
7310
7559
|
# </note>
|
|
7311
7560
|
#
|
|
@@ -7374,6 +7623,17 @@ module Aws::KMS
|
|
|
7374
7623
|
# Returns only grants where the specified principal is the grantee
|
|
7375
7624
|
# principal for the grant.
|
|
7376
7625
|
#
|
|
7626
|
+
# You can specify either `GranteePrincipal` or
|
|
7627
|
+
# `GranteeServicePrincipal`, but not both.
|
|
7628
|
+
#
|
|
7629
|
+
# @option params [String] :grantee_service_principal
|
|
7630
|
+
# Returns only grants where the specified Amazon Web Services service
|
|
7631
|
+
# principal is the grantee service principal for the grant. This filter
|
|
7632
|
+
# is only usable by callers in a service principal.
|
|
7633
|
+
#
|
|
7634
|
+
# You can specify either `GranteePrincipal` or
|
|
7635
|
+
# `GranteeServicePrincipal`, but not both.
|
|
7636
|
+
#
|
|
7377
7637
|
# @return [Types::ListGrantsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
7378
7638
|
#
|
|
7379
7639
|
# * {Types::ListGrantsResponse#grants #grants} => Array<Types::GrantListEntry>
|
|
@@ -7449,6 +7709,40 @@ module Aws::KMS
|
|
|
7449
7709
|
# truncated: true, # A boolean that indicates whether there are more items in the list. Returns true when there are more items, or false when there are not.
|
|
7450
7710
|
# }
|
|
7451
7711
|
#
|
|
7712
|
+
# @example Example: To list grants for a grantee service principal
|
|
7713
|
+
#
|
|
7714
|
+
# # The following example lists grants for the specified KMS key that were created with a GranteeServicePrincipal. The
|
|
7715
|
+
# # response includes the GranteeServicePrincipal, RetiringServicePrincipal, and SourceArn constraint fields.
|
|
7716
|
+
#
|
|
7717
|
+
# resp = client.list_grants({
|
|
7718
|
+
# grantee_service_principal: "service-name.amazonaws.com", # Returns only grants where the specified AWS service principal is the grantee service principal.
|
|
7719
|
+
# key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The identifier of the KMS key whose grants you want to list. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
|
|
7720
|
+
# })
|
|
7721
|
+
#
|
|
7722
|
+
# resp.to_h outputs the following:
|
|
7723
|
+
# {
|
|
7724
|
+
# grants: [
|
|
7725
|
+
# {
|
|
7726
|
+
# constraints: {
|
|
7727
|
+
# source_arn: "arn:aws:dynamodb:us-east-2:111122223333:table/ExampleTable",
|
|
7728
|
+
# },
|
|
7729
|
+
# creation_date: Time.parse("2026-03-06T10:15:00-08:00"),
|
|
7730
|
+
# grant_id: "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
|
|
7731
|
+
# grantee_service_principal: "service-name.amazonaws.com",
|
|
7732
|
+
# issuing_account: "arn:aws:iam::111122223333:root",
|
|
7733
|
+
# key_id: "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
|
|
7734
|
+
# operations: [
|
|
7735
|
+
# "Encrypt",
|
|
7736
|
+
# "Decrypt",
|
|
7737
|
+
# "GenerateDataKey",
|
|
7738
|
+
# "DescribeKey",
|
|
7739
|
+
# ],
|
|
7740
|
+
# retiring_service_principal: "service-name.amazonaws.com",
|
|
7741
|
+
# },
|
|
7742
|
+
# ], # A list of grants.
|
|
7743
|
+
# truncated: false, # A boolean that indicates whether there are more items in the list. Returns true when there are more items, or false when there are not.
|
|
7744
|
+
# }
|
|
7745
|
+
#
|
|
7452
7746
|
# @example Request syntax with placeholder values
|
|
7453
7747
|
#
|
|
7454
7748
|
# resp = client.list_grants({
|
|
@@ -7457,6 +7751,7 @@ module Aws::KMS
|
|
|
7457
7751
|
# key_id: "KeyIdType", # required
|
|
7458
7752
|
# grant_id: "GrantIdType",
|
|
7459
7753
|
# grantee_principal: "PrincipalIdType",
|
|
7754
|
+
# grantee_service_principal: "ServicePrincipalType",
|
|
7460
7755
|
# })
|
|
7461
7756
|
#
|
|
7462
7757
|
# @example Response structure
|
|
@@ -7475,6 +7770,9 @@ module Aws::KMS
|
|
|
7475
7770
|
# resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
|
|
7476
7771
|
# resp.grants[0].constraints.encryption_context_equals #=> Hash
|
|
7477
7772
|
# resp.grants[0].constraints.encryption_context_equals["EncryptionContextKey"] #=> String
|
|
7773
|
+
# resp.grants[0].constraints.source_arn #=> String
|
|
7774
|
+
# resp.grants[0].grantee_service_principal #=> String
|
|
7775
|
+
# resp.grants[0].retiring_service_principal #=> String
|
|
7478
7776
|
# resp.next_marker #=> String
|
|
7479
7777
|
# resp.truncated #=> Boolean
|
|
7480
7778
|
#
|
|
@@ -7977,7 +8275,8 @@ module Aws::KMS
|
|
|
7977
8275
|
end
|
|
7978
8276
|
|
|
7979
8277
|
# Returns information about all grants in the Amazon Web Services
|
|
7980
|
-
# account and Region that have the specified retiring principal
|
|
8278
|
+
# account and Region that have the specified retiring principal or
|
|
8279
|
+
# retiring service principal.
|
|
7981
8280
|
#
|
|
7982
8281
|
# You can specify any principal in your Amazon Web Services account. The
|
|
7983
8282
|
# grants that are returned include grants for KMS keys in your Amazon
|
|
@@ -8002,12 +8301,16 @@ module Aws::KMS
|
|
|
8002
8301
|
# **Required permissions**: [kms:ListRetirableGrants][3] (IAM policy) in
|
|
8003
8302
|
# your Amazon Web Services account.
|
|
8004
8303
|
#
|
|
8005
|
-
# <note markdown="1">
|
|
8006
|
-
#
|
|
8007
|
-
#
|
|
8008
|
-
#
|
|
8009
|
-
#
|
|
8010
|
-
# might be returned by the
|
|
8304
|
+
# <note markdown="1"> When listing retirable grants by `RetiringPrincipal`, KMS authorizes
|
|
8305
|
+
# `ListRetirableGrants` requests by evaluating the caller account's
|
|
8306
|
+
# kms:ListRetirableGrants permissions. The authorized resource in
|
|
8307
|
+
# `ListRetirableGrants` calls is the retiring principal specified in the
|
|
8308
|
+
# request. KMS does not evaluate the caller's permissions to verify
|
|
8309
|
+
# their access to any KMS keys or grants that might be returned by the
|
|
8310
|
+
# `ListRetirableGrants` call.
|
|
8311
|
+
#
|
|
8312
|
+
# The `RetiringServicePrincipal` filter is only usable by callers in a
|
|
8313
|
+
# service principal.
|
|
8011
8314
|
#
|
|
8012
8315
|
# </note>
|
|
8013
8316
|
#
|
|
@@ -8044,7 +8347,7 @@ module Aws::KMS
|
|
|
8044
8347
|
# response with truncated results. Set it to the value of `NextMarker`
|
|
8045
8348
|
# from the truncated response you just received.
|
|
8046
8349
|
#
|
|
8047
|
-
# @option params [
|
|
8350
|
+
# @option params [String] :retiring_principal
|
|
8048
8351
|
# The retiring principal for which to list grants. Enter a principal in
|
|
8049
8352
|
# your Amazon Web Services account.
|
|
8050
8353
|
#
|
|
@@ -8055,11 +8358,21 @@ module Aws::KMS
|
|
|
8055
8358
|
# principal, see [IAM ARNs][2] in the <i> <i>Identity and Access
|
|
8056
8359
|
# Management User Guide</i> </i>.
|
|
8057
8360
|
#
|
|
8361
|
+
# You must specify either `RetiringPrincipal` or
|
|
8362
|
+
# `RetiringServicePrincipal`, but not both.
|
|
8363
|
+
#
|
|
8058
8364
|
#
|
|
8059
8365
|
#
|
|
8060
8366
|
# [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
|
8061
8367
|
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns
|
|
8062
8368
|
#
|
|
8369
|
+
# @option params [String] :retiring_service_principal
|
|
8370
|
+
# The retiring service principal for which to list grants. This filter
|
|
8371
|
+
# is only usable by callers in a service principal.
|
|
8372
|
+
#
|
|
8373
|
+
# You must specify either `RetiringPrincipal` or
|
|
8374
|
+
# `RetiringServicePrincipal`, but not both.
|
|
8375
|
+
#
|
|
8063
8376
|
# @return [Types::ListGrantsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
8064
8377
|
#
|
|
8065
8378
|
# * {Types::ListGrantsResponse#grants #grants} => Array<Types::GrantListEntry>
|
|
@@ -8096,12 +8409,45 @@ module Aws::KMS
|
|
|
8096
8409
|
# truncated: false, # A boolean that indicates whether there are more items in the list. Returns true when there are more items, or false when there are not.
|
|
8097
8410
|
# }
|
|
8098
8411
|
#
|
|
8412
|
+
# @example Example: To list grants that the specified service principal can retire
|
|
8413
|
+
#
|
|
8414
|
+
# # The following example lists the grants that the specified AWS service principal can retire.
|
|
8415
|
+
#
|
|
8416
|
+
# resp = client.list_retirable_grants({
|
|
8417
|
+
# retiring_service_principal: "service-name.amazonaws.com", # The retiring service principal whose grants you want to list. Use the AWS service principal name of the service (for example, service-name.amazonaws.com).
|
|
8418
|
+
# })
|
|
8419
|
+
#
|
|
8420
|
+
# resp.to_h outputs the following:
|
|
8421
|
+
# {
|
|
8422
|
+
# grants: [
|
|
8423
|
+
# {
|
|
8424
|
+
# constraints: {
|
|
8425
|
+
# source_arn: "arn:aws:dynamodb:us-east-2:444455556666:table/ExampleTable",
|
|
8426
|
+
# },
|
|
8427
|
+
# creation_date: Time.parse("2026-03-06T10:15:00-08:00"),
|
|
8428
|
+
# grant_id: "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
|
|
8429
|
+
# grantee_service_principal: "service-name.amazonaws.com",
|
|
8430
|
+
# issuing_account: "arn:aws:iam::444455556666:root",
|
|
8431
|
+
# key_id: "arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab",
|
|
8432
|
+
# operations: [
|
|
8433
|
+
# "Encrypt",
|
|
8434
|
+
# "Decrypt",
|
|
8435
|
+
# "GenerateDataKey",
|
|
8436
|
+
# "DescribeKey",
|
|
8437
|
+
# ],
|
|
8438
|
+
# retiring_service_principal: "service-name.amazonaws.com",
|
|
8439
|
+
# },
|
|
8440
|
+
# ], # A list of grants that the specified service principal can retire.
|
|
8441
|
+
# truncated: false, # A boolean that indicates whether there are more items in the list. Returns true when there are more items, or false when there are not.
|
|
8442
|
+
# }
|
|
8443
|
+
#
|
|
8099
8444
|
# @example Request syntax with placeholder values
|
|
8100
8445
|
#
|
|
8101
8446
|
# resp = client.list_retirable_grants({
|
|
8102
8447
|
# limit: 1,
|
|
8103
8448
|
# marker: "MarkerType",
|
|
8104
|
-
# retiring_principal: "PrincipalIdType",
|
|
8449
|
+
# retiring_principal: "PrincipalIdType",
|
|
8450
|
+
# retiring_service_principal: "ServicePrincipalType",
|
|
8105
8451
|
# })
|
|
8106
8452
|
#
|
|
8107
8453
|
# @example Response structure
|
|
@@ -8120,6 +8466,9 @@ module Aws::KMS
|
|
|
8120
8466
|
# resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
|
|
8121
8467
|
# resp.grants[0].constraints.encryption_context_equals #=> Hash
|
|
8122
8468
|
# resp.grants[0].constraints.encryption_context_equals["EncryptionContextKey"] #=> String
|
|
8469
|
+
# resp.grants[0].constraints.source_arn #=> String
|
|
8470
|
+
# resp.grants[0].grantee_service_principal #=> String
|
|
8471
|
+
# resp.grants[0].retiring_service_principal #=> String
|
|
8123
8472
|
# resp.next_marker #=> String
|
|
8124
8473
|
# resp.truncated #=> Boolean
|
|
8125
8474
|
#
|
|
@@ -8354,24 +8703,35 @@ module Aws::KMS
|
|
|
8354
8703
|
# key state. For details, see [Key states of KMS keys][6] in the *Key
|
|
8355
8704
|
# Management Service Developer Guide*.
|
|
8356
8705
|
#
|
|
8706
|
+
# <note markdown="1"> When using grants with `SourceArn` constraints for `ReEncrypt`
|
|
8707
|
+
# operations, the grants on both the source KMS key (for
|
|
8708
|
+
# `ReEncryptFrom`) and the destination KMS key (for `ReEncryptTo`) must
|
|
8709
|
+
# specify the same `SourceArn` value.
|
|
8710
|
+
#
|
|
8711
|
+
# </note>
|
|
8712
|
+
#
|
|
8357
8713
|
# **Cross-account use**: Yes. The source KMS key and destination KMS key
|
|
8358
8714
|
# can be in different Amazon Web Services accounts. Either or both KMS
|
|
8359
8715
|
# keys can be in a different account than the caller. To specify a KMS
|
|
8360
|
-
# key in a different account,
|
|
8716
|
+
# key in a different account, use the [key ARN][7] or [alias ARN][8]. A
|
|
8717
|
+
# short [key ID][9] is also acceptable for the source key when
|
|
8718
|
+
# decrypting symmetric ciphertexts, though using a full key ARN is
|
|
8719
|
+
# recommended to be more explicit about the intended KMS key.
|
|
8361
8720
|
#
|
|
8362
8721
|
# **Required permissions**:
|
|
8363
8722
|
#
|
|
8364
|
-
# * [kms:ReEncryptFrom][
|
|
8723
|
+
# * [kms:ReEncryptFrom][10] permission on the source KMS key (key
|
|
8724
|
+
# policy)
|
|
8365
8725
|
#
|
|
8366
|
-
# * [kms:ReEncryptTo][
|
|
8726
|
+
# * [kms:ReEncryptTo][10] permission on the destination KMS key (key
|
|
8367
8727
|
# policy)
|
|
8368
8728
|
#
|
|
8369
8729
|
# To permit reencryption from or to a KMS key, include the
|
|
8370
|
-
# `"kms:ReEncrypt*"` permission in your [key policy][
|
|
8371
|
-
# is automatically included in the key policy when you use
|
|
8372
|
-
# to create a KMS key. But you must include it manually when
|
|
8373
|
-
# a KMS key programmatically or when you use the PutKeyPolicy
|
|
8374
|
-
# to set a key policy.
|
|
8730
|
+
# `"kms:ReEncrypt*"` permission in your [key policy][11]. This
|
|
8731
|
+
# permission is automatically included in the key policy when you use
|
|
8732
|
+
# the console to create a KMS key. But you must include it manually when
|
|
8733
|
+
# you create a KMS key programmatically or when you use the PutKeyPolicy
|
|
8734
|
+
# operation to set a key policy.
|
|
8375
8735
|
#
|
|
8376
8736
|
# **Related operations:**
|
|
8377
8737
|
#
|
|
@@ -8384,7 +8744,7 @@ module Aws::KMS
|
|
|
8384
8744
|
# * GenerateDataKeyPair
|
|
8385
8745
|
#
|
|
8386
8746
|
# **Eventual consistency**: The KMS API follows an eventual consistency
|
|
8387
|
-
# model. For more information, see [KMS eventual consistency][
|
|
8747
|
+
# model. For more information, see [KMS eventual consistency][12].
|
|
8388
8748
|
#
|
|
8389
8749
|
#
|
|
8390
8750
|
#
|
|
@@ -8394,13 +8754,19 @@ module Aws::KMS
|
|
|
8394
8754
|
# [4]: https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/
|
|
8395
8755
|
# [5]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html
|
|
8396
8756
|
# [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
|
|
8397
|
-
# [7]: https://docs.aws.amazon.com/kms/latest/developerguide/
|
|
8398
|
-
# [8]: https://docs.aws.amazon.com/kms/latest/developerguide/key-
|
|
8399
|
-
# [9]: https://docs.aws.amazon.com/kms/latest/developerguide/
|
|
8757
|
+
# [7]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN
|
|
8758
|
+
# [8]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-alias-ARN
|
|
8759
|
+
# [9]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id
|
|
8760
|
+
# [10]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
|
|
8761
|
+
# [11]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html
|
|
8762
|
+
# [12]: https://docs.aws.amazon.com/kms/latest/developerguide/accessing-kms.html#programming-eventual-consistency
|
|
8400
8763
|
#
|
|
8401
|
-
# @option params [
|
|
8764
|
+
# @option params [String, StringIO, File] :ciphertext_blob
|
|
8402
8765
|
# Ciphertext of the data to reencrypt.
|
|
8403
8766
|
#
|
|
8767
|
+
# This parameter is required in all cases except when `DryRun` is `true`
|
|
8768
|
+
# and `DryRunModifiers` is set to `IGNORE_CIPHERTEXT`.
|
|
8769
|
+
#
|
|
8404
8770
|
# @option params [Hash<String,String>] :source_encryption_context
|
|
8405
8771
|
# Specifies the encryption context to use to decrypt the ciphertext.
|
|
8406
8772
|
# Enter the same encryption context that was used to encrypt the
|
|
@@ -8430,15 +8796,16 @@ module Aws::KMS
|
|
|
8430
8796
|
# an `IncorrectKeyException`.
|
|
8431
8797
|
#
|
|
8432
8798
|
# This parameter is required only when the ciphertext was encrypted
|
|
8433
|
-
# under an asymmetric KMS key
|
|
8434
|
-
#
|
|
8435
|
-
# symmetric
|
|
8436
|
-
#
|
|
8437
|
-
#
|
|
8799
|
+
# under an asymmetric KMS key or when `DryRun` is `true` and
|
|
8800
|
+
# `DryRunModifiers` is set to `IGNORE_CIPHERTEXT`. If you used a
|
|
8801
|
+
# symmetric encryption KMS key, KMS can get the KMS key from metadata
|
|
8802
|
+
# that it adds to the symmetric ciphertext blob. However, it is always
|
|
8803
|
+
# recommended as a best practice. This practice ensures that you use the
|
|
8804
|
+
# KMS key that you intend.
|
|
8438
8805
|
#
|
|
8439
8806
|
# To specify a KMS key, use its key ID, key ARN, alias name, or alias
|
|
8440
8807
|
# ARN. When using an alias name, prefix it with `"alias/"`. To specify a
|
|
8441
|
-
# KMS key in a different Amazon Web Services account, you
|
|
8808
|
+
# KMS key in a different Amazon Web Services account, you should use the
|
|
8442
8809
|
# key ARN or alias ARN.
|
|
8443
8810
|
#
|
|
8444
8811
|
# For example:
|
|
@@ -8552,6 +8919,22 @@ module Aws::KMS
|
|
|
8552
8919
|
#
|
|
8553
8920
|
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/testing-permissions.html
|
|
8554
8921
|
#
|
|
8922
|
+
# @option params [Array<String>] :dry_run_modifiers
|
|
8923
|
+
# Specifies the modifiers to apply to the dry run operation.
|
|
8924
|
+
# `DryRunModifiers` is an optional parameter that only applies when
|
|
8925
|
+
# `DryRun` is set to `true`.
|
|
8926
|
+
#
|
|
8927
|
+
# When set to `IGNORE_CIPHERTEXT`, KMS performs only authorization
|
|
8928
|
+
# validation without ciphertext validation. This allows you to test
|
|
8929
|
+
# permissions without requiring a valid ciphertext blob.
|
|
8930
|
+
#
|
|
8931
|
+
# To learn more about how to use this parameter, see [Testing your
|
|
8932
|
+
# permissions][1] in the *Key Management Service Developer Guide*.
|
|
8933
|
+
#
|
|
8934
|
+
#
|
|
8935
|
+
#
|
|
8936
|
+
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/testing-permissions.html
|
|
8937
|
+
#
|
|
8555
8938
|
# @return [Types::ReEncryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
|
8556
8939
|
#
|
|
8557
8940
|
# * {Types::ReEncryptResponse#ciphertext_blob #ciphertext_blob} => String
|
|
@@ -8586,7 +8969,7 @@ module Aws::KMS
|
|
|
8586
8969
|
# @example Request syntax with placeholder values
|
|
8587
8970
|
#
|
|
8588
8971
|
# resp = client.re_encrypt({
|
|
8589
|
-
# ciphertext_blob: "data",
|
|
8972
|
+
# ciphertext_blob: "data",
|
|
8590
8973
|
# source_encryption_context: {
|
|
8591
8974
|
# "EncryptionContextKey" => "EncryptionContextValue",
|
|
8592
8975
|
# },
|
|
@@ -8599,6 +8982,7 @@ module Aws::KMS
|
|
|
8599
8982
|
# destination_encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256, SM2PKE
|
|
8600
8983
|
# grant_tokens: ["GrantTokenType"],
|
|
8601
8984
|
# dry_run: false,
|
|
8985
|
+
# dry_run_modifiers: ["IGNORE_CIPHERTEXT"], # accepts IGNORE_CIPHERTEXT
|
|
8602
8986
|
# })
|
|
8603
8987
|
#
|
|
8604
8988
|
# @example Response structure
|
|
@@ -9239,7 +9623,7 @@ module Aws::KMS
|
|
|
9239
9623
|
# automatically rotate, as scheduled, on April 14, 2024 and every 730
|
|
9240
9624
|
# days thereafter.
|
|
9241
9625
|
#
|
|
9242
|
-
# <note markdown="1"> You can perform on-demand key rotation a **maximum of
|
|
9626
|
+
# <note markdown="1"> You can perform on-demand key rotation a **maximum of 25 times** per
|
|
9243
9627
|
# KMS key. You can use the KMS console to view the number of remaining
|
|
9244
9628
|
# on-demand rotations available for a KMS key.
|
|
9245
9629
|
#
|
|
@@ -9656,6 +10040,11 @@ module Aws::KMS
|
|
|
9656
10040
|
# * ED25519\_PH\_SHA\_512 signing algorithm requires KMS
|
|
9657
10041
|
# `MessageType:DIGEST`
|
|
9658
10042
|
#
|
|
10043
|
+
# When you specify the ED25519\_PH\_SHA\_512 signing algorithm with
|
|
10044
|
+
# `MessageType:DIGEST`, KMS still performs the SHA-512 prehash described
|
|
10045
|
+
# in [Step 1 of Section 7.8.1 in FIPS 186-5][1]. This means the input is
|
|
10046
|
+
# hashed twice: once by you and once by KMS.
|
|
10047
|
+
#
|
|
9659
10048
|
# When the value of `MessageType` is `DIGEST`, the length of the
|
|
9660
10049
|
# `Message` value must match the length of hashed messages for the
|
|
9661
10050
|
# specified signing algorithm.
|
|
@@ -9684,11 +10073,12 @@ module Aws::KMS
|
|
|
9684
10073
|
# algorithm.
|
|
9685
10074
|
#
|
|
9686
10075
|
# * SM2DSA uses the SM3 hashing algorithm. For details, see [Offline
|
|
9687
|
-
# verification with SM2 key pairs][
|
|
10076
|
+
# verification with SM2 key pairs][2].
|
|
9688
10077
|
#
|
|
9689
10078
|
#
|
|
9690
10079
|
#
|
|
9691
|
-
# [1]: https://
|
|
10080
|
+
# [1]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf#page=39
|
|
10081
|
+
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/offline-operations.html#key-spec-sm-offline-verification
|
|
9692
10082
|
#
|
|
9693
10083
|
# @option params [Array<String>] :grant_tokens
|
|
9694
10084
|
# A list of grant tokens.
|
|
@@ -10196,8 +10586,10 @@ module Aws::KMS
|
|
|
10196
10586
|
# about a change to the `kmsuser` crypto user password
|
|
10197
10587
|
# (`KeyStorePassword`), or to associate the custom key store with a
|
|
10198
10588
|
# different, but related, CloudHSM cluster (`CloudHsmClusterId`). To
|
|
10199
|
-
# update
|
|
10200
|
-
# the CloudHSM key store must be `DISCONNECTED`.
|
|
10589
|
+
# update most properties of an CloudHSM key store, the `ConnectionState`
|
|
10590
|
+
# of the CloudHSM key store must be `DISCONNECTED`. However, you can
|
|
10591
|
+
# update the `CustomKeyStoreName` of an AWS CloudHSM key store when it
|
|
10592
|
+
# is in the `CONNECTED` or `DISCONNECTED` state.
|
|
10201
10593
|
#
|
|
10202
10594
|
# For an external key store, you can use this operation to change the
|
|
10203
10595
|
# custom key store friendly name (`NewCustomKeyStoreName`), or to tell
|
|
@@ -10270,8 +10662,8 @@ module Aws::KMS
|
|
|
10270
10662
|
# This field may be displayed in plaintext in CloudTrail logs and other
|
|
10271
10663
|
# output.
|
|
10272
10664
|
#
|
|
10273
|
-
# To change this value,
|
|
10274
|
-
#
|
|
10665
|
+
# To change this value, the custom key store can be connected or
|
|
10666
|
+
# disconnected.
|
|
10275
10667
|
#
|
|
10276
10668
|
# @option params [String] :key_store_password
|
|
10277
10669
|
# Enter the current password of the `kmsuser` crypto user (CU) in the
|
|
@@ -10859,6 +11251,11 @@ module Aws::KMS
|
|
|
10859
11251
|
# * ED25519\_PH\_SHA\_512 signing algorithm requires KMS
|
|
10860
11252
|
# `MessageType:DIGEST`
|
|
10861
11253
|
#
|
|
11254
|
+
# When you specify the ED25519\_PH\_SHA\_512 signing algorithm with
|
|
11255
|
+
# `MessageType:DIGEST`, KMS still performs the SHA-512 prehash described
|
|
11256
|
+
# in [Step 1 of Section 7.8.1 in FIPS 186-5][1]. This means the input is
|
|
11257
|
+
# hashed twice: once by you and once by KMS.
|
|
11258
|
+
#
|
|
10862
11259
|
# When the value of `MessageType` is `DIGEST`, the length of the
|
|
10863
11260
|
# `Message` value must match the length of hashed messages for the
|
|
10864
11261
|
# specified signing algorithm.
|
|
@@ -10887,11 +11284,12 @@ module Aws::KMS
|
|
|
10887
11284
|
# algorithm.
|
|
10888
11285
|
#
|
|
10889
11286
|
# * SM2DSA uses the SM3 hashing algorithm. For details, see [Offline
|
|
10890
|
-
# verification with SM2 key pairs][
|
|
11287
|
+
# verification with SM2 key pairs][2].
|
|
10891
11288
|
#
|
|
10892
11289
|
#
|
|
10893
11290
|
#
|
|
10894
|
-
# [1]: https://
|
|
11291
|
+
# [1]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf#page=39
|
|
11292
|
+
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/offline-operations.html#key-spec-sm-offline-verification
|
|
10895
11293
|
#
|
|
10896
11294
|
# @option params [required, String, StringIO, File] :signature
|
|
10897
11295
|
# The signature that the `Sign` operation generated.
|
|
@@ -11157,7 +11555,7 @@ module Aws::KMS
|
|
|
11157
11555
|
tracer: tracer
|
|
11158
11556
|
)
|
|
11159
11557
|
context[:gem_name] = 'aws-sdk-kms'
|
|
11160
|
-
context[:gem_version] = '1.
|
|
11558
|
+
context[:gem_version] = '1.129.0'
|
|
11161
11559
|
Seahorse::Client::Request.new(handlers, context)
|
|
11162
11560
|
end
|
|
11163
11561
|
|