@aws-sdk/client-ec2 3.231.0 → 3.235.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist-cjs/endpoint/ruleset.js +4 -331
  2. package/dist-cjs/pagination/DescribeImagesPaginator.js +36 -0
  3. package/dist-cjs/pagination/index.js +1 -0
  4. package/dist-cjs/protocols/Aws_ec2.js +10 -0
  5. package/dist-es/endpoint/ruleset.js +4 -331
  6. package/dist-es/pagination/DescribeImagesPaginator.js +32 -0
  7. package/dist-es/pagination/index.js +1 -0
  8. package/dist-es/protocols/Aws_ec2.js +10 -0
  9. package/dist-types/EC2.d.ts +15 -15
  10. package/dist-types/commands/CancelImageLaunchPermissionCommand.d.ts +1 -1
  11. package/dist-types/commands/CopyImageCommand.d.ts +2 -2
  12. package/dist-types/commands/CreateRestoreImageTaskCommand.d.ts +2 -2
  13. package/dist-types/commands/CreateStoreImageTaskCommand.d.ts +2 -2
  14. package/dist-types/commands/DeregisterImageCommand.d.ts +1 -1
  15. package/dist-types/commands/DescribeStoreImageTasksCommand.d.ts +2 -2
  16. package/dist-types/commands/DisableImageDeprecationCommand.d.ts +1 -1
  17. package/dist-types/commands/EnableImageDeprecationCommand.d.ts +1 -1
  18. package/dist-types/commands/ListImagesInRecycleBinCommand.d.ts +1 -1
  19. package/dist-types/commands/RegisterImageCommand.d.ts +1 -1
  20. package/dist-types/commands/RestoreImageFromRecycleBinCommand.d.ts +1 -1
  21. package/dist-types/models/models_0.d.ts +2 -2
  22. package/dist-types/models/models_3.d.ts +19 -6
  23. package/dist-types/models/models_6.d.ts +14 -10
  24. package/dist-types/pagination/DescribeImagesPaginator.d.ts +4 -0
  25. package/dist-types/pagination/index.d.ts +1 -0
  26. package/dist-types/ts3.4/models/models_3.d.ts +3 -0
  27. package/dist-types/ts3.4/pagination/DescribeImagesPaginator.d.ts +11 -0
  28. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  29. package/package.json +8 -8
