@aws-sdk/client-kms 3.1050.0 → 3.1052.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.
@@ -153,6 +153,7 @@ const _GPKRe = "GetPublicKeyResponse";
153
153
  const _GR = "GenerateRandom";
154
154
  const _GRR = "GenerateRandomRequest";
155
155
  const _GRRe = "GenerateRandomResponse";
156
+ const _GSP = "GranteeServicePrincipal";
156
157
  const _GT = "GrantTokens";
157
158
  const _GTr = "GrantToken";
158
159
  const _I = "Id";
@@ -291,6 +292,7 @@ const _RPID = "RotationPeriodInDays";
291
292
  const _RPe = "ReplicaPolicy";
292
293
  const _RR = "ReplicaRegion";
293
294
  const _RSAK = "RawSecretAccessKey";
295
+ const _RSP = "RetiringServicePrincipal";
294
296
  const _RT = "ReplicaTags";
295
297
  const _RTo = "RotationType";
296
298
  const _Re = "Region";
@@ -298,6 +300,7 @@ const _Ro = "Rotations";
298
300
  const _S = "Signature";
299
301
  const _SA = "SigningAlgorithms";
300
302
  const _SAi = "SigningAlgorithm";
303
+ const _SAo = "SourceArn";
301
304
  const _SEA = "SourceEncryptionAlgorithm";
302
305
  const _SEC = "SourceEncryptionContext";
303
306
  const _SKD = "ScheduleKeyDeletion";
@@ -728,8 +731,8 @@ exports.CreateCustomKeyStoreResponse$ = [3, n0, _CCKSRre,
728
731
  ];
729
732
  exports.CreateGrantRequest$ = [3, n0, _CGR,
730
733
  0,
731
- [_KI, _GP, _O, _RP, _C, _GT, _N, _DR],
732
- [0, 0, 64 | 0, 0, () => exports.GrantConstraints$, 64 | 0, 0, 2], 3
734
+ [_KI, _O, _GP, _RP, _C, _GT, _N, _DR, _GSP, _RSP],
735
+ [0, 64 | 0, 0, 0, () => exports.GrantConstraints$, 64 | 0, 0, 2, 0, 0], 2
733
736
  ];