@@ -1,334 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ruleSet = void 0;
4
- exports.ruleSet = {
5
- version: "1.0",
6
- parameters: {
7
- Region: {
8
- builtIn: "AWS::Region",
9
- required: true,
10
- documentation: "The AWS region used to dispatch the request.",
11
- type: "String",
12
- },
13
- UseDualStack: {
14
- builtIn: "AWS::UseDualStack",
15
- required: true,
16
- default: false,
17
- documentation: "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.",
18
- type: "Boolean",
19
- },
20
- UseFIPS: {
21
- builtIn: "AWS::UseFIPS",
22
- required: true,
23
- default: false,
24
- documentation: "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.",
25
- type: "Boolean",
26
- },
27
- Endpoint: {
28
- builtIn: "SDK::Endpoint",
29
- required: false,
30
- documentation: "Override the endpoint used to send this request",
31
- type: "String",
32
- },
33
- },
34
- rules: [
35
- {
36
- conditions: [
37
- {
38
- fn: "aws.partition",
39
- argv: [
40
- {
41
- ref: "Region",
42
- },
43
- ],
44
- assign: "PartitionResult",
45
- },
46
- ],
47
- type: "tree",
48
- rules: [
49
- {
50
- conditions: [
51
- {
52
- fn: "isSet",
53
- argv: [
54
- {
55
- ref: "Endpoint",
56
- },
57
- ],
58
- },
59
- ],
60
- type: "tree",
61
- rules: [
62
- {
63
- conditions: [
64
- {
65
- fn: "booleanEquals",
66
- argv: [
67
- {
68
- ref: "UseFIPS",
69
- },
70
- true,
71
- ],
72
- },
73
- ],
74
- error: "Invalid Configuration: FIPS and custom endpoint are not supported",
75
- type: "error",
76
- },
77
- {
78
- conditions: [],
79
- type: "tree",
80
- rules: [
81
- {
82
- conditions: [
83
- {
84
- fn: "booleanEquals",
85
- argv: [
86
- {
87
- ref: "UseDualStack",
88
- },
89
- true,
90
- ],
91
- },
92
- ],
93
- error: "Invalid Configuration: Dualstack and custom endpoint are not supported",
94
- type: "error",
95
- },
96
- {
97
- conditions: [],
98
- endpoint: {
99
- url: {
100
- ref: "Endpoint",
101
- },
102
- properties: {},
103
- headers: {},
104
- },
105
- type: "endpoint",
106
- },
107
- ],
108
- },
109
- ],
110
- },
111
- {
112
- conditions: [
113
- {
114
- fn: "booleanEquals",
115
- argv: [
116
- {
117
- ref: "UseFIPS",
118
- },
119
- true,
120
- ],
121
- },
122
- {
123
- fn: "booleanEquals",
124
- argv: [
125
- {
126
- ref: "UseDualStack",
127
- },
128
- true,
129
- ],
130
- },
131
- ],
132
- type: "tree",
133
- rules: [
134
- {
135
- conditions: [
136
- {
137
- fn: "booleanEquals",
138
- argv: [
139
- true,
140
- {
141
- fn: "getAttr",
142
- argv: [
143
- {
144
- ref: "PartitionResult",
145
- },
146
- "supportsFIPS",
147
- ],
148
- },
149
- ],
150
- },
151
- {
152
- fn: "booleanEquals",
153
- argv: [
154
- true,
155
- {
156
- fn: "getAttr",
157
- argv: [
158
- {
159
- ref: "PartitionResult",
160
- },
161
- "supportsDualStack",
162
- ],
163
- },
164
- ],
165
- },
166
- ],
167
- type: "tree",
168
- rules: [
169
- {
170
- conditions: [],
171
- endpoint: {
172
- url: "https://ec2-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",
173
- properties: {},
174
- headers: {},
175
- },
176
- type: "endpoint",
177
- },
178
- ],
179
- },
180
- {
181
- conditions: [],
182
- error: "FIPS and DualStack are enabled, but this partition does not support one or both",
183
- type: "error",
184
- },
185
- ],
186
- },
187
- {
188
- conditions: [
189
- {
190
- fn: "booleanEquals",
191
- argv: [
192
- {
193
- ref: "UseFIPS",
194
- },
195
- true,
196
- ],
197
- },
198
- ],
199
- type: "tree",
200
- rules: [
201
- {
202
- conditions: [
203
- {
204
- fn: "booleanEquals",
205
- argv: [
206
- true,
207
- {
208
- fn: "getAttr",
209
- argv: [
210
- {
211
- ref: "PartitionResult",
212
- },
213
- "supportsFIPS",
214
- ],
215
- },
216
- ],
217
- },
218
- ],
219
- type: "tree",
220
- rules: [
221
- {
222
- conditions: [],
223
- type: "tree",
224
- rules: [
225
- {
226
- conditions: [
227
- {
228
- fn: "stringEquals",
229
- argv: [
230
- "aws-us-gov",
231
- {
232
- fn: "getAttr",
233
- argv: [
234
- {
235
- ref: "PartitionResult",
236
- },
237
- "name",
238
- ],
239
- },
240
- ],
241
- },
242
- ],
243
- endpoint: {
244
- url: "https://ec2.{Region}.{PartitionResult#dnsSuffix}",
245
- properties: {},
246
- headers: {},
247
- },
248
- type: "endpoint",
249
- },
250
- {
251
- conditions: [],
252
- endpoint: {
253
- url: "https://ec2-fips.{Region}.{PartitionResult#dnsSuffix}",
254
- properties: {},
255
- headers: {},
256
- },
257
- type: "endpoint",
258
- },
259
- ],
260
- },
261
- ],
262
- },
263
- {
264
- conditions: [],
265
- error: "FIPS is enabled but this partition does not support FIPS",
266
- type: "error",
267
- },
268
- ],
269
- },
270
- {
271
- conditions: [
272
- {
273
- fn: "booleanEquals",
274
- argv: [
275
- {
276
- ref: "UseDualStack",
277
- },
278
- true,
279
- ],
280
- },
281
- ],
282
- type: "tree",
283
- rules: [
284
- {
285
- conditions: [
286
- {
287
- fn: "booleanEquals",
288
- argv: [
289
- true,
290
- {
291
- fn: "getAttr",
292
- argv: [
293
- {
294
- ref: "PartitionResult",
295
- },
296
- "supportsDualStack",
297
- ],
298
- },
299
- ],
300
- },
301
- ],
302
- type: "tree",
303
- rules: [
304
- {
305
- conditions: [],
306
- endpoint: {
307
- url: "https://ec2.{Region}.{PartitionResult#dualStackDnsSuffix}",
308
- properties: {},
309
- headers: {},
310
- },
311
- type: "endpoint",
312
- },
313
- ],
314
- },
315
- {
316
- conditions: [],
317
- error: "DualStack is enabled but this partition does not support DualStack",
318
- type: "error",
319
- },
320
- ],
321
- },
322
- {
323
- conditions: [],
324
- endpoint: {
325
- url: "https://ec2.{Region}.{PartitionResult#dnsSuffix}",
326
- properties: {},
327
- headers: {},
328
- },
329
- type: "endpoint",
330
- },
331
- ],
332
- },
333
- ],
334
- };
4
+ const u = "fn", v = "argv", w = "ref";
5
+ const a = true, b = false, c = "String", d = "Boolean", e = "PartitionResult", f = "tree", g = "error", h = "endpoint", i = "getAttr", j = { [w]: "Endpoint" }, k = { [u]: "booleanEquals", [v]: [{ [w]: "UseFIPS" }, true] }, l = { [u]: "booleanEquals", [v]: [{ [w]: "UseDualStack" }, true] }, m = {}, n = { [u]: "booleanEquals", [v]: [true, { [u]: i, [v]: [{ [w]: e }, "supportsFIPS"] }] }, o = { [w]: e }, p = { [u]: "booleanEquals", [v]: [true, { [u]: i, [v]: [o, "supportsDualStack"] }] }, q = { "url": "https://ec2.{Region}.{PartitionResult#dnsSuffix}", "properties": {}, "headers": {} }, r = [k], s = [], t = [l];
6
+ const _data = { version: "1.0", parameters: { Region: { builtIn: "AWS::Region", required: a, documentation: "The AWS region used to dispatch the request.", type: c }, UseDualStack: { builtIn: "AWS::UseDualStack", required: a, default: b, documentation: "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", type: d }, UseFIPS: { builtIn: "AWS::UseFIPS", required: a, default: b, documentation: "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", type: d }, Endpoint: { builtIn: "SDK::Endpoint", required: b, documentation: "Override the endpoint used to send this request", type: c } }, rules: [{ conditions: [{ [u]: "aws.partition", [v]: [{ [w]: "Region" }], assign: e }], type: f, rules: [{ conditions: [{ [u]: "isSet", [v]: [j] }], type: f, rules: [{ conditions: r, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: g }, { conditions: s, type: f, rules: [{ conditions: t, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: g }, { conditions: s, endpoint: { url: j, properties: m, headers: m }, type: h }] }] }, { conditions: [k, l], type: f, rules: [{ conditions: [n, p], type: f, rules: [{ conditions: s, endpoint: { url: "https://ec2-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: h }] }, { conditions: s, error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: g }] }, { conditions: r, type: f, rules: [{ conditions: [n], type: f, rules: [{ conditions: s, type: f, rules: [{ conditions: [{ [u]: "stringEquals", [v]: ["aws-us-gov", { [u]: i, [v]: [o, "name"] }] }], endpoint: q, type: h }, { conditions: s, endpoint: { url: "https://ec2-fips.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: h }] }] }, { conditions: s, error: "FIPS is enabled but this partition does not support FIPS", type: g }] }, { conditions: t, type: f, rules: [{ conditions: [p], type: f, rules: [{ conditions: s, endpoint: { url: "https://ec2.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: h }] }, { conditions: s, error: "DualStack is enabled but this partition does not support DualStack", type: g }] }, { conditions: s, endpoint: q, type: h }] }] };
7
+ exports.ruleSet = _data;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paginateDescribeImages = void 0;
4
+ const DescribeImagesCommand_1 = require("../commands/DescribeImagesCommand");
5
+ const EC2_1 = require("../EC2");
6
+ const EC2Client_1 = require("../EC2Client");
7
+ const makePagedClientRequest = async (client, input, ...args) => {
8
+ return await client.send(new DescribeImagesCommand_1.DescribeImagesCommand(input), ...args);
9
+ };
10
+ const makePagedRequest = async (client, input, ...args) => {
11
+ return await client.describeImages(input, ...args);
12
+ };
13
+ async function* paginateDescribeImages(config, input, ...additionalArguments) {
14
+ let token = config.startingToken || undefined;
15
+ let hasNext = true;
16
+ let page;
17
+ while (hasNext) {
18
+ input.NextToken = token;
19
+ input["MaxResults"] = config.pageSize;
20
+ if (config.client instanceof EC2_1.EC2) {
21
+ page = await makePagedRequest(config.client, input, ...additionalArguments);
22
+ }
23
+ else if (config.client instanceof EC2Client_1.EC2Client) {
24
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
25
+ }
26
+ else {
27
+ throw new Error("Invalid client, expected EC2 | EC2Client");
28
+ }
29
+ yield page;
30
+ const prevToken = token;
31
+ token = page.NextToken;
32
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
33
+ }
34
+ return undefined;
35
+ }
36
+ exports.paginateDescribeImages = paginateDescribeImages;
@@ -28,6 +28,7 @@ tslib_1.__exportStar(require("./DescribeHostReservationOfferingsPaginator"), exp
28
28
  tslib_1.__exportStar(require("./DescribeHostReservationsPaginator"), exports);
29
29
  tslib_1.__exportStar(require("./DescribeHostsPaginator"), exports);
30
30
  tslib_1.__exportStar(require("./DescribeIamInstanceProfileAssociationsPaginator"), exports);
31
+ tslib_1.__exportStar(require("./DescribeImagesPaginator"), exports);
31
32
  tslib_1.__exportStar(require("./DescribeImportImageTasksPaginator"), exports);
32
33
  tslib_1.__exportStar(require("./DescribeImportSnapshotTasksPaginator"), exports);
33
34
  tslib_1.__exportStar(require("./DescribeInstanceCreditSpecificationsPaginator"), exports);
@@ -30387,6 +30387,12 @@ const serializeAws_ec2DescribeImagesRequest = (input, context) => {
30387
30387
  if (input.DryRun != null) {
30388
30388
  entries["DryRun"] = input.DryRun;
30389
30389
  }
30390
+ if (input.MaxResults != null) {
30391
+ entries["MaxResults"] = input.MaxResults;
30392
+ }
30393
+ if (input.NextToken != null) {
30394
+ entries["NextToken"] = input.NextToken;
30395
+ }
30390
30396
  return entries;
30391
30397
  };
30392
30398
  const serializeAws_ec2DescribeImportImageTasksRequest = (input, context) => {
@@ -50451,6 +50457,7 @@ const deserializeAws_ec2DescribeIdFormatResult = (output, context) => {
50451
50457
  const deserializeAws_ec2DescribeImagesResult = (output, context) => {
50452
50458
  const contents = {
50453
50459
  Images: undefined,
50460
+ NextToken: undefined,
50454
50461
  };
50455
50462
  if (output.imagesSet === "") {
50456
50463
  contents.Images = [];
@@ -50458,6 +50465,9 @@ const deserializeAws_ec2DescribeImagesResult = (output, context) => {
50458
50465
  else if (output["imagesSet"] !== undefined && output["imagesSet"]["item"] !== undefined) {
50459
50466
  contents.Images = deserializeAws_ec2ImageList((0, smithy_client_1.getArrayIfSingleItem)(output["imagesSet"]["item"]), context);
50460
50467
  }
50468
+ if (output["nextToken"] !== undefined) {
50469
+ contents.NextToken = (0, smithy_client_1.expectString)(output["nextToken"]);
50470
+ }
50461
50471
  return contents;
50462
50472
  };
50463
50473
  const deserializeAws_ec2DescribeImportImageTasksResult = (output, context) => {