734
737
  exports.CreateGrantResponse$ = [3, n0, _CGRr,
735
738
  0,
@@ -968,13 +971,13 @@ exports.GetPublicKeyResponse$ = [3, n0, _GPKRe,
968
971
  ];
969
972
  exports.GrantConstraints$ = [3, n0, _GC,
970
973
  0,
971
- [_ECS, _ECE],
972
- [128 | 0, 128 | 0]
974
+ [_ECS, _ECE, _SAo],
975
+ [128 | 0, 128 | 0, 0]
973
976
  ];
974
977
  exports.GrantListEntry$ = [3, n0, _GLE,
975
978
  0,
976
- [_KI, _GI, _N, _CD, _GP, _RP, _IA, _O, _C],
977
- [0, 0, 0, 4, 0, 0, 0, 64 | 0, () => exports.GrantConstraints$]
979
+ [_KI, _GI, _N, _CD, _GP, _RP, _IA, _O, _C, _GSP, _RSP],
980
+ [0, 0, 0, 4, 0, 0, 0, 64 | 0, () => exports.GrantConstraints$, 0, 0]
978
981
  ];
979
982
  exports.ImportKeyMaterialRequest$ = [3, n0, _IKMR,
980
983
  0,
@@ -1013,8 +1016,8 @@ exports.ListAliasesResponse$ = [3, n0, _LARi,
1013
1016
  ];
1014
1017
  exports.ListGrantsRequest$ = [3, n0, _LGR,
1015
1018
  0,
1016
- [_KI, _L, _M, _GI, _GP],
1017
- [0, 1, 0, 0, 0], 1
1019
+ [_KI, _L, _M, _GI, _GP, _GSP],
1020
+ [0, 1, 0, 0, 0, 0], 1
1018
1021
  ];
1019
1022
  exports.ListGrantsResponse$ = [3, n0, _LGRi,
1020
1023
  0,
@@ -1063,8 +1066,8 @@ exports.ListResourceTagsResponse$ = [3, n0, _LRTRi,
1063
1066
  ];
1064
1067
  exports.ListRetirableGrantsRequest$ = [3, n0, _LRGR,
1065
1068
  0,
1066
- [_RP, _L, _M],
1067
- [0, 1, 0], 1
1069
+ [_L, _M, _RP, _RSP],
1070
+ [1, 0, 0, 0]
1068
1071
  ];
1069
1072
  exports.MultiRegionConfiguration$ = [3, n0, _MRC,
1070
1073
  0,
@@ -146,6 +146,7 @@ const _GPKRe = "GetPublicKeyResponse";
146
146
  const _GR = "GenerateRandom";
147
147
  const _GRR = "GenerateRandomRequest";
148
148
  const _GRRe = "GenerateRandomResponse";
149
+ const _GSP = "GranteeServicePrincipal";
149
150
  const _GT = "GrantTokens";
150
151
  const _GTr = "GrantToken";
151
152
  const _I = "Id";
@@ -284,6 +285,7 @@ const _RPID = "RotationPeriodInDays";
284
285
  const _RPe = "ReplicaPolicy";
285
286
  const _RR = "ReplicaRegion";
286
287
  const _RSAK = "RawSecretAccessKey";
288
+ const _RSP = "RetiringServicePrincipal";
287
289
  const _RT = "ReplicaTags";
288
290
  const _RTo = "RotationType";
289
291
  const _Re = "Region";
@@ -291,6 +293,7 @@ const _Ro = "Rotations";
291
293
  const _S = "Signature";
292
294
  const _SA = "SigningAlgorithms";
293
295
  const _SAi = "SigningAlgorithm";
296
+ const _SAo = "SourceArn";
294
297
  const _SEA = "SourceEncryptionAlgorithm";
295
298
  const _SEC = "SourceEncryptionContext";
296
299
  const _SKD = "ScheduleKeyDeletion";
@@ -721,8 +724,8 @@ export var CreateCustomKeyStoreResponse$ = [3, n0, _CCKSRre,
721
724
  ];
722
725
  export var CreateGrantRequest$ = [3, n0, _CGR,
723
726
  0,
724
- [_KI, _GP, _O, _RP, _C, _GT, _N, _DR],
725
- [0, 0, 64 | 0, 0, () => GrantConstraints$, 64 | 0, 0, 2], 3
727
+ [_KI, _O, _GP, _RP, _C, _GT, _N, _DR, _GSP, _RSP],
728
+ [0, 64 | 0, 0, 0, () => GrantConstraints$, 64 | 0, 0, 2, 0, 0], 2
726
729
  ];
727
730
  export var CreateGrantResponse$ = [3, n0, _CGRr,
728
731
  0,
@@ -961,13 +964,13 @@ export var GetPublicKeyResponse$ = [3, n0, _GPKRe,
961
964
  ];
962
965
  export var GrantConstraints$ = [3, n0, _GC,
963
966
  0,
964
- [_ECS, _ECE],
965
- [128 | 0, 128 | 0]
967
+ [_ECS, _ECE, _SAo],
968
+ [128 | 0, 128 | 0, 0]
966
969
  ];
967
970
  export var GrantListEntry$ = [3, n0, _GLE,
968
971
  0,
969
- [_KI, _GI, _N, _CD, _GP, _RP, _IA, _O, _C],
970
- [0, 0, 0, 4, 0, 0, 0, 64 | 0, () => GrantConstraints$]
972
+ [_KI, _GI, _N, _CD, _GP, _RP, _IA, _O, _C, _GSP, _RSP],
973
+ [0, 0, 0, 4, 0, 0, 0, 64 | 0, () => GrantConstraints$, 0, 0]
971
974
  ];
972
975
  export var ImportKeyMaterialRequest$ = [3, n0, _IKMR,
973
976
  0,
@@ -1006,8 +1009,8 @@ export var ListAliasesResponse$ = [3, n0, _LARi,
1006
1009
  ];
1007
1010
  export var ListGrantsRequest$ = [3, n0, _LGR,
1008
1011
  0,
1009
- [_KI, _L, _M, _GI, _GP],
1010
- [0, 1, 0, 0, 0], 1
1012
+ [_KI, _L, _M, _GI, _GP, _GSP],
1013
+ [0, 1, 0, 0, 0, 0], 1
1011
1014
  ];
1012
1015
  export var ListGrantsResponse$ = [3, n0, _LGRi,
1013
1016
  0,
@@ -1056,8 +1059,8 @@ export var ListResourceTagsResponse$ = [3, n0, _LRTRi,
1056
1059
  ];
1057
1060
  export var ListRetirableGrantsRequest$ = [3, n0, _LRGR,
1058
1061
  0,
1059
- [_RP, _L, _M],
1060
- [0, 1, 0], 1
1062
+ [_L, _M, _RP, _RSP],
1063
+ [1, 0, 0, 0]
1061
1064
  ];
1062
1065
  export var MultiRegionConfiguration$ = [3, n0, _MRC,
1063
1066
  0,
@@ -286,6 +286,7 @@ export interface KMS {
286
286
  /**
287
287
  * @see {@link ListRetirableGrantsCommand}
288
288
  */
289
+ listRetirableGrants(): Promise<ListRetirableGrantsCommandOutput>;
289
290
  listRetirableGrants(args: ListRetirableGrantsCommandInput, options?: __HttpHandlerOptions): Promise<ListRetirableGrantsCommandOutput>;
290
291
  listRetirableGrants(args: ListRetirableGrantsCommandInput, cb: (err: any, data?: ListRetirableGrantsCommandOutput) => void): void;
291
292
  listRetirableGrants(args: ListRetirableGrantsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListRetirableGrantsCommandOutput) => void): void;
@@ -441,7 +442,7 @@ export interface KMS {
441
442
  * @param paginationConfig - optional pagination config.
442
443
  * @returns AsyncIterable of {@link ListRetirableGrantsCommandOutput}.
443
444
  */
444
- paginateListRetirableGrants(args: ListRetirableGrantsCommandInput, paginationConfig?: Omit<PaginationConfiguration, "client">): Paginator<ListRetirableGrantsCommandOutput>;
445
+ paginateListRetirableGrants(args?: ListRetirableGrantsCommandInput, paginationConfig?: Omit<PaginationConfiguration, "client">): Paginator<ListRetirableGrantsCommandOutput>;
445
446
  }
446
447
  /**
447
448
  * <fullname>Key Management Service</fullname>
@@ -35,6 +35,10 @@ declare const CreateGrantCommand_base: {
35
35
  * grants are considered along with key policies and IAM policies. Grants are often used for
36
36
  * temporary permissions because you can create one, use its permissions, and delete it without
37
37
  * changing your key policies or IAM policies. </p>
38
+ * <p>You can create a grant for an Amazon Web Services principal (IAM user, IAM role, or Amazon Web Services account) by
39
+ * specifying the <code>GranteePrincipal</code> parameter. You can also create a grant for an
40
+ * Amazon Web Services service principal by specifying the <code>GranteeServicePrincipal</code>
41
+ * parameter.</p>
38
42
  * <p>For detailed information about grants, including grant terminology, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html">Grants in KMS</a> in the
39
43
  * <i>
40
44
  * <i>Key Management Service Developer Guide</i>
@@ -104,7 +108,7 @@ declare const CreateGrantCommand_base: {
104
108
  * const client = new KMSClient(config);
105
109
  * const input = { // CreateGrantRequest
106
110
  * KeyId: "STRING_VALUE", // required
107
- * GranteePrincipal: "STRING_VALUE", // required
111
+ * GranteePrincipal: "STRING_VALUE",
108
112
  * RetiringPrincipal: "STRING_VALUE",
109
113
  * Operations: [ // GrantOperationList // required
110
114
  * "Decrypt" || "Encrypt" || "GenerateDataKey" || "GenerateDataKeyWithoutPlaintext" || "ReEncryptFrom" || "ReEncryptTo" || "Sign" || "Verify" || "GetPublicKey" || "CreateGrant" || "RetireGrant" || "DescribeKey" || "GenerateDataKeyPair" || "GenerateDataKeyPairWithoutPlaintext" || "GenerateMac" || "VerifyMac" || "DeriveSharedSecret",
@@ -116,12 +120,15 @@ declare const CreateGrantCommand_base: {
116
120
  * EncryptionContextEquals: {
117
121
  * "<keys>": "STRING_VALUE",
118
122
  * },
123
+ * SourceArn: "STRING_VALUE",
119
124
  * },
120
125
  * GrantTokens: [ // GrantTokenList
121
126
  * "STRING_VALUE",
122
127
  * ],
123
128
  * Name: "STRING_VALUE",
124
129
  * DryRun: true || false,
130
+ * GranteeServicePrincipal: "STRING_VALUE",
131
+ * RetiringServicePrincipal: "STRING_VALUE",
125
132
  * };
126
133
  * const command = new CreateGrantCommand(input);
127
134
  * const response = await client.send(command);
@@ -213,6 +220,33 @@ declare const CreateGrantCommand_base: {
213
220
  * *\/
214
221
  * ```
215
222
  *
223
+ * @example To create a grant for a service principal
224
+ * ```javascript
225
+ * // The following example creates a grant that allows the specified AWS service principal to encrypt and decrypt data with the specified KMS key. The grant includes a SourceArn constraint that restricts the grant permissions to requests associated with the specified DynamoDB table.
226
+ * const input = {
227
+ * Constraints: {
228
+ * SourceArn: "arn:aws:dynamodb:us-east-2:444455556666:table/ExampleTable"
229
+ * },
230
+ * GranteeServicePrincipal: "service-name.amazonaws.com",
231
+ * KeyId: "arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab",
232
+ * Operations: [
233
+ * "Encrypt",
234
+ * "Decrypt",
235
+ * "GenerateDataKey",
236
+ * "DescribeKey"
237
+ * ],
238
+ * RetiringServicePrincipal: "service-name.amazonaws.com"
239
+ * };
240
+ * const command = new CreateGrantCommand(input);
241
+ * const response = await client.send(command);
242
+ * /* response is
243
+ * {
244
+ * GrantId: "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
245
+ * GrantToken: "AQpAM2RhZTk1MGMyNTk2ZmZmMzEyYWVhOWViN2I1MWM4Mzc0MWFiYjc0ZDE1ODkyNGFlNTIzODZhMzgyZjBlNGY3NiKIAgEBAgB4Pa6VDCWW..."
246
+ * }
247
+ * *\/
248
+ * ```
249
+ *
216
250
  * @public
217
251
  */
218
252
  export declare class CreateGrantCommand extends CreateGrantCommand_base {
@@ -30,19 +30,21 @@ declare const ListGrantsCommand_base: {
30
30
  };
31
31
  /**
32
32
  * <p>Gets a list of all grants for the specified KMS key. </p>
33
- * <p>You must specify the KMS key in all requests. You can filter the grant list by grant ID or
34
- * grantee principal.</p>
33
+ * <p>You must specify the KMS key in all requests. You can filter the grant list by grant ID,
34
+ * grantee principal, or grantee service principal.</p>
35
35
  * <p>For detailed information about grants, including grant terminology, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html">Grants in KMS</a> in the
36
36
  * <i>
37
37
  * <i>Key Management Service Developer Guide</i>
38
38
  * </i>. For examples of creating grants in several
39
39
  * programming languages, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/example_kms_CreateGrant_section.html">Use CreateGrant with an Amazon Web Services SDK or CLI</a>. </p>
40
40
  * <note>
41
- * <p>The <code>GranteePrincipal</code> field in the <code>ListGrants</code> response usually contains the
42
- * user or role designated as the grantee principal in the grant. However, when the grantee
43
- * principal in the grant is an Amazon Web Services service, the <code>GranteePrincipal</code> field contains
44
- * the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services">service
45
- * principal</a>, which might represent several different grantee principals.</p>
41
+ * <p>When a grant is created with the <code>GranteePrincipal</code> field, the <code>ListGrants</code>
42
+ * response usually contains the user or role designated as the grantee principal in the grant. However, if the grantee principal
43
+ * is an Amazon Web Services service, the <code>GranteePrincipal</code> field contains an Amazon Web Services <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services">service principal</a>, which
44
+ * might correspond to several different grantee principals, such as an IAM user, IAM role, or Amazon Web Services account.</p>
45
+ * <p>When a grant is created with the <code>GranteeServicePrincipal</code> field, the <code>ListGrants</code>
46
+ * response always includes a <code>GranteeServicePrincipal</code> that indicates the grantee is actually
47
+ * an Amazon Web Services <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services">service principal</a>.</p>
46
48
  * </note>
47
49
  * <p>
48
50
  * <b>Cross-account use</b>: Yes. To perform this operation on a KMS key in a different Amazon Web Services account, specify the key
@@ -91,6 +93,7 @@ declare const ListGrantsCommand_base: {
91
93
  * KeyId: "STRING_VALUE", // required
92
94
  * GrantId: "STRING_VALUE",
93
95
  * GranteePrincipal: "STRING_VALUE",
96
+ * GranteeServicePrincipal: "STRING_VALUE",
94
97
  * };
95
98
  * const command = new ListGrantsCommand(input);
96
99
  * const response = await client.send(command);
@@ -114,7 +117,10 @@ declare const ListGrantsCommand_base: {
114
117
  * // EncryptionContextEquals: {
115
118
  * // "<keys>": "STRING_VALUE",
116
119
  * // },
120
+ * // SourceArn: "STRING_VALUE",
117
121
  * // },
122
+ * // GranteeServicePrincipal: "STRING_VALUE",
123
+ * // RetiringServicePrincipal: "STRING_VALUE",
118
124
  * // },
119
125
  * // ],
120
126
  * // NextMarker: "STRING_VALUE",
@@ -23,14 +23,14 @@ export interface ListRetirableGrantsCommandOutput extends ListGrantsResponse, __
23
23
  }
24
24
  declare const ListRetirableGrantsCommand_base: {
25
25
  new (input: ListRetirableGrantsCommandInput): import("@smithy/core/client").CommandImpl<ListRetirableGrantsCommandInput, ListRetirableGrantsCommandOutput, KMSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
- new (input: ListRetirableGrantsCommandInput): import("@smithy/core/client").CommandImpl<ListRetirableGrantsCommandInput, ListRetirableGrantsCommandOutput, KMSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (...[input]: [] | [ListRetirableGrantsCommandInput]): import("@smithy/core/client").CommandImpl<ListRetirableGrantsCommandInput, ListRetirableGrantsCommandOutput, KMSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
27
  getEndpointParameterInstructions(): {
28
28
  [x: string]: unknown;
29
29
  };
30
30
  };
31
31
  /**
32
32
  * <p>Returns information about all grants in the Amazon Web Services account and Region that have the
33
- * specified retiring principal. </p>
33
+ * specified retiring principal or retiring service principal. </p>
34
34
  * <p>You can specify any principal in your Amazon Web Services account. The grants that are returned include
35
35
  * grants for KMS keys in your Amazon Web Services account and other Amazon Web Services accounts. You might use this
36
36
  * operation to determine which grants you may retire. To retire a grant, use the <a>RetireGrant</a> operation.</p>
@@ -50,11 +50,14 @@ declare const ListRetirableGrantsCommand_base: {
50
50
  * <b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:ListRetirableGrants</a> (IAM policy) in your
51
51
  * Amazon Web Services account.</p>
52
52
  * <note>
53
- * <p>KMS authorizes <code>ListRetirableGrants</code> requests by evaluating the caller
53
+ * <p>When listing retirable grants by <code>RetiringPrincipal</code>, KMS authorizes
54
+ * <code>ListRetirableGrants</code> requests by evaluating the caller
54
55
  * account's kms:ListRetirableGrants permissions. The authorized resource in
55
- * <code>ListRetirableGrants</code> calls is the retiring principal specified in the request.
56
+ * <code>ListRetirableGrants</code> calls is the retiring principal specified in the request.
56
57
  * KMS does not evaluate the caller's permissions to verify their access to any KMS keys or
57
58
  * grants that might be returned by the <code>ListRetirableGrants</code> call.</p>
59
+ * <p>The <code>RetiringServicePrincipal</code> filter is only usable by callers in a
60
+ * service principal.</p>
58
61
  * </note>
59
62
  * <p>
60
63
  * <b>Related operations:</b>
@@ -95,7 +98,8 @@ declare const ListRetirableGrantsCommand_base: {
95
98
  * const input = { // ListRetirableGrantsRequest
96
99
  * Limit: Number("int"),
97
100
  * Marker: "STRING_VALUE",
98
- * RetiringPrincipal: "STRING_VALUE", // required
101
+ * RetiringPrincipal: "STRING_VALUE",
102
+ * RetiringServicePrincipal: "STRING_VALUE",
99
103
  * };
100
104
  * const command = new ListRetirableGrantsCommand(input);
101
105
  * const response = await client.send(command);
@@ -119,7 +123,10 @@ declare const ListRetirableGrantsCommand_base: {
119
123
  * // EncryptionContextEquals: {
120
124
  * // "<keys>": "STRING_VALUE",
121
125
  * // },
126
+ * // SourceArn: "STRING_VALUE",
122
127
  * // },
128
+ * // GranteeServicePrincipal: "STRING_VALUE",
129
+ * // RetiringServicePrincipal: "STRING_VALUE",
123
130
  * // },
124
131
  * // ],
125
132
  * // NextMarker: "STRING_VALUE",
@@ -73,6 +73,12 @@ declare const ReEncryptCommand_base: {
73
73
  * </ul>
74
74
  * <p>The KMS key that you use for this operation must be in a compatible key state. For
75
75
  * details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
76
+ * <note>
77
+ * <p>When using grants with <code>SourceArn</code> constraints for
78
+ * <code>ReEncrypt</code> operations, the grants on both the source KMS key (for
79
+ * <code>ReEncryptFrom</code>) and the destination KMS key (for <code>ReEncryptTo</code>)
80
+ * must specify the same <code>SourceArn</code> value. </p>
81
+ * </note>
76
82
  * <p>
77
83
  * <b>Cross-account use</b>: Yes. The source KMS key and
78
84
  * destination KMS key can be in different Amazon Web Services accounts. Either or both KMS keys can be in a
@@ -336,25 +336,41 @@ export interface CreateCustomKeyStoreResponse {
336
336
  }
337
337
  /**
338
338
  * <p>Use this structure to allow <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-cryptography.html#cryptographic-operations">cryptographic operations</a> in the grant only when the operation request
339
- * includes the specified <a href="https://docs.aws.amazon.com/kms/latest/developerguide/encrypt_context.html">encryption context</a>. </p>
340
- * <p>KMS applies the grant constraints only to cryptographic operations that support an
341
- * encryption context, that is, all cryptographic operations with a symmetric KMS key. Grant
342
- * constraints are not applied to operations that do not support an encryption context, such as
343
- * cryptographic operations with asymmetric KMS keys and management operations, such as <a>DescribeKey</a> or <a>RetireGrant</a>.</p>
344
- * <important>
345
- * <p>In a cryptographic operation, the encryption context in the decryption operation must be
346
- * an exact, case-sensitive match for the keys and values in the encryption context of the
347
- * encryption operation. Only the order of the pairs can vary.</p>
348
- * <p>However, in a grant constraint, the key in each key-value pair is not case sensitive,
349
- * but the value is case sensitive.</p>
350
- * <p>To avoid confusion, do not use multiple encryption context pairs that differ only by
351
- * case. To require a fully case-sensitive encryption context, use the
352
- * <code>kms:EncryptionContext:</code> and <code>kms:EncryptionContextKeys</code> conditions
353
- * in an IAM or key policy. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/conditions-kms.html#conditions-kms-encryption-context">kms:EncryptionContext:context-key</a> in the
354
- * <i>
355
- * <i>Key Management Service Developer Guide</i>
356
- * </i>.</p>
357
- * </important>
339
+ * meets the specified constraints.</p>
340
+ * <p>KMS supports the following grant constraints:</p>
341
+ * <ul>
342
+ * <li>
343
+ * <p>
344
+ * <code>EncryptionContextEquals</code> and <code>EncryptionContextSubset</code> —
345
+ * These encryption context constraints apply only to cryptographic operations that support
346
+ * an encryption context, that is, all cryptographic operations with a symmetric KMS key.
347
+ * Encryption context grant constraints are not applied to operations that do not support an
348
+ * encryption context, such as cryptographic operations with asymmetric KMS keys and
349
+ * management operations, such as <a>DescribeKey</a> or <a>RetireGrant</a>.</p>
350
+ * <important>
351
+ * <p>In a cryptographic operation, the encryption context in the decryption operation must be
352
+ * an exact, case-sensitive match for the keys and values in the encryption context of the
353
+ * encryption operation. Only the order of the pairs can vary.</p>
354
+ * <p>However, in a grant constraint, the key in each key-value pair is not case sensitive,
355
+ * but the value is case sensitive.</p>
356
+ * <p>To avoid confusion, do not use multiple encryption context pairs that differ only by
357
+ * case. To require a fully case-sensitive encryption context, use the
358
+ * <code>kms:EncryptionContext:</code> and <code>kms:EncryptionContextKeys</code> conditions
359
+ * in an IAM or key policy. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/conditions-kms.html#conditions-kms-encryption-context">kms:EncryptionContext:context-key</a> in the
360
+ * <i>
361
+ * <i>Key Management Service Developer Guide</i>
362
+ * </i>.</p>
363
+ * </important>
364
+ * </li>
365
+ * <li>
366
+ * <p>
367
+ * <code>SourceArn</code> — This grant constraint allows the permissions in the grant only when the
368
+ * request is made on behalf of a specific Amazon Web Services resource, identified by its <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a>. This is effectively
369
+ * the same as having the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourcearn">aws:SourceArn</a> global condition key in the grant. The SourceArn constraint is supported on grants
370
+ * for all types of KMS keys and can also be applied to the <a>DescribeKey</a> operation when
371
+ * specified in the request. However, it does not apply to <a>RetireGrant</a> operation.</p>
372
+ * </li>
373
+ * </ul>
358
374
  * @public
359
375
  */
360
376
  export interface GrantConstraints {
@@ -373,6 +389,14 @@ export interface GrantConstraints {
373
389
  * @public
374
390
  */
375
391
  EncryptionContextEquals?: Record<string, string> | undefined;
392
+ /**
393
+ * <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">
394
+ * Amazon Resource Name (ARN)</a> of an Amazon Web Services resource on behalf of which the request is made.
395
+ * This is effectively the same as having the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourcearn">aws:SourceArn</a> global condition key in the grant. The SourceArn constraint ensures
396
+ * that the principal can use the KMS key only when the request is made on behalf of the specified resource.</p>
397
+ * @public
398
+ */
399
+ SourceArn?: string | undefined;
376
400
  }
377
401
  /**
378
402
  * @public
@@ -406,9 +430,11 @@ export interface CreateGrantRequest {
406
430
  * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a> in the <i>
407
431
  * <i>Identity and Access Management User Guide</i>
408
432
  * </i>.</p>
433
+ * <p>You must specify either <code>GranteePrincipal</code> or
434
+ * <code>GranteeServicePrincipal</code>, but not both.</p>
409
435
  * @public
410
436
  */
411
- GranteePrincipal: string | undefined;
437
+ GranteePrincipal?: string | undefined;
412
438
  /**
413
439
  * <p>The principal that has permission to use the <a>RetireGrant</a> operation to
414
440
  * retire the grant. </p>
@@ -422,6 +448,8 @@ export interface CreateGrantRequest {
422
448
  * retire the grant or revoke the grant. For details, see <a>RevokeGrant</a> and
423
449
  * <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-delete.html">Retiring and revoking
424
450
  * grants</a> in the <i>Key Management Service Developer Guide</i>. </p>
451
+ * <p>You can specify either <code>RetiringPrincipal</code> or
452
+ * <code>RetiringServicePrincipal</code>, but not both.</p>
425
453
  * @public
426
454
  */
427
455
  RetiringPrincipal?: string | undefined;
@@ -441,28 +469,42 @@ export interface CreateGrantRequest {
441
469
  * <important>
442
470
  * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
443
471
  * </important>
444
- * <p>KMS supports the <code>EncryptionContextEquals</code> and
445
- * <code>EncryptionContextSubset</code> grant constraints, which allow the permissions in the
446
- * grant only when the encryption context in the request matches
447
- * (<code>EncryptionContextEquals</code>) or includes (<code>EncryptionContextSubset</code>)
448
- * the encryption context specified in the constraint. </p>
449
- * <p>The encryption context grant constraints are supported only on <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations">grant operations</a> that include
450
- * an <code>EncryptionContext</code> parameter, such as cryptographic operations on symmetric
451
- * encryption KMS keys. Grants with grant constraints can include the <a>DescribeKey</a> and <a>RetireGrant</a> operations, but the constraint doesn't apply to these
452
- * operations. If a grant with a grant constraint includes the <code>CreateGrant</code>
453
- * operation, the constraint requires that any grants created with the <code>CreateGrant</code>
454
- * permission have an equally strict or stricter encryption context constraint.</p>
455
- * <p>You cannot use an encryption context grant constraint for cryptographic operations with
456
- * asymmetric KMS keys or HMAC KMS keys. Operations with these keys don't support an encryption
457
- * context.</p>
458
- * <p>Each constraint value can include up to 8 encryption context pairs. The encryption context
459
- * value in each constraint cannot exceed 384 characters. For information about grant
460
- * constraints, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints">Using grant
461
- * constraints</a> in the <i>Key Management Service Developer Guide</i>. For more information about encryption context,
462
- * see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption
463
- * context</a> in the <i>
464
- * <i>Key Management Service Developer Guide</i>
465
- * </i>. </p>
472
+ * <p>KMS supports the following grant constraints.</p>
473
+ * <ul>
474
+ * <li>
475
+ * <p>
476
+ * <code>EncryptionContextEquals</code> and <code>EncryptionContextSubset</code> These
477
+ * encryption context grant constraints allow the permissions in the grant only when the
478
+ * encryption context in the request matches (<code>EncryptionContextEquals</code>) or
479
+ * includes (<code>EncryptionContextSubset</code>) the encryption context specified in the
480
+ * constraint.</p>
481
+ * <p>Encryption context grant constraints are supported only on <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations">grant operations</a> that
482
+ * include an <code>EncryptionContext</code> parameter, such as cryptographic operations on
483
+ * symmetric encryption KMS keys. You cannot use an encryption context grant constraint for
484
+ * cryptographic operations with asymmetric KMS keys or HMAC KMS keys. Operations with these
485
+ * keys don't support an encryption context. Grants with encryption context grant constraints
486
+ * can include the <a>DescribeKey</a> and <a>RetireGrant</a> operations,
487
+ * but the constraint doesn't apply to these operations. If a grant with an encryption context
488
+ * grant constraint includes the <code>CreateGrant</code> operation, the constraint requires
489
+ * that any grants created with the <code>CreateGrant</code> permission have an equally strict
490
+ * or stricter encryption context constraint. </p>
491
+ * <p>Each constraint value can include up to 8 encryption context pairs. The encryption
492
+ * context value in each constraint cannot exceed 384 characters. For more information about
493
+ * encryption context, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption context</a> in the <i>
494
+ * <i>Key Management Service Developer Guide</i>
495
+ * </i>.</p>
496
+ * </li>
497
+ * <li>
498
+ * <p>
499
+ * <code>SourceArn</code> — This grant constraint allows the permissions in the grant only when the
500
+ * request is made on behalf of a specific Amazon Web Services resource, identified by its <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a>. This is effectively
501
+ * the same as having the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourcearn">aws:SourceArn</a> global condition key in the grant. The SourceArn constraint is supported on grants
502
+ * for all types of KMS keys and can also be applied to the <a>DescribeKey</a> operation when
503
+ * specified in the request. However, it does not apply to <a>RetireGrant</a> operation.</p>
504
+ * </li>
505
+ * </ul>
506
+ * <p>For information about grant constraints, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints">Using grant
507
+ * constraints</a> in the <i>Key Management Service Developer Guide</i>. </p>
466
508
  * @public
467
509
  */
468
510
  Constraints?: GrantConstraints | undefined;
@@ -496,6 +538,27 @@ export interface CreateGrantRequest {
496
538
  * @public
497
539
  */
498
540
  DryRun?: boolean | undefined;
541
+ /**
542
+ * <p>The Amazon Web Services <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services">service
543
+ * principal</a> that gets the permissions specified in the grant. </p>
544
+ * <p>When you specify a <code>GranteeServicePrincipal</code>, you must also specify a
545
+ * <code>SourceArn</code> grant constraint. In addition, you must specify either a
546
+ * <code>RetiringPrincipal</code> or a <code>RetiringServicePrincipal</code>.
547
+ * </p>
548
+ * <p>You must specify either <code>GranteePrincipal</code> or
549
+ * <code>GranteeServicePrincipal</code>, but not both.</p>
550
+ * @public
551
+ */
552
+ GranteeServicePrincipal?: string | undefined;
553
+ /**
554
+ * <p>The Amazon Web Services <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services">service
555
+ * principal</a> that has permission to use the <a>RetireGrant</a>
556
+ * operation to retire the grant.</p>
557
+ * <p>You can specify either <code>RetiringPrincipal</code> or
558
+ * <code>RetiringServicePrincipal</code>, but not both.</p>
559
+ * @public
560
+ */
561
+ RetiringServicePrincipal?: string | undefined;
499
562
  }
500
563
  /**
501
564
  * @public
@@ -3214,11 +3277,10 @@ export interface GrantListEntry {
3214
3277
  CreationDate?: Date | undefined;
3215
3278
  /**
3216
3279
  * <p>The identity that gets the permissions in the grant.</p>
3217
- * <p>The <code>GranteePrincipal</code> field in the <code>ListGrants</code> response usually contains the
3218
- * user or role designated as the grantee principal in the grant. However, when the grantee
3219
- * principal in the grant is an Amazon Web Services service, the <code>GranteePrincipal</code> field contains
3220
- * the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services">service
3221
- * principal</a>, which might represent several different grantee principals.</p>
3280
+ * <p>When a grant is created with the <code>GranteePrincipal</code> field, the <code>ListGrants</code>
3281
+ * response usually contains the user or role designated as the grantee principal in the grant. However, if the grantee principal
3282
+ * is an Amazon Web Services service, the <code>GranteePrincipal</code> field contains an Amazon Web Services <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services">service principal</a>, which
3283
+ * might correspond to several different grantee principals, such as an IAM user, IAM role, or Amazon Web Services account.</p>
3222
3284
  * @public
3223
3285
  */
3224
3286
  GranteePrincipal?: string | undefined;
@@ -3238,11 +3300,23 @@ export interface GrantListEntry {
3238
3300
  */
3239
3301
  Operations?: GrantOperation[] | undefined;
3240
3302
  /**
3241
- * <p>A list of key-value pairs that must be present in the encryption context of certain
3242
- * subsequent operations that the grant allows.</p>
3303
+ * <p>The constraints on the grant, such as encryption context pairs or a SourceArn,
3304
+ * that restrict the subsequent operations the grant allows.</p>
3243
3305
  * @public
3244
3306
  */
3245
3307
  Constraints?: GrantConstraints | undefined;
3308
+ /**
3309
+ * <p>The Amazon Web Services <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services">service
3310
+ * principal</a> that gets the permissions in the grant.</p>
3311
+ * @public
3312
+ */
3313
+ GranteeServicePrincipal?: string | undefined;
3314
+ /**
3315
+ * <p>The Amazon Web Services <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services">service
3316
+ * principal</a> that can retire the grant.</p>
3317
+ * @public
3318
+ */
3319
+ RetiringServicePrincipal?: string | undefined;
3246
3320
  }
3247
3321
  /**
3248
3322
  * @public
@@ -3505,9 +3579,19 @@ export interface ListGrantsRequest {
3505
3579
  /**
3506
3580
  * <p>Returns only grants where the specified principal is the grantee principal for the
3507
3581
  * grant.</p>
3582
+ * <p>You can specify either <code>GranteePrincipal</code> or
3583
+ * <code>GranteeServicePrincipal</code>, but not both.</p>
3508
3584
  * @public
3509
3585
  */
3510
3586
  GranteePrincipal?: string | undefined;
3587
+ /**
3588
+ * <p>Returns only grants where the specified Amazon Web Services service principal is the grantee service
3589
+ * principal for the grant. This filter is only usable by callers in a service principal.</p>
3590
+ * <p>You can specify either <code>GranteePrincipal</code> or
3591
+ * <code>GranteeServicePrincipal</code>, but not both.</p>
3592
+ * @public
3593
+ */
3594
+ GranteeServicePrincipal?: string | undefined;
3511
3595
  }
3512
3596
  /**
3513
3597
  * @public
@@ -3897,9 +3981,19 @@ export interface ListRetirableGrantsRequest {
3897
3981
  * <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns">IAM ARNs</a> in the <i>
3898
3982
  * <i>Identity and Access Management User Guide</i>
3899
3983
  * </i>.</p>
3984
+ * <p>You must specify either <code>RetiringPrincipal</code> or
3985
+ * <code>RetiringServicePrincipal</code>, but not both.</p>
3986
+ * @public
3987
+ */
3988
+ RetiringPrincipal?: string | undefined;
3989
+ /**
3990
+ * <p>The retiring service principal for which to list grants. This filter is only usable by
3991
+ * callers in a service principal.</p>
3992
+ * <p>You must specify either <code>RetiringPrincipal</code> or
3993
+ * <code>RetiringServicePrincipal</code>, but not both.</p>
3900
3994
  * @public
3901
3995
  */
3902
- RetiringPrincipal: string | undefined;
3996
+ RetiringServicePrincipal?: string | undefined;
3903
3997
  }
3904
3998
  /**
3905
3999
  * @public
@@ -711,6 +711,7 @@ export interface KMS {
711
711
  options: __HttpHandlerOptions,
712
712
  cb: (err: any, data?: ListResourceTagsCommandOutput) => void
713
713
  ): void;
714
+ listRetirableGrants(): Promise<ListRetirableGrantsCommandOutput>;
714
715
  listRetirableGrants(
715
716
  args: ListRetirableGrantsCommandInput,
716
717
  options?: __HttpHandlerOptions
@@ -983,7 +984,7 @@ export interface KMS {
983
984
  >
984
985
  ): Paginator<ListResourceTagsCommandOutput>;
985
986
  paginateListRetirableGrants(
986
- args: ListRetirableGrantsCommandInput,
987
+ args?: ListRetirableGrantsCommandInput,
987
988
  paginationConfig?: Pick<
988
989
  PaginationConfiguration,
989
990
  Exclude<keyof PaginationConfiguration, "client">
@@ -27,7 +27,7 @@ declare const ListRetirableGrantsCommand_base: {
27
27
  ServiceOutputTypes
28
28
  >;
29
29
  new (
30
- input: ListRetirableGrantsCommandInput
30
+ ...[input]: [] | [ListRetirableGrantsCommandInput]
31
31
  ): import("@smithy/core/client").CommandImpl<
32
32
  ListRetirableGrantsCommandInput,
33
33
  ListRetirableGrantsCommandOutput,
@@ -76,16 +76,19 @@ export interface CreateCustomKeyStoreResponse {
76
76
  export interface GrantConstraints {
77
77
  EncryptionContextSubset?: Record<string, string> | undefined;
78
78
  EncryptionContextEquals?: Record<string, string> | undefined;
79
+ SourceArn?: string | undefined;
79
80
  }
80
81
  export interface CreateGrantRequest {
81
82
  KeyId: string | undefined;
82
- GranteePrincipal: string | undefined;
83
+ GranteePrincipal?: string | undefined;
83
84
  RetiringPrincipal?: string | undefined;
84
85
  Operations: GrantOperation[] | undefined;
85
86
  Constraints?: GrantConstraints | undefined;
86
87
  GrantTokens?: string[] | undefined;
87
88
  Name?: string | undefined;
88
89
  DryRun?: boolean | undefined;
90
+ GranteeServicePrincipal?: string | undefined;
91
+ RetiringServicePrincipal?: string | undefined;
89
92
  }
90
93
  export interface CreateGrantResponse {
91
94
  GrantToken?: string | undefined;
@@ -418,6 +421,8 @@ export interface GrantListEntry {
418
421
  IssuingAccount?: string | undefined;
419
422
  Operations?: GrantOperation[] | undefined;
420
423
  Constraints?: GrantConstraints | undefined;
424
+ GranteeServicePrincipal?: string | undefined;
425
+ RetiringServicePrincipal?: string | undefined;
421
426
  }
422
427
  export interface ImportKeyMaterialRequest {
423
428
  KeyId: string | undefined;
@@ -453,6 +458,7 @@ export interface ListGrantsRequest {
453
458
  KeyId: string | undefined;
454
459
  GrantId?: string | undefined;
455
460
  GranteePrincipal?: string | undefined;
461
+ GranteeServicePrincipal?: string | undefined;
456
462
  }
457
463
  export interface ListGrantsResponse {
458
464
  Grants?: GrantListEntry[] | undefined;
@@ -513,7 +519,8 @@ export interface ListResourceTagsResponse {
513
519
  export interface ListRetirableGrantsRequest {
514
520
  Limit?: number | undefined;
515
521
  Marker?: string | undefined;
516
- RetiringPrincipal: string | undefined;
522
+ RetiringPrincipal?: string | undefined;
523
+ RetiringServicePrincipal?: string | undefined;
517
524
  }
518
525
  export interface PutKeyPolicyRequest {
519
526
  KeyId: string | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kms",
3
3
  "description": "AWS SDK for JavaScript Kms Client for Node.js, Browser and React Native",
4
- "version": "3.1050.0",
4
+ "version": "3.1052.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-kms",
@@ -23,13 +23,13 @@
23
23
  "dependencies": {
24
24
  "@aws-crypto/sha256-browser": "5.2.0",
25
25
  "@aws-crypto/sha256-js": "5.2.0",
26
- "@aws-sdk/core": "^3.974.12",
27
- "@aws-sdk/credential-provider-node": "^3.972.43",
28
- "@aws-sdk/types": "^3.973.8",
29
- "@smithy/core": "^3.24.2",
30
- "@smithy/fetch-http-handler": "^5.4.2",
31
- "@smithy/node-http-handler": "^4.7.2",
32
- "@smithy/types": "^4.14.1",
26
+ "@aws-sdk/core": "^3.974.13",
27
+ "@aws-sdk/credential-provider-node": "^3.972.44",
28
+ "@aws-sdk/types": "^3.973.9",
29
+ "@smithy/core": "^3.24.3",
30
+ "@smithy/fetch-http-handler": "^5.4.3",
31
+ "@smithy/node-http-handler": "^4.7.3",
32
+ "@smithy/types": "^4.14.2",
33
33
  "tslib": "^2.6.2"
34
34
  },
35
35
  "devDependencies": {