@aws-cdk/toolkit-lib 0.1.4 → 0.1.5

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 (77) hide show
  1. package/build-info.json +2 -2
  2. package/lib/actions/bootstrap/index.d.ts +1 -1
  3. package/lib/actions/bootstrap/index.js +1 -1
  4. package/lib/actions/bootstrap/private/helpers.d.ts +1 -1
  5. package/lib/actions/bootstrap/private/helpers.js +1 -1
  6. package/lib/actions/deploy/index.d.ts +4 -2
  7. package/lib/actions/deploy/index.js +4 -1
  8. package/lib/actions/deploy/private/deploy-options.d.ts +1 -1
  9. package/lib/actions/deploy/private/deploy-options.js +1 -1
  10. package/lib/actions/deploy/private/helpers.d.ts +3 -2
  11. package/lib/actions/deploy/private/helpers.js +1 -1
  12. package/lib/actions/diff/private/helpers.d.ts +5 -5
  13. package/lib/actions/diff/private/helpers.js +13 -11
  14. package/lib/actions/list/index.d.ts +0 -4
  15. package/lib/actions/list/index.js +1 -1
  16. package/lib/api/aws-cdk.d.ts +3 -4
  17. package/lib/api/aws-cdk.js +948 -548
  18. package/lib/api/aws-cdk.js.map +4 -4
  19. package/lib/api/cloud-assembly/index.d.ts +1 -1
  20. package/lib/api/cloud-assembly/index.js +2 -2
  21. package/lib/api/cloud-assembly/private/cached-source.d.ts +2 -2
  22. package/lib/api/cloud-assembly/private/cached-source.js +1 -1
  23. package/lib/api/cloud-assembly/private/context-aware-source.d.ts +4 -4
  24. package/lib/api/cloud-assembly/private/context-aware-source.js +11 -12
  25. package/lib/api/cloud-assembly/private/identity-source.d.ts +1 -1
  26. package/lib/api/cloud-assembly/private/identity-source.js +1 -1
  27. package/lib/api/cloud-assembly/private/prepare-source.d.ts +5 -5
  28. package/lib/api/cloud-assembly/private/prepare-source.js +8 -6
  29. package/lib/api/cloud-assembly/private/source-builder.d.ts +4 -4
  30. package/lib/api/cloud-assembly/private/source-builder.js +24 -12
  31. package/lib/api/cloud-assembly/private/stack-assembly.d.ts +3 -3
  32. package/lib/api/cloud-assembly/private/stack-assembly.js +1 -1
  33. package/lib/api/cloud-assembly/private/stack-selectors.d.ts +1 -1
  34. package/lib/api/cloud-assembly/private/stack-selectors.js +1 -1
  35. package/lib/api/cloud-assembly/source-builder.d.ts +36 -0
  36. package/lib/api/cloud-assembly/source-builder.js +1 -1
  37. package/lib/api/cloud-assembly/stack-selector.d.ts +2 -81
  38. package/lib/api/cloud-assembly/stack-selector.js +5 -62
  39. package/lib/api/io/private/index.d.ts +3 -5
  40. package/lib/api/io/private/index.js +7 -6
  41. package/lib/api/io/private/io-host-wrappers.d.ts +17 -0
  42. package/lib/api/io/private/io-host-wrappers.js +74 -0
  43. package/lib/api/io/private/sdk-logger.d.ts +3 -0
  44. package/lib/api/io/private/sdk-logger.js +124 -0
  45. package/lib/api/shared-private.js +655 -26
  46. package/lib/api/shared-private.js.map +4 -4
  47. package/lib/api/shared-public.d.ts +2365 -31
  48. package/lib/api/shared-public.js +78 -5
  49. package/lib/api/shared-public.js.map +4 -4
  50. package/lib/index.d.ts +3 -0
  51. package/lib/index.js +4 -1
  52. package/lib/private/util.js +9 -4
  53. package/lib/private/util.js.map +2 -2
  54. package/lib/toolkit/index.d.ts +1 -1
  55. package/lib/toolkit/index.js +2 -2
  56. package/lib/toolkit/private/index.d.ts +4 -4
  57. package/lib/toolkit/private/index.js +1 -1
  58. package/lib/toolkit/toolkit.d.ts +6 -8
  59. package/lib/toolkit/toolkit.js +148 -122
  60. package/lib/util/concurrency.d.ts +1 -1
  61. package/lib/util/concurrency.js +2 -2
  62. package/package.json +5 -4
  63. package/CODE_REGISTRY.md +0 -38
  64. package/lib/api/cloud-assembly/context.d.ts +0 -9
  65. package/lib/api/cloud-assembly/context.js +0 -3
  66. package/lib/api/io/private/codes.d.ts +0 -47
  67. package/lib/api/io/private/codes.js +0 -175
  68. package/lib/api/io/private/level-priority.d.ts +0 -11
  69. package/lib/api/io/private/level-priority.js +0 -33
  70. package/lib/api/io/private/logger.d.ts +0 -31
  71. package/lib/api/io/private/logger.js +0 -190
  72. package/lib/api/io/private/messages.d.ts +0 -62
  73. package/lib/api/io/private/messages.js +0 -162
  74. package/lib/api/io/private/timer.d.ts +0 -29
  75. package/lib/api/io/private/timer.js +0 -55
  76. package/lib/toolkit/types.d.ts +0 -76
  77. package/lib/toolkit/types.js +0 -3
@@ -1,3 +1,88 @@
1
+ import * as cxapi from '@aws-cdk/cx-api';
2
+ import { CloudFormationStackArtifact } from '@aws-cdk/cx-api';
3
+ import { StackEvent } from '@aws-sdk/client-cloudformation';
4
+
5
+ /**
6
+ * Which stacks should be selected from a cloud assembly
7
+ */
8
+ export declare enum StackSelectionStrategy {
9
+ /**
10
+ * Returns all stacks in the app regardless of patterns,
11
+ * including stacks inside nested assemblies.
12
+ */
13
+ ALL_STACKS = "all-stacks",
14
+ /**
15
+ * Returns all stacks in the main (top level) assembly only.
16
+ */
17
+ MAIN_ASSEMBLY = "main-assembly",
18
+ /**
19
+ * If the assembly includes a single stack, returns it.
20
+ * Otherwise throws an exception.
21
+ */
22
+ ONLY_SINGLE = "only-single",
23
+ /**
24
+ * Return stacks matched by patterns.
25
+ * If no stacks are found, execution is halted successfully.
26
+ * Most likely you don't want to use this but `StackSelectionStrategy.MUST_MATCH_PATTERN`
27
+ */
28
+ PATTERN_MATCH = "pattern-match",
29
+ /**
30
+ * Return stacks matched by patterns.
31
+ * Throws an exception if the patterns don't match at least one stack in the assembly.
32
+ */
33
+ PATTERN_MUST_MATCH = "pattern-must-match",
34
+ /**
35
+ * Returns if exactly one stack is matched by the pattern(s).
36
+ * Throws an exception if no stack, or more than exactly one stack are matched.
37
+ */
38
+ PATTERN_MUST_MATCH_SINGLE = "pattern-must-match-single"
39
+ }
40
+ /**
41
+ * When selecting stacks, what other stacks to include because of dependencies
42
+ */
43
+ export declare enum ExpandStackSelection {
44
+ /**
45
+ * Don't select any extra stacks
46
+ */
47
+ NONE = "none",
48
+ /**
49
+ * Include stacks that this stack depends on
50
+ */
51
+ UPSTREAM = "upstream",
52
+ /**
53
+ * Include stacks that depend on this stack
54
+ */
55
+ DOWNSTREAM = "downstream"
56
+ }
57
+ /**
58
+ * A specification of which stacks should be selected
59
+ */
60
+ export interface StackSelector {
61
+ /**
62
+ * The behavior if if no selectors are provided.
63
+ */
64
+ strategy: StackSelectionStrategy;
65
+ /**
66
+ * A list of patterns to match the stack hierarchical ids
67
+ * Only used with `PATTERN_*` selection strategies.
68
+ */
69
+ patterns?: string[];
70
+ /**
71
+ * Expand the selection to upstream/downstream stacks.
72
+ * @default ExpandStackSelection.None only select the specified/matched stacks
73
+ */
74
+ expand?: ExpandStackSelection;
75
+ /**
76
+ * By default, we throw an exception if the assembly contains no stacks.
77
+ * Set to `false`, to halt execution for empty assemblies without error.
78
+ *
79
+ * Note that actions can still throw if a stack selection result is empty,
80
+ * but the assembly contains stacks in principle.
81
+ *
82
+ * @default true
83
+ */
84
+ failOnEmpty?: boolean;
85
+ }
1
86
  /**
2
87
  * The current action being performed by the CLI. 'none' represents the absence of an action.
3
88
  */
@@ -54,10 +139,19 @@ export interface IoMessage<T> {
54
139
  * This is safe to print to an end-user.
55
140
  */
56
141
  readonly message: string;
142
+ /**
143
+ * Identifies the message span, this message belongs to.
144
+ *
145
+ * A message span, groups multiple messages together that semantically related to the same operation.
146
+ * This is an otherwise meaningless identifier.
147
+ *
148
+ * A message without a `spanId`, does not belong to a span.
149
+ */
150
+ readonly span?: string;
57
151
  /**
58
152
  * The data attached to the message.
59
153
  */
60
- readonly data?: T;
154
+ readonly data: T;
61
155
  }
62
156
  /**
63
157
  * An IO request emitted.
@@ -73,7 +167,7 @@ export interface IIoHost {
73
167
  * Notifies the host of a message.
74
168
  * The caller waits until the notification completes.
75
169
  */
76
- notify<T>(msg: IoMessage<T>): Promise<void>;
170
+ notify(msg: IoMessage<unknown>): Promise<void>;
77
171
  /**
78
172
  * Notifies the host of a message that requires a response.
79
173
  *
@@ -82,49 +176,2289 @@ export interface IIoHost {
82
176
  */
83
177
  requestResponse<T, U>(msg: IoRequest<T, U>): Promise<U>;
84
178
  }
85
- /**
86
- * Represents a general toolkit error in the AWS CDK Toolkit.
87
- */
88
- export declare class ToolkitError extends Error {
179
+ interface BootstrapRole {
89
180
  /**
90
- * Determines if a given error is an instance of ToolkitError.
181
+ * The ARN of the IAM role created as part of bootrapping
182
+ * e.g. lookupRoleArn
91
183
  */
92
- static isToolkitError(x: any): x is ToolkitError;
184
+ readonly arn: string;
93
185
  /**
94
- * Determines if a given error is an instance of AuthenticationError.
186
+ * External ID to use when assuming the bootstrap role
187
+ *
188
+ * @default - No external ID
95
189
  */
96
- static isAuthenticationError(x: any): x is AuthenticationError;
190
+ readonly assumeRoleExternalId?: string;
97
191
  /**
98
- * Determines if a given error is an instance of AssemblyError.
192
+ * Additional options to pass to STS when assuming the role.
193
+ *
194
+ * - `RoleArn` should not be used. Use the dedicated `arn` property instead.
195
+ * - `ExternalId` should not be used. Use the dedicated `assumeRoleExternalId` instead.
196
+ *
197
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#assumeRole-property
198
+ * @default - No additional options.
99
199
  */
100
- static isAssemblyError(x: any): x is AssemblyError;
200
+ readonly assumeRoleAdditionalOptions?: {
201
+ [key: string]: any;
202
+ };
101
203
  /**
102
- * Determines if a given error is an instance of AssemblyError.
204
+ * Version of bootstrap stack required to use this role
205
+ *
206
+ * @default - No bootstrap stack required
103
207
  */
104
- static isContextProviderError(x: any): x is ContextProviderError;
208
+ readonly requiresBootstrapStackVersion?: number;
105
209
  /**
106
- * The type of the error, defaults to "toolkit".
210
+ * Name of SSM parameter with bootstrap stack version
211
+ *
212
+ * @default - Discover SSM parameter by reading stack
213
+ */
214
+ readonly bootstrapStackVersionSsmParameter?: string;
215
+ }
216
+ interface AwsCloudFormationStackProperties {
217
+ /**
218
+ * A file relative to the assembly root which contains the CloudFormation template for this stack.
219
+ */
220
+ readonly templateFile: string;
221
+ /**
222
+ * Values for CloudFormation stack parameters that should be passed when the stack is deployed.
223
+ *
224
+ * @default - No parameters
225
+ */
226
+ readonly parameters?: {
227
+ [id: string]: string;
228
+ };
229
+ /**
230
+ * Values for CloudFormation stack tags that should be passed when the stack is deployed.
231
+ *
232
+ * @default - No tags
233
+ */
234
+ readonly tags?: {
235
+ [id: string]: string;
236
+ };
237
+ /**
238
+ * SNS Notification ARNs that should receive CloudFormation Stack Events.
239
+ *
240
+ * @default - No notification arns
241
+ */
242
+ readonly notificationArns?: string[];
243
+ /**
244
+ * The name to use for the CloudFormation stack.
245
+ * @default - name derived from artifact ID
246
+ */
247
+ readonly stackName?: string;
248
+ /**
249
+ * Whether to enable termination protection for this stack.
250
+ *
251
+ * @default false
252
+ */
253
+ readonly terminationProtection?: boolean;
254
+ /**
255
+ * The role that needs to be assumed to deploy the stack
256
+ *
257
+ * @default - No role is assumed (current credentials are used)
258
+ */
259
+ readonly assumeRoleArn?: string;
260
+ /**
261
+ * External ID to use when assuming role for cloudformation deployments
262
+ *
263
+ * @default - No external ID
264
+ */
265
+ readonly assumeRoleExternalId?: string;
266
+ /**
267
+ * Additional options to pass to STS when assuming the role.
268
+ *
269
+ * - `RoleArn` should not be used. Use the dedicated `assumeRoleArn` property instead.
270
+ * - `ExternalId` should not be used. Use the dedicated `assumeRoleExternalId` instead.
271
+ *
272
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#assumeRole-property
273
+ * @default - No additional options.
274
+ */
275
+ readonly assumeRoleAdditionalOptions?: {
276
+ [key: string]: any;
277
+ };
278
+ /**
279
+ * The role that is passed to CloudFormation to execute the change set
280
+ *
281
+ * @default - No role is passed (currently assumed role/credentials are used)
282
+ */
283
+ readonly cloudFormationExecutionRoleArn?: string;
284
+ /**
285
+ * The role to use to look up values from the target AWS account
286
+ *
287
+ * @default - No role is assumed (current credentials are used)
288
+ */
289
+ readonly lookupRole?: BootstrapRole;
290
+ /**
291
+ * If the stack template has already been included in the asset manifest, its asset URL
292
+ *
293
+ * @default - Not uploaded yet, upload just before deploying
294
+ */
295
+ readonly stackTemplateAssetObjectUrl?: string;
296
+ /**
297
+ * Version of bootstrap stack required to deploy this stack
298
+ *
299
+ * @default - No bootstrap stack required
300
+ */
301
+ readonly requiresBootstrapStackVersion?: number;
302
+ /**
303
+ * SSM parameter where the bootstrap stack version number can be found
304
+ *
305
+ * Only used if `requiresBootstrapStackVersion` is set.
306
+ *
307
+ * - If this value is not set, the bootstrap stack name must be known at
308
+ * deployment time so the stack version can be looked up from the stack
309
+ * outputs.
310
+ * - If this value is set, the bootstrap stack can have any name because
311
+ * we won't need to look it up.
312
+ *
313
+ * @default - Bootstrap stack version number looked up
314
+ */
315
+ readonly bootstrapStackVersionSsmParameter?: string;
316
+ /**
317
+ * Whether this stack should be validated by the CLI after synthesis
318
+ *
319
+ * @default - false
320
+ */
321
+ readonly validateOnSynth?: boolean;
322
+ }
323
+ interface AssetManifestOptions {
324
+ /**
325
+ * Version of bootstrap stack required to deploy this stack
326
+ *
327
+ * @default - Version 1 (basic modern bootstrap stack)
328
+ */
329
+ readonly requiresBootstrapStackVersion?: number;
330
+ /**
331
+ * SSM parameter where the bootstrap stack version number can be found
332
+ *
333
+ * - If this value is not set, the bootstrap stack name must be known at
334
+ * deployment time so the stack version can be looked up from the stack
335
+ * outputs.
336
+ * - If this value is set, the bootstrap stack can have any name because
337
+ * we won't need to look it up.
338
+ *
339
+ * @default - Bootstrap stack version number looked up
340
+ */
341
+ readonly bootstrapStackVersionSsmParameter?: string;
342
+ }
343
+ interface AssetManifestProperties extends AssetManifestOptions {
344
+ /**
345
+ * Filename of the asset manifest
346
+ */
347
+ readonly file: string;
348
+ }
349
+ interface TreeArtifactProperties {
350
+ /**
351
+ * Filename of the tree artifact
352
+ */
353
+ readonly file: string;
354
+ }
355
+ interface NestedCloudAssemblyProperties {
356
+ /**
357
+ * Relative path to the nested cloud assembly
358
+ */
359
+ readonly directoryName: string;
360
+ /**
361
+ * Display name for the cloud assembly
362
+ *
363
+ * @default - The artifact ID
364
+ */
365
+ readonly displayName?: string;
366
+ }
367
+ type ArtifactProperties = AwsCloudFormationStackProperties | AssetManifestProperties | TreeArtifactProperties | NestedCloudAssemblyProperties;
368
+ interface BaseAssetMetadataEntry {
369
+ /**
370
+ * Requested packaging style
371
+ */
372
+ readonly packaging: string;
373
+ /**
374
+ * Logical identifier for the asset
375
+ */
376
+ readonly id: string;
377
+ /**
378
+ * The hash of the asset source.
379
+ */
380
+ readonly sourceHash: string;
381
+ /**
382
+ * Path on disk to the asset
383
+ */
384
+ readonly path: string;
385
+ }
386
+ interface FileAssetMetadataEntry extends BaseAssetMetadataEntry {
387
+ /**
388
+ * Requested packaging style
389
+ */
390
+ readonly packaging: "zip" | "file";
391
+ /**
392
+ * Name of parameter where S3 bucket should be passed in
393
+ */
394
+ readonly s3BucketParameter: string;
395
+ /**
396
+ * Name of parameter where S3 key should be passed in
397
+ */
398
+ readonly s3KeyParameter: string;
399
+ /**
400
+ * The name of the parameter where the hash of the bundled asset should be passed in.
401
+ */
402
+ readonly artifactHashParameter: string;
403
+ }
404
+ interface Tag {
405
+ /**
406
+ * Tag key.
407
+ *
408
+ * (In the actual file on disk this will be cased as "Key", and the structure is
409
+ * patched to match this structure upon loading:
410
+ * https://github.com/aws/aws-cdk/blob/4aadaa779b48f35838cccd4e25107b2338f05547/packages/%40aws-cdk/cloud-assembly-schema/lib/manifest.ts#L137)
411
+ */
412
+ readonly key: string;
413
+ /**
414
+ * Tag value.
415
+ *
416
+ * (In the actual file on disk this will be cased as "Value", and the structure is
417
+ * patched to match this structure upon loading:
418
+ * https://github.com/aws/aws-cdk/blob/4aadaa779b48f35838cccd4e25107b2338f05547/packages/%40aws-cdk/cloud-assembly-schema/lib/manifest.ts#L137)
419
+ */
420
+ readonly value: string;
421
+ }
422
+ interface ContainerImageAssetCacheOption {
423
+ /**
424
+ * The type of cache to use.
425
+ * Refer to https://docs.docker.com/build/cache/backends/ for full list of backends.
426
+ * @default - unspecified
427
+ *
428
+ * @example 'registry'
107
429
  */
108
430
  readonly type: string;
109
- constructor(message: string, type?: string);
431
+ /**
432
+ * Any parameters to pass into the docker cache backend configuration.
433
+ * Refer to https://docs.docker.com/build/cache/backends/ for cache backend configuration.
434
+ * @default {} No options provided
435
+ *
436
+ * @example
437
+ * declare const branch: string;
438
+ *
439
+ * const params = {
440
+ * ref: `12345678.dkr.ecr.us-west-2.amazonaws.com/cache:${branch}`,
441
+ * mode: "max",
442
+ * };
443
+ */
444
+ readonly params?: {
445
+ [key: string]: string;
446
+ };
110
447
  }
111
- /**
112
- * Represents an authentication-specific error in the AWS CDK Toolkit.
113
- */
114
- export declare class AuthenticationError extends ToolkitError {
115
- constructor(message: string);
448
+ interface ContainerImageAssetMetadataEntry extends BaseAssetMetadataEntry {
449
+ /**
450
+ * Type of asset
451
+ */
452
+ readonly packaging: "container-image";
453
+ /**
454
+ * ECR Repository name and repo digest (separated by "@sha256:") where this
455
+ * image is stored.
456
+ *
457
+ * @default undefined If not specified, `repositoryName` and `imageTag` are
458
+ * required because otherwise how will the stack know where to find the asset,
459
+ * ha?
460
+ * @deprecated specify `repositoryName` and `imageTag` instead, and then you
461
+ * know where the image will go.
462
+ */
463
+ readonly imageNameParameter?: string;
464
+ /**
465
+ * ECR repository name, if omitted a default name based on the asset's ID is
466
+ * used instead. Specify this property if you need to statically address the
467
+ * image, e.g. from a Kubernetes Pod. Note, this is only the repository name,
468
+ * without the registry and the tag parts.
469
+ *
470
+ * @default - this parameter is REQUIRED after 1.21.0
471
+ */
472
+ readonly repositoryName?: string;
473
+ /**
474
+ * The docker image tag to use for tagging pushed images. This field is
475
+ * required if `imageParameterName` is ommited (otherwise, the app won't be
476
+ * able to find the image).
477
+ *
478
+ * @default - this parameter is REQUIRED after 1.21.0
479
+ */
480
+ readonly imageTag?: string;
481
+ /**
482
+ * Build args to pass to the `docker build` command
483
+ *
484
+ * @default no build args are passed
485
+ */
486
+ readonly buildArgs?: {
487
+ [key: string]: string;
488
+ };
489
+ /**
490
+ * SSH agent socket or keys to pass to the `docker build` command
491
+ *
492
+ * @default no ssh arg is passed
493
+ */
494
+ readonly buildSsh?: string;
495
+ /**
496
+ * Build secrets to pass to the `docker build` command
497
+ *
498
+ * @default no build secrets are passed
499
+ */
500
+ readonly buildSecrets?: {
501
+ [key: string]: string;
502
+ };
503
+ /**
504
+ * Docker target to build to
505
+ *
506
+ * @default no build target
507
+ */
508
+ readonly target?: string;
509
+ /**
510
+ * Path to the Dockerfile (relative to the directory).
511
+ *
512
+ * @default - no file is passed
513
+ */
514
+ readonly file?: string;
515
+ /**
516
+ * Networking mode for the RUN commands during build.
517
+ *
518
+ * @default - no networking mode specified
519
+ */
520
+ readonly networkMode?: string;
521
+ /**
522
+ * Platform to build for. _Requires Docker Buildx_.
523
+ *
524
+ * @default - current machine platform
525
+ */
526
+ readonly platform?: string;
527
+ /**
528
+ * Outputs to pass to the `docker build` command.
529
+ *
530
+ * @default - no outputs are passed to the build command (default outputs are used)
531
+ * @see https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs
532
+ */
533
+ readonly outputs?: string[];
534
+ /**
535
+ * Cache from options to pass to the `docker build` command.
536
+ *
537
+ * @default - no cache from options are passed to the build command
538
+ * @see https://docs.docker.com/build/cache/backends/
539
+ */
540
+ readonly cacheFrom?: ContainerImageAssetCacheOption[];
541
+ /**
542
+ * Cache to options to pass to the `docker build` command.
543
+ *
544
+ * @default - no cache to options are passed to the build command
545
+ * @see https://docs.docker.com/build/cache/backends/
546
+ */
547
+ readonly cacheTo?: ContainerImageAssetCacheOption;
548
+ /**
549
+ * Disable the cache and pass `--no-cache` to the `docker build` command.
550
+ *
551
+ * @default - cache is used
552
+ */
553
+ readonly cacheDisabled?: boolean;
116
554
  }
117
- /**
118
- * Represents an authentication-specific error in the AWS CDK Toolkit.
119
- */
120
- export declare class AssemblyError extends ToolkitError {
121
- constructor(message: string);
555
+ type AssetMetadataEntry = FileAssetMetadataEntry | ContainerImageAssetMetadataEntry;
556
+ type LogMessageMetadataEntry = string;
557
+ type LogicalIdMetadataEntry = string;
558
+ type StackTagsMetadataEntry = Tag[];
559
+ type PrimitiveType = boolean | number | string;
560
+ type MetadataEntryData = AssetMetadataEntry | LogMessageMetadataEntry | LogicalIdMetadataEntry | StackTagsMetadataEntry | PrimitiveType;
561
+ declare enum ArtifactMetadataEntryType {
562
+ /**
563
+ * Asset in metadata.
564
+ */
565
+ ASSET = "aws:cdk:asset",
566
+ /**
567
+ * Metadata key used to print INFO-level messages by the toolkit when an app is syntheized.
568
+ */
569
+ INFO = "aws:cdk:info",
570
+ /**
571
+ * Metadata key used to print WARNING-level messages by the toolkit when an app is syntheized.
572
+ */
573
+ WARN = "aws:cdk:warning",
574
+ /**
575
+ * Metadata key used to print ERROR-level messages by the toolkit when an app is syntheized.
576
+ */
577
+ ERROR = "aws:cdk:error",
578
+ /**
579
+ * Represents the CloudFormation logical ID of a resource at a certain path.
580
+ */
581
+ LOGICAL_ID = "aws:cdk:logicalId",
582
+ /**
583
+ * Represents tags of a stack.
584
+ */
585
+ STACK_TAGS = "aws:cdk:stack-tags"
122
586
  }
123
- /**
124
- * Represents an error originating from a Context Provider
125
- */
126
- export declare class ContextProviderError extends ToolkitError {
127
- constructor(message: string);
587
+ interface MetadataEntry {
588
+ /**
589
+ * The type of the metadata entry.
590
+ */
591
+ readonly type: string;
592
+ /**
593
+ * The data.
594
+ *
595
+ * @default - no data.
596
+ */
597
+ readonly data?: MetadataEntryData;
598
+ /**
599
+ * A stack trace for when the entry was created.
600
+ *
601
+ * @default - no trace.
602
+ */
603
+ readonly trace?: string[];
128
604
  }
605
+ declare enum ContextProvider {
606
+ /**
607
+ * AMI provider
608
+ */
609
+ AMI_PROVIDER = "ami",
610
+ /**
611
+ * AZ provider
612
+ */
613
+ AVAILABILITY_ZONE_PROVIDER = "availability-zones",
614
+ /**
615
+ * Route53 Hosted Zone provider
616
+ */
617
+ HOSTED_ZONE_PROVIDER = "hosted-zone",
618
+ /**
619
+ * SSM Parameter Provider
620
+ */
621
+ SSM_PARAMETER_PROVIDER = "ssm",
622
+ /**
623
+ * VPC Provider
624
+ */
625
+ VPC_PROVIDER = "vpc-provider",
626
+ /**
627
+ * VPC Endpoint Service AZ Provider
628
+ */
629
+ ENDPOINT_SERVICE_AVAILABILITY_ZONE_PROVIDER = "endpoint-service-availability-zones",
630
+ /**
631
+ * Load balancer provider
632
+ */
633
+ LOAD_BALANCER_PROVIDER = "load-balancer",
634
+ /**
635
+ * Load balancer listener provider
636
+ */
637
+ LOAD_BALANCER_LISTENER_PROVIDER = "load-balancer-listener",
638
+ /**
639
+ * Security group provider
640
+ */
641
+ SECURITY_GROUP_PROVIDER = "security-group",
642
+ /**
643
+ * KMS Key Provider
644
+ */
645
+ KEY_PROVIDER = "key-provider",
646
+ /**
647
+ * CCAPI Provider
648
+ */
649
+ CC_API_PROVIDER = "cc-api-provider",
650
+ /**
651
+ * A plugin provider (the actual plugin name will be in the properties)
652
+ */
653
+ PLUGIN = "plugin"
654
+ }
655
+ interface ContextLookupRoleOptions {
656
+ /**
657
+ * Query account
658
+ */
659
+ readonly account: string;
660
+ /**
661
+ * Query region
662
+ */
663
+ readonly region: string;
664
+ /**
665
+ * The ARN of the role that should be used to look up the missing values
666
+ *
667
+ * @default - None
668
+ */
669
+ readonly lookupRoleArn?: string;
670
+ /**
671
+ * The ExternalId that needs to be supplied while assuming this role
672
+ *
673
+ * @default - No ExternalId will be supplied
674
+ */
675
+ readonly lookupRoleExternalId?: string;
676
+ /**
677
+ * Additional options to pass to STS when assuming the lookup role.
678
+ *
679
+ * - `RoleArn` should not be used. Use the dedicated `lookupRoleArn` property instead.
680
+ * - `ExternalId` should not be used. Use the dedicated `lookupRoleExternalId` instead.
681
+ *
682
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#assumeRole-property
683
+ * @default - No additional options.
684
+ */
685
+ readonly assumeRoleAdditionalOptions?: {
686
+ [key: string]: any;
687
+ };
688
+ }
689
+ interface AmiContextQuery extends ContextLookupRoleOptions {
690
+ /**
691
+ * Owners to DescribeImages call
692
+ *
693
+ * @default - All owners
694
+ */
695
+ readonly owners?: string[];
696
+ /**
697
+ * Filters to DescribeImages call
698
+ */
699
+ readonly filters: {
700
+ [key: string]: string[];
701
+ };
702
+ }
703
+ interface AvailabilityZonesContextQuery extends ContextLookupRoleOptions {
704
+ }
705
+ interface HostedZoneContextQuery extends ContextLookupRoleOptions {
706
+ /**
707
+ * The domain name e.g. example.com to lookup
708
+ */
709
+ readonly domainName: string;
710
+ /**
711
+ * True if the zone you want to find is a private hosted zone
712
+ *
713
+ * @default false
714
+ */
715
+ readonly privateZone?: boolean;
716
+ /**
717
+ * The VPC ID to that the private zone must be associated with
718
+ *
719
+ * If you provide VPC ID and privateZone is false, this will return no results
720
+ * and raise an error.
721
+ *
722
+ * @default - Required if privateZone=true
723
+ */
724
+ readonly vpcId?: string;
725
+ }
726
+ interface SSMParameterContextQuery extends ContextLookupRoleOptions {
727
+ /**
728
+ * Parameter name to query
729
+ */
730
+ readonly parameterName: string;
731
+ }
732
+ interface VpcContextQuery extends ContextLookupRoleOptions {
733
+ /**
734
+ * Filters to apply to the VPC
735
+ *
736
+ * Filter parameters are the same as passed to DescribeVpcs.
737
+ *
738
+ * @see https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html
739
+ */
740
+ readonly filter: {
741
+ [key: string]: string;
742
+ };
743
+ /**
744
+ * Whether to populate the subnetGroups field of the `VpcContextResponse`,
745
+ * which contains potentially asymmetric subnet groups.
746
+ *
747
+ * @default false
748
+ */
749
+ readonly returnAsymmetricSubnets?: boolean;
750
+ /**
751
+ * Optional tag for subnet group name.
752
+ * If not provided, we'll look at the aws-cdk:subnet-name tag.
753
+ * If the subnet does not have the specified tag,
754
+ * we'll use its type as the name.
755
+ *
756
+ * @default 'aws-cdk:subnet-name'
757
+ */
758
+ readonly subnetGroupNameTag?: string;
759
+ /**
760
+ * Whether to populate the `vpnGatewayId` field of the `VpcContextResponse`,
761
+ * which contains the VPN Gateway ID, if one exists. You can explicitly
762
+ * disable this in order to avoid the lookup if you know the VPC does not have
763
+ * a VPN Gatway attached.
764
+ *
765
+ * @default true
766
+ */
767
+ readonly returnVpnGateways?: boolean;
768
+ }
769
+ interface EndpointServiceAvailabilityZonesContextQuery extends ContextLookupRoleOptions {
770
+ /**
771
+ * Query service name
772
+ */
773
+ readonly serviceName: string;
774
+ }
775
+ declare enum LoadBalancerType {
776
+ /**
777
+ * Network load balancer
778
+ */
779
+ NETWORK = "network",
780
+ /**
781
+ * Application load balancer
782
+ */
783
+ APPLICATION = "application"
784
+ }
785
+ interface LoadBalancerFilter extends ContextLookupRoleOptions {
786
+ /**
787
+ * Filter load balancers by their type
788
+ */
789
+ readonly loadBalancerType: LoadBalancerType;
790
+ /**
791
+ * Find by load balancer's ARN
792
+ * @default - does not search by load balancer arn
793
+ */
794
+ readonly loadBalancerArn?: string;
795
+ /**
796
+ * Match load balancer tags
797
+ * @default - does not match load balancers by tags
798
+ */
799
+ readonly loadBalancerTags?: Tag[];
800
+ }
801
+ interface LoadBalancerContextQuery extends LoadBalancerFilter {
802
+ }
803
+ declare enum LoadBalancerListenerProtocol {
804
+ /**
805
+ * HTTP protocol
806
+ */
807
+ HTTP = "HTTP",
808
+ /**
809
+ * HTTPS protocol
810
+ */
811
+ HTTPS = "HTTPS",
812
+ /**
813
+ * TCP protocol
814
+ */
815
+ TCP = "TCP",
816
+ /**
817
+ * TLS protocol
818
+ */
819
+ TLS = "TLS",
820
+ /**
821
+ * UDP protocol
822
+ * */
823
+ UDP = "UDP",
824
+ /**
825
+ * TCP and UDP protocol
826
+ * */
827
+ TCP_UDP = "TCP_UDP"
828
+ }
829
+ interface LoadBalancerListenerContextQuery extends LoadBalancerFilter {
830
+ /**
831
+ * Find by listener's arn
832
+ * @default - does not find by listener arn
833
+ */
834
+ readonly listenerArn?: string;
835
+ /**
836
+ * Filter by listener protocol
837
+ * @default - does not filter by listener protocol
838
+ */
839
+ readonly listenerProtocol?: LoadBalancerListenerProtocol;
840
+ /**
841
+ * Filter listeners by listener port
842
+ * @default - does not filter by a listener port
843
+ */
844
+ readonly listenerPort?: number;
845
+ }
846
+ interface SecurityGroupContextQuery extends ContextLookupRoleOptions {
847
+ /**
848
+ * Security group id
849
+ *
850
+ * @default - None
851
+ */
852
+ readonly securityGroupId?: string;
853
+ /**
854
+ * Security group name
855
+ *
856
+ * @default - None
857
+ */
858
+ readonly securityGroupName?: string;
859
+ /**
860
+ * VPC ID
861
+ *
862
+ * @default - None
863
+ */
864
+ readonly vpcId?: string;
865
+ }
866
+ interface KeyContextQuery extends ContextLookupRoleOptions {
867
+ /**
868
+ * Alias name used to search the Key
869
+ */
870
+ readonly aliasName: string;
871
+ }
872
+ interface CcApiContextQuery extends ContextLookupRoleOptions {
873
+ /**
874
+ * The Cloudformation resource type.
875
+ * See https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/supported-resources.html
876
+ */
877
+ readonly typeName: string;
878
+ /**
879
+ * exactIdentifier of the resource.
880
+ * Specifying exactIdentifier will return at most one result.
881
+ * Either exactIdentifier or propertyMatch should be specified.
882
+ * @default - None
883
+ */
884
+ readonly exactIdentifier?: string;
885
+ /**
886
+ * This indicates the property to search for.
887
+ * If both exactIdentifier and propertyMatch are specified, then exactIdentifier is used.
888
+ * Specifying propertyMatch will return 0 or more results.
889
+ * Either exactIdentifier or propertyMatch should be specified.
890
+ * @default - None
891
+ */
892
+ readonly propertyMatch?: Record<string, unknown>;
893
+ /**
894
+ * This is a set of properties returned from CC API that we want to return from ContextQuery.
895
+ */
896
+ readonly propertiesToReturn: string[];
897
+ }
898
+ interface PluginContextQuery {
899
+ /**
900
+ * The name of the plugin
901
+ */
902
+ readonly pluginName: string;
903
+ /**
904
+ * Arbitrary other arguments for the plugin.
905
+ *
906
+ * This index signature is not usable in non-TypeScript/JavaScript languages.
907
+ *
908
+ * @jsii ignore
909
+ */
910
+ [key: string]: any;
911
+ }
912
+ type ContextQueryProperties = AmiContextQuery | AvailabilityZonesContextQuery | HostedZoneContextQuery | SSMParameterContextQuery | VpcContextQuery | EndpointServiceAvailabilityZonesContextQuery | LoadBalancerContextQuery | LoadBalancerListenerContextQuery | SecurityGroupContextQuery | KeyContextQuery | CcApiContextQuery | PluginContextQuery;
913
+ declare enum ArtifactType {
914
+ /**
915
+ * Stub required because of JSII.
916
+ */
917
+ NONE = "none",// required due to a jsii bug
918
+ /**
919
+ * The artifact is an AWS CloudFormation stack.
920
+ */
921
+ AWS_CLOUDFORMATION_STACK = "aws:cloudformation:stack",
922
+ /**
923
+ * The artifact contains the CDK application's construct tree.
924
+ */
925
+ CDK_TREE = "cdk:tree",
926
+ /**
927
+ * Manifest for all assets in the Cloud Assembly
928
+ */
929
+ ASSET_MANIFEST = "cdk:asset-manifest",
930
+ /**
931
+ * Nested Cloud Assembly
932
+ */
933
+ NESTED_CLOUD_ASSEMBLY = "cdk:cloud-assembly"
934
+ }
935
+ interface RuntimeInfo {
936
+ /**
937
+ * The list of libraries loaded in the application, associated with their versions.
938
+ */
939
+ readonly libraries: {
940
+ [name: string]: string;
941
+ };
942
+ }
943
+ interface MissingContext {
944
+ /**
945
+ * The missing context key.
946
+ */
947
+ readonly key: string;
948
+ /**
949
+ * The provider from which we expect this context key to be obtained.
950
+ */
951
+ readonly provider: ContextProvider;
952
+ /**
953
+ * A set of provider-specific options.
954
+ */
955
+ readonly props: ContextQueryProperties;
956
+ }
957
+ interface ArtifactManifest {
958
+ /**
959
+ * The type of artifact.
960
+ */
961
+ readonly type: ArtifactType;
962
+ /**
963
+ * The environment into which this artifact is deployed.
964
+ *
965
+ * @default - no envrionment.
966
+ */
967
+ readonly environment?: string;
968
+ /**
969
+ * Associated metadata.
970
+ *
971
+ * @default - no metadata.
972
+ */
973
+ readonly metadata?: {
974
+ [path: string]: MetadataEntry[];
975
+ };
976
+ /**
977
+ * IDs of artifacts that must be deployed before this artifact.
978
+ *
979
+ * @default - no dependencies.
980
+ */
981
+ readonly dependencies?: string[];
982
+ /**
983
+ * The set of properties for this artifact (depends on type)
984
+ *
985
+ * @default - no properties.
986
+ */
987
+ readonly properties?: ArtifactProperties;
988
+ /**
989
+ * A string that represents this artifact. Should only be used in user interfaces.
990
+ *
991
+ * @default - no display name
992
+ */
993
+ readonly displayName?: string;
994
+ }
995
+ interface AssemblyManifest {
996
+ /**
997
+ * Protocol version
998
+ */
999
+ readonly version: string;
1000
+ /**
1001
+ * Required CLI version, if available
1002
+ *
1003
+ * If the manifest producer knows, it can put the minimum version of the CLI
1004
+ * here that supports reading this assembly.
1005
+ *
1006
+ * If set, it can be used to show a more informative error message to users.
1007
+ *
1008
+ * @default - Minimum CLI version unknown
1009
+ */
1010
+ readonly minimumCliVersion?: string;
1011
+ /**
1012
+ * The set of artifacts in this assembly.
1013
+ *
1014
+ * @default - no artifacts.
1015
+ */
1016
+ readonly artifacts?: {
1017
+ [id: string]: ArtifactManifest;
1018
+ };
1019
+ /**
1020
+ * Missing context information. If this field has values, it means that the
1021
+ * cloud assembly is not complete and should not be deployed.
1022
+ *
1023
+ * @default - no missing context.
1024
+ */
1025
+ readonly missing?: MissingContext[];
1026
+ /**
1027
+ * Runtime information.
1028
+ *
1029
+ * @default - no info.
1030
+ */
1031
+ readonly runtime?: RuntimeInfo;
1032
+ }
1033
+ interface ICloudAssembly {
1034
+ /**
1035
+ * The directory of the cloud assembly.
1036
+ *
1037
+ * This directory will be used to read the Cloud Assembly from.
1038
+ * Its contents (in particular `manifest.json`) must comply with the schema defined in this package.
1039
+ */
1040
+ readonly directory: string;
1041
+ }
1042
+ interface AwsDestination {
1043
+ /**
1044
+ * The region where this asset will need to be published
1045
+ *
1046
+ * @default - Current region
1047
+ */
1048
+ readonly region?: string;
1049
+ /**
1050
+ * The role that needs to be assumed while publishing this asset
1051
+ *
1052
+ * @default - No role will be assumed
1053
+ */
1054
+ readonly assumeRoleArn?: string;
1055
+ /**
1056
+ * The ExternalId that needs to be supplied while assuming this role
1057
+ *
1058
+ * @default - No ExternalId will be supplied
1059
+ */
1060
+ readonly assumeRoleExternalId?: string;
1061
+ /**
1062
+ * Additional options to pass to STS when assuming the role.
1063
+ *
1064
+ * - `RoleArn` should not be used. Use the dedicated `assumeRoleArn` property instead.
1065
+ * - `ExternalId` should not be used. Use the dedicated `assumeRoleExternalId` instead.
1066
+ *
1067
+ * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#assumeRole-property
1068
+ * @default - No additional options.
1069
+ */
1070
+ readonly assumeRoleAdditionalOptions?: {
1071
+ [key: string]: any;
1072
+ };
1073
+ }
1074
+ interface DockerImageAsset {
1075
+ /**
1076
+ * A display name for this asset
1077
+ *
1078
+ * @default - The identifier will be used as the display name
1079
+ */
1080
+ readonly displayName?: string;
1081
+ /**
1082
+ * Source description for container assets
1083
+ */
1084
+ readonly source: DockerImageSource;
1085
+ /**
1086
+ * Destinations for this container asset
1087
+ */
1088
+ readonly destinations: {
1089
+ [id: string]: DockerImageDestination;
1090
+ };
1091
+ }
1092
+ interface DockerImageSource {
1093
+ /**
1094
+ * The directory containing the Docker image build instructions.
1095
+ *
1096
+ * This path is relative to the asset manifest location.
1097
+ *
1098
+ * @default - Exactly one of `directory` and `executable` is required
1099
+ */
1100
+ readonly directory?: string;
1101
+ /**
1102
+ * A command-line executable that returns the name of a local
1103
+ * Docker image on stdout after being run.
1104
+ *
1105
+ * @default - Exactly one of `directory` and `executable` is required
1106
+ */
1107
+ readonly executable?: string[];
1108
+ /**
1109
+ * The name of the file with build instructions
1110
+ *
1111
+ * Only allowed when `directory` is set.
1112
+ *
1113
+ * @default "Dockerfile"
1114
+ */
1115
+ readonly dockerFile?: string;
1116
+ /**
1117
+ * Target build stage in a Dockerfile with multiple build stages
1118
+ *
1119
+ * Only allowed when `directory` is set.
1120
+ *
1121
+ * @default - The last stage in the Dockerfile
1122
+ */
1123
+ readonly dockerBuildTarget?: string;
1124
+ /**
1125
+ * Additional build arguments
1126
+ *
1127
+ * Only allowed when `directory` is set.
1128
+ *
1129
+ * @default - No additional build arguments
1130
+ */
1131
+ readonly dockerBuildArgs?: {
1132
+ [name: string]: string;
1133
+ };
1134
+ /**
1135
+ * SSH agent socket or keys
1136
+ *
1137
+ * Requires building with docker buildkit.
1138
+ *
1139
+ * @default - No ssh flag is set
1140
+ */
1141
+ readonly dockerBuildSsh?: string;
1142
+ /**
1143
+ * Additional build secrets
1144
+ *
1145
+ * Only allowed when `directory` is set.
1146
+ *
1147
+ * @default - No additional build secrets
1148
+ */
1149
+ readonly dockerBuildSecrets?: {
1150
+ [name: string]: string;
1151
+ };
1152
+ /**
1153
+ * Networking mode for the RUN commands during build. _Requires Docker Engine API v1.25+_.
1154
+ *
1155
+ * Specify this property to build images on a specific networking mode.
1156
+ *
1157
+ * @default - no networking mode specified
1158
+ */
1159
+ readonly networkMode?: string;
1160
+ /**
1161
+ * Platform to build for. _Requires Docker Buildx_.
1162
+ *
1163
+ * Specify this property to build images on a specific platform/architecture.
1164
+ *
1165
+ * @default - current machine platform
1166
+ */
1167
+ readonly platform?: string;
1168
+ /**
1169
+ * Outputs
1170
+ *
1171
+ * @default - no outputs are passed to the build command (default outputs are used)
1172
+ * @see https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs
1173
+ */
1174
+ readonly dockerOutputs?: string[];
1175
+ /**
1176
+ * Cache from options to pass to the `docker build` command.
1177
+ *
1178
+ * @default - no cache from options are passed to the build command
1179
+ * @see https://docs.docker.com/build/cache/backends/
1180
+ */
1181
+ readonly cacheFrom?: DockerCacheOption[];
1182
+ /**
1183
+ * Cache to options to pass to the `docker build` command.
1184
+ *
1185
+ * @default - no cache to options are passed to the build command
1186
+ * @see https://docs.docker.com/build/cache/backends/
1187
+ */
1188
+ readonly cacheTo?: DockerCacheOption;
1189
+ /**
1190
+ * Disable the cache and pass `--no-cache` to the `docker build` command.
1191
+ *
1192
+ * @default - cache is used
1193
+ */
1194
+ readonly cacheDisabled?: boolean;
1195
+ }
1196
+ interface DockerImageDestination extends AwsDestination {
1197
+ /**
1198
+ * Name of the ECR repository to publish to
1199
+ */
1200
+ readonly repositoryName: string;
1201
+ /**
1202
+ * Tag of the image to publish
1203
+ */
1204
+ readonly imageTag: string;
1205
+ }
1206
+ interface DockerCacheOption {
1207
+ /**
1208
+ * The type of cache to use.
1209
+ * Refer to https://docs.docker.com/build/cache/backends/ for full list of backends.
1210
+ * @default - unspecified
1211
+ *
1212
+ * @example 'registry'
1213
+ */
1214
+ readonly type: string;
1215
+ /**
1216
+ * Any parameters to pass into the docker cache backend configuration.
1217
+ * Refer to https://docs.docker.com/build/cache/backends/ for cache backend configuration.
1218
+ * @default {} No options provided
1219
+ *
1220
+ * @example
1221
+ * declare const branch: string;
1222
+ *
1223
+ * const params = {
1224
+ * ref: `12345678.dkr.ecr.us-west-2.amazonaws.com/cache:${branch}`,
1225
+ * mode: "max",
1226
+ * };
1227
+ */
1228
+ readonly params?: {
1229
+ [key: string]: string;
1230
+ };
1231
+ }
1232
+ interface FileAsset {
1233
+ /**
1234
+ * A display name for this asset
1235
+ *
1236
+ * @default - The identifier will be used as the display name
1237
+ */
1238
+ readonly displayName?: string;
1239
+ /**
1240
+ * Source description for file assets
1241
+ */
1242
+ readonly source: FileSource;
1243
+ /**
1244
+ * Destinations for this file asset
1245
+ */
1246
+ readonly destinations: {
1247
+ [id: string]: FileDestination;
1248
+ };
1249
+ }
1250
+ declare enum FileAssetPackaging {
1251
+ /**
1252
+ * Upload the given path as a file
1253
+ */
1254
+ FILE = "file",
1255
+ /**
1256
+ * The given path is a directory, zip it and upload
1257
+ */
1258
+ ZIP_DIRECTORY = "zip"
1259
+ }
1260
+ interface FileSource {
1261
+ /**
1262
+ * External command which will produce the file asset to upload.
1263
+ *
1264
+ * @default - Exactly one of `executable` and `path` is required.
1265
+ */
1266
+ readonly executable?: string[];
1267
+ /**
1268
+ * The filesystem object to upload
1269
+ *
1270
+ * This path is relative to the asset manifest location.
1271
+ *
1272
+ * @default - Exactly one of `executable` and `path` is required.
1273
+ */
1274
+ readonly path?: string;
1275
+ /**
1276
+ * Packaging method
1277
+ *
1278
+ * Only allowed when `path` is specified.
1279
+ *
1280
+ * @default FILE
1281
+ */
1282
+ readonly packaging?: FileAssetPackaging;
1283
+ }
1284
+ interface FileDestination extends AwsDestination {
1285
+ /**
1286
+ * The name of the bucket
1287
+ */
1288
+ readonly bucketName: string;
1289
+ /**
1290
+ * The destination object key
1291
+ */
1292
+ readonly objectKey: string;
1293
+ }
1294
+ interface AssetManifest {
1295
+ /**
1296
+ * Version of the manifest
1297
+ */
1298
+ readonly version: string;
1299
+ /**
1300
+ * The file assets in this manifest
1301
+ *
1302
+ * @default - No files
1303
+ */
1304
+ readonly files?: {
1305
+ [id: string]: FileAsset;
1306
+ };
1307
+ /**
1308
+ * The Docker image assets in this manifest
1309
+ *
1310
+ * @default - No Docker images
1311
+ */
1312
+ readonly dockerImages?: {
1313
+ [id: string]: DockerImageAsset;
1314
+ };
1315
+ }
1316
+ declare enum RequireApproval {
1317
+ /**
1318
+ * Never ask for approval
1319
+ */
1320
+ NEVER = "never",
1321
+ /**
1322
+ * Prompt for approval for any type of change to the stack
1323
+ */
1324
+ ANYCHANGE = "any-change",
1325
+ /**
1326
+ * Only prompt for approval if there are security related changes
1327
+ */
1328
+ BROADENING = "broadening"
1329
+ }
1330
+ interface DefaultCdkOptions {
1331
+ /**
1332
+ * List of stacks to deploy
1333
+ *
1334
+ * Requried if `all` is not set
1335
+ *
1336
+ * @default - []
1337
+ */
1338
+ readonly stacks?: string[];
1339
+ /**
1340
+ * Deploy all stacks
1341
+ *
1342
+ * Requried if `stacks` is not set
1343
+ *
1344
+ * @default - false
1345
+ */
1346
+ readonly all?: boolean;
1347
+ /**
1348
+ * command-line for executing your app or a cloud assembly directory
1349
+ * e.g. "node bin/my-app.js"
1350
+ * or
1351
+ * "cdk.out"
1352
+ *
1353
+ * @default - read from cdk.json
1354
+ */
1355
+ readonly app?: string;
1356
+ /**
1357
+ * Role to pass to CloudFormation for deployment
1358
+ *
1359
+ * @default - use the bootstrap cfn-exec role
1360
+ */
1361
+ readonly roleArn?: string;
1362
+ /**
1363
+ * Additional context
1364
+ *
1365
+ * @default - no additional context
1366
+ */
1367
+ readonly context?: {
1368
+ [name: string]: string;
1369
+ };
1370
+ /**
1371
+ * Print trace for stack warnings
1372
+ *
1373
+ * @default false
1374
+ */
1375
+ readonly trace?: boolean;
1376
+ /**
1377
+ * Do not construct stacks with warnings
1378
+ *
1379
+ * @default false
1380
+ */
1381
+ readonly strict?: boolean;
1382
+ /**
1383
+ * Perform context lookups.
1384
+ *
1385
+ * Synthesis fails if this is disabled and context lookups need
1386
+ * to be performed
1387
+ *
1388
+ * @default true
1389
+ */
1390
+ readonly lookups?: boolean;
1391
+ /**
1392
+ * Ignores synthesis errors, which will likely produce an invalid output
1393
+ *
1394
+ * @default false
1395
+ */
1396
+ readonly ignoreErrors?: boolean;
1397
+ /**
1398
+ * Use JSON output instead of YAML when templates are printed
1399
+ * to STDOUT
1400
+ *
1401
+ * @default false
1402
+ */
1403
+ readonly json?: boolean;
1404
+ /**
1405
+ * show debug logs
1406
+ *
1407
+ * @default false
1408
+ */
1409
+ readonly verbose?: boolean;
1410
+ /**
1411
+ * enable emission of additional debugging information, such as creation stack
1412
+ * traces of tokens
1413
+ *
1414
+ * @default false
1415
+ */
1416
+ readonly debug?: boolean;
1417
+ /**
1418
+ * Use the indicated AWS profile as the default environment
1419
+ *
1420
+ * @default - no profile is used
1421
+ */
1422
+ readonly profile?: string;
1423
+ /**
1424
+ * Use the indicated proxy. Will read from
1425
+ * HTTPS_PROXY environment if specified
1426
+ *
1427
+ * @default - no proxy
1428
+ */
1429
+ readonly proxy?: string;
1430
+ /**
1431
+ * Path to CA certificate to use when validating HTTPS
1432
+ * requests.
1433
+ *
1434
+ * @default - read from AWS_CA_BUNDLE environment variable
1435
+ */
1436
+ readonly caBundlePath?: string;
1437
+ /**
1438
+ * Force trying to fetch EC2 instance credentials
1439
+ *
1440
+ * @default - guess EC2 instance status
1441
+ */
1442
+ readonly ec2Creds?: boolean;
1443
+ /**
1444
+ * Include "AWS::CDK::Metadata" resource in synthesized templates
1445
+ *
1446
+ * @default true
1447
+ */
1448
+ readonly versionReporting?: boolean;
1449
+ /**
1450
+ * Include "aws:cdk:path" CloudFormation metadata for each resource
1451
+ *
1452
+ * @default true
1453
+ */
1454
+ readonly pathMetadata?: boolean;
1455
+ /**
1456
+ * Include "aws:asset:*" CloudFormation metadata for resources that use assets
1457
+ *
1458
+ * @default true
1459
+ */
1460
+ readonly assetMetadata?: boolean;
1461
+ /**
1462
+ * Copy assets to the output directory
1463
+ *
1464
+ * Needed for local debugging the source files with SAM CLI
1465
+ *
1466
+ * @default false
1467
+ */
1468
+ readonly staging?: boolean;
1469
+ /**
1470
+ * Emits the synthesized cloud assembly into a directory
1471
+ *
1472
+ * @default cdk.out
1473
+ */
1474
+ readonly output?: string;
1475
+ /**
1476
+ * Show relevant notices
1477
+ *
1478
+ * @default true
1479
+ */
1480
+ readonly notices?: boolean;
1481
+ /**
1482
+ * Show colors and other style from console output
1483
+ *
1484
+ * @default true
1485
+ */
1486
+ readonly color?: boolean;
1487
+ }
1488
+ interface DeployOptions extends DefaultCdkOptions {
1489
+ /**
1490
+ * Only perform action on the given stack
1491
+ *
1492
+ * @default false
1493
+ */
1494
+ readonly exclusively?: boolean;
1495
+ /**
1496
+ * Name of the toolkit stack to use/deploy
1497
+ *
1498
+ * @default CDKToolkit
1499
+ */
1500
+ readonly toolkitStackName?: string;
1501
+ /**
1502
+ * Reuse the assets with the given asset IDs
1503
+ *
1504
+ * @default - do not reuse assets
1505
+ */
1506
+ readonly reuseAssets?: string[];
1507
+ /**
1508
+ * Optional name to use for the CloudFormation change set.
1509
+ * If not provided, a name will be generated automatically.
1510
+ *
1511
+ * @default - auto generate a name
1512
+ */
1513
+ readonly changeSetName?: string;
1514
+ /**
1515
+ * Always deploy, even if templates are identical.
1516
+ * @default false
1517
+ */
1518
+ readonly force?: boolean;
1519
+ /**
1520
+ * Rollback failed deployments
1521
+ *
1522
+ * @default true
1523
+ */
1524
+ readonly rollback?: boolean;
1525
+ /**
1526
+ * ARNs of SNS topics that CloudFormation will notify with stack related events
1527
+ *
1528
+ * @default - no notifications
1529
+ */
1530
+ readonly notificationArns?: string[];
1531
+ /**
1532
+ * What kind of security changes require approval
1533
+ *
1534
+ * @default RequireApproval.NEVER
1535
+ */
1536
+ readonly requireApproval?: RequireApproval;
1537
+ /**
1538
+ * Whether to execute the ChangeSet
1539
+ * Not providing `execute` parameter will result in execution of ChangeSet
1540
+ * @default true
1541
+ */
1542
+ readonly execute?: boolean;
1543
+ /**
1544
+ * Additional parameters for CloudFormation at deploy time
1545
+ * @default {}
1546
+ */
1547
+ readonly parameters?: {
1548
+ [name: string]: string;
1549
+ };
1550
+ /**
1551
+ * Use previous values for unspecified parameters
1552
+ *
1553
+ * If not set, all parameters must be specified for every deployment.
1554
+ *
1555
+ * @default true
1556
+ */
1557
+ readonly usePreviousParameters?: boolean;
1558
+ /**
1559
+ * Path to file where stack outputs will be written after a successful deploy as JSON
1560
+ * @default - Outputs are not written to any file
1561
+ */
1562
+ readonly outputsFile?: string;
1563
+ /**
1564
+ * Whether we are on a CI system
1565
+ *
1566
+ * @default false
1567
+ */
1568
+ readonly ci?: boolean;
1569
+ /**
1570
+ * Deploy multiple stacks in parallel
1571
+ *
1572
+ * @default 1
1573
+ */
1574
+ readonly concurrency?: number;
1575
+ }
1576
+ interface DestroyOptions extends DefaultCdkOptions {
1577
+ /**
1578
+ * Do not ask for permission before destroying stacks
1579
+ *
1580
+ * @default false
1581
+ */
1582
+ readonly force?: boolean;
1583
+ /**
1584
+ * Only destroy the given stack
1585
+ *
1586
+ * @default false
1587
+ */
1588
+ readonly exclusively?: boolean;
1589
+ }
1590
+ interface TestOptions {
1591
+ /**
1592
+ * Run update workflow on this test case
1593
+ * This should only be set to false to test scenarios
1594
+ * that are not possible to test as part of the update workflow
1595
+ *
1596
+ * @default true
1597
+ */
1598
+ readonly stackUpdateWorkflow?: boolean;
1599
+ /**
1600
+ * Additional options to use for each CDK command
1601
+ *
1602
+ * @default - runner default options
1603
+ */
1604
+ readonly cdkCommandOptions?: CdkCommands;
1605
+ /**
1606
+ * Additional commands to run at predefined points in the test workflow
1607
+ *
1608
+ * e.g. { postDeploy: ['yarn', 'test'] }
1609
+ *
1610
+ * @default - no hooks
1611
+ */
1612
+ readonly hooks?: Hooks;
1613
+ /**
1614
+ * Whether or not to include asset hashes in the diff
1615
+ * Asset hashes can introduces a lot of unneccessary noise into tests,
1616
+ * but there are some cases where asset hashes _should_ be included. For example
1617
+ * any tests involving custom resources or bundling
1618
+ *
1619
+ * @default false
1620
+ */
1621
+ readonly diffAssets?: boolean;
1622
+ /**
1623
+ * List of CloudFormation resource types in this stack that can
1624
+ * be destroyed as part of an update without failing the test.
1625
+ *
1626
+ * This list should only include resources that for this specific
1627
+ * integration test we are sure will not cause errors or an outage if
1628
+ * destroyed. For example, maybe we know that a new resource will be created
1629
+ * first before the old resource is destroyed which prevents any outage.
1630
+ *
1631
+ * e.g. ['AWS::IAM::Role']
1632
+ *
1633
+ * @default - do not allow destruction of any resources on update
1634
+ */
1635
+ readonly allowDestroy?: string[];
1636
+ /**
1637
+ * Limit deployment to these regions
1638
+ *
1639
+ * @default - can run in any region
1640
+ */
1641
+ readonly regions?: string[];
1642
+ }
1643
+ interface TestCase extends TestOptions {
1644
+ /**
1645
+ * Stacks that should be tested as part of this test case
1646
+ * The stackNames will be passed as args to the cdk commands
1647
+ * so dependent stacks will be automatically deployed unless
1648
+ * `exclusively` is passed
1649
+ */
1650
+ readonly stacks: string[];
1651
+ /**
1652
+ * The node id of the stack that contains assertions.
1653
+ * This is the value that can be used to deploy the stack with the CDK CLI
1654
+ *
1655
+ * @default - no assertion stack
1656
+ */
1657
+ readonly assertionStack?: string;
1658
+ /**
1659
+ * The name of the stack that contains assertions
1660
+ *
1661
+ * @default - no assertion stack
1662
+ */
1663
+ readonly assertionStackName?: string;
1664
+ }
1665
+ interface Hooks {
1666
+ /**
1667
+ * Commands to run prior to deploying the cdk stacks
1668
+ * in the integration test
1669
+ *
1670
+ * @default - no commands
1671
+ */
1672
+ readonly preDeploy?: string[];
1673
+ /**
1674
+ * Commands to run prior after deploying the cdk stacks
1675
+ * in the integration test
1676
+ *
1677
+ * @default - no commands
1678
+ */
1679
+ readonly postDeploy?: string[];
1680
+ /**
1681
+ * Commands to run prior to destroying the cdk stacks
1682
+ * in the integration test
1683
+ *
1684
+ * @default - no commands
1685
+ */
1686
+ readonly preDestroy?: string[];
1687
+ /**
1688
+ * Commands to run after destroying the cdk stacks
1689
+ * in the integration test
1690
+ *
1691
+ * @default - no commands
1692
+ */
1693
+ readonly postDestroy?: string[];
1694
+ }
1695
+ interface CdkCommand {
1696
+ /**
1697
+ * Whether or not to run this command as part of the workflow
1698
+ * This can be used if you only want to test some of the workflow
1699
+ * for example enable `synth` and disable `deploy` & `destroy` in order
1700
+ * to limit the test to synthesis
1701
+ *
1702
+ * @default true
1703
+ */
1704
+ readonly enabled?: boolean;
1705
+ /**
1706
+ * If the runner should expect this command to fail
1707
+ *
1708
+ * @default false
1709
+ */
1710
+ readonly expectError?: boolean;
1711
+ /**
1712
+ * This can be used in combination with `expectedError`
1713
+ * to validate that a specific message is returned.
1714
+ *
1715
+ * @default - do not validate message
1716
+ */
1717
+ readonly expectedMessage?: string;
1718
+ }
1719
+ interface DeployCommand extends CdkCommand {
1720
+ /**
1721
+ * Additional arguments to pass to the command
1722
+ * This can be used to test specific CLI functionality
1723
+ *
1724
+ * @default - only default args are used
1725
+ */
1726
+ readonly args?: DeployOptions;
1727
+ }
1728
+ interface DestroyCommand extends CdkCommand {
1729
+ /**
1730
+ * Additional arguments to pass to the command
1731
+ * This can be used to test specific CLI functionality
1732
+ *
1733
+ * @default - only default args are used
1734
+ */
1735
+ readonly args?: DestroyOptions;
1736
+ }
1737
+ interface CdkCommands {
1738
+ /**
1739
+ * Options to for the cdk deploy command
1740
+ *
1741
+ * @default - default deploy options
1742
+ */
1743
+ readonly deploy?: DeployCommand;
1744
+ /**
1745
+ * Options to for the cdk destroy command
1746
+ *
1747
+ * @default - default destroy options
1748
+ */
1749
+ readonly destroy?: DestroyCommand;
1750
+ }
1751
+ interface IntegManifest {
1752
+ /**
1753
+ * Version of the manifest
1754
+ */
1755
+ readonly version: string;
1756
+ /**
1757
+ * Enable lookups for this test. If lookups are enabled
1758
+ * then `stackUpdateWorkflow` must be set to false.
1759
+ * Lookups should only be enabled when you are explicitely testing
1760
+ * lookups.
1761
+ *
1762
+ * @default false
1763
+ */
1764
+ readonly enableLookups?: boolean;
1765
+ /**
1766
+ * Additional context to use when performing
1767
+ * a synth. Any context provided here will override
1768
+ * any default context
1769
+ *
1770
+ * @default - no additional context
1771
+ */
1772
+ readonly synthContext?: {
1773
+ [name: string]: string;
1774
+ };
1775
+ /**
1776
+ * test cases
1777
+ */
1778
+ readonly testCases: {
1779
+ [testName: string]: TestCase;
1780
+ };
1781
+ }
1782
+ declare const VERSION_MISMATCH: string;
1783
+ interface LoadManifestOptions {
1784
+ /**
1785
+ * Skip the version check
1786
+ *
1787
+ * This means you may read a newer cloud assembly than the CX API is designed
1788
+ * to support, and your application may not be aware of all features that in use
1789
+ * in the Cloud Assembly.
1790
+ *
1791
+ * @default false
1792
+ */
1793
+ readonly skipVersionCheck?: boolean;
1794
+ /**
1795
+ * Skip enum checks
1796
+ *
1797
+ * This means you may read enum values you don't know about yet. Make sure to always
1798
+ * check the values of enums you encounter in the manifest.
1799
+ *
1800
+ * @default false
1801
+ */
1802
+ readonly skipEnumCheck?: boolean;
1803
+ /**
1804
+ * Topologically sort all artifacts
1805
+ *
1806
+ * This parameter is only respected by the constructor of `CloudAssembly`. The
1807
+ * property lives here for backwards compatibility reasons.
1808
+ *
1809
+ * @default true
1810
+ */
1811
+ readonly topoSort?: boolean;
1812
+ }
1813
+ declare class Manifest {
1814
+ /**
1815
+ * Validates and saves the cloud assembly manifest to file.
1816
+ *
1817
+ * @param manifest - manifest.
1818
+ * @param filePath - output file path.
1819
+ */
1820
+ static saveAssemblyManifest(manifest: AssemblyManifest, filePath: string): void;
1821
+ /**
1822
+ * Load and validates the cloud assembly manifest from file.
1823
+ *
1824
+ * @param filePath - path to the manifest file.
1825
+ */
1826
+ static loadAssemblyManifest(filePath: string, options?: LoadManifestOptions): AssemblyManifest;
1827
+ /**
1828
+ * Validates and saves the asset manifest to file.
1829
+ *
1830
+ * @param manifest - manifest.
1831
+ * @param filePath - output file path.
1832
+ */
1833
+ static saveAssetManifest(manifest: AssetManifest, filePath: string): void;
1834
+ /**
1835
+ * Load and validates the asset manifest from file.
1836
+ *
1837
+ * @param filePath - path to the manifest file.
1838
+ */
1839
+ static loadAssetManifest(filePath: string): AssetManifest;
1840
+ /**
1841
+ * Validates and saves the integ manifest to file.
1842
+ *
1843
+ * @param manifest - manifest.
1844
+ * @param filePath - output file path.
1845
+ */
1846
+ static saveIntegManifest(manifest: IntegManifest, filePath: string): void;
1847
+ /**
1848
+ * Load and validates the integ manifest from file.
1849
+ *
1850
+ * @param filePath - path to the manifest file.
1851
+ */
1852
+ static loadIntegManifest(filePath: string): IntegManifest;
1853
+ /**
1854
+ * Fetch the current schema version number.
1855
+ */
1856
+ static version(): string;
1857
+ /**
1858
+ * Return the CLI version that supports this Cloud Assembly Schema version
1859
+ */
1860
+ static cliVersion(): string | undefined;
1861
+ /**
1862
+ * Deprecated
1863
+ * @deprecated use `saveAssemblyManifest()`
1864
+ */
1865
+ static save(manifest: AssemblyManifest, filePath: string): void;
1866
+ /**
1867
+ * Deprecated
1868
+ * @deprecated use `loadAssemblyManifest()`
1869
+ */
1870
+ static load(filePath: string): AssemblyManifest;
1871
+ private static validate;
1872
+ private static saveManifest;
1873
+ private static loadManifest;
1874
+ /**
1875
+ * This requires some explaining...
1876
+ *
1877
+ * We previously used `{ Key, Value }` for the object that represents a stack tag. (Notice the casing)
1878
+ * @link https://github.com/aws/aws-cdk/blob/v1.27.0/packages/aws-cdk/lib/api/cxapp/stacks.ts#L427.
1879
+ *
1880
+ * When that object moved to this package, it had to be JSII compliant, which meant the property
1881
+ * names must be `camelCased`, and not `PascalCased`. This meant it no longer matches the structure in the `manifest.json` file.
1882
+ * In order to support current manifest files, we have to translate the `PascalCased` representation to the new `camelCased` one.
1883
+ *
1884
+ * Note that the serialization itself still writes `PascalCased` because it relates to how CloudFormation expects it.
1885
+ *
1886
+ * Ideally, we would start writing the `camelCased` and translate to how CloudFormation expects it when needed. But this requires nasty
1887
+ * backwards-compatibility code and it just doesn't seem to be worth the effort.
1888
+ */
1889
+ private static patchStackTagsOnRead;
1890
+ /**
1891
+ * Validates that `assumeRoleAdditionalOptions` doesn't contain nor `ExternalId` neither `RoleArn`, as they
1892
+ * should have dedicated properties preceding this (e.g `assumeRoleArn` and `assumeRoleExternalId`).
1893
+ */
1894
+ private static validateAssumeRoleAdditionalOptions;
1895
+ /**
1896
+ * See explanation on `patchStackTagsOnRead`
1897
+ *
1898
+ * Translate stack tags metadata if it has the "right" casing.
1899
+ */
1900
+ private static patchStackTagsOnWrite;
1901
+ /**
1902
+ * Recursively replace stack tags in the stack metadata
1903
+ */
1904
+ private static replaceStackTags;
1905
+ private constructor();
1906
+ }
1907
+ export interface BootstrapEnvironmentProgress {
1908
+ /**
1909
+ * The total number of environments being deployed
1910
+ */
1911
+ readonly total: number;
1912
+ /**
1913
+ * The count of the environment currently bootstrapped
1914
+ *
1915
+ * This is counting value, not an identifier.
1916
+ */
1917
+ readonly current: number;
1918
+ /**
1919
+ * The environment that's currently being bootstrapped
1920
+ */
1921
+ readonly environment: cxapi.Environment;
1922
+ }
1923
+ interface IManifestEntry {
1924
+ /**
1925
+ * The identifier of the asset and its destination
1926
+ */
1927
+ readonly id: DestinationIdentifier;
1928
+ /**
1929
+ * The type of asset
1930
+ */
1931
+ readonly type: string;
1932
+ /**
1933
+ * Type-dependent source data
1934
+ */
1935
+ readonly genericSource: unknown;
1936
+ /**
1937
+ * Type-dependent destination data
1938
+ */
1939
+ readonly genericDestination: unknown;
1940
+ /**
1941
+ * Return a display name for this asset
1942
+ *
1943
+ * The `includeDestination` parameter controls whether or not to include the
1944
+ * destination ID in the display name.
1945
+ *
1946
+ * - Pass `false` if you are displaying notifications about building the
1947
+ * asset, or if you are describing the work of building the asset and publishing
1948
+ * to all destinations at the same time.
1949
+ * - Pass `true` if you are displaying notifications about publishing to a
1950
+ * specific destination.
1951
+ */
1952
+ displayName(includeDestination: boolean): string;
1953
+ }
1954
+ declare class DestinationIdentifier {
1955
+ /**
1956
+ * Identifies the asset, by source.
1957
+ *
1958
+ * The assetId will be the same between assets that represent
1959
+ * the same physical file or image.
1960
+ */
1961
+ readonly assetId: string;
1962
+ /**
1963
+ * Identifies the destination where this asset will be published
1964
+ */
1965
+ readonly destinationId: string;
1966
+ constructor(assetId: string, destinationId: string);
1967
+ /**
1968
+ * Return a string representation for this asset identifier
1969
+ */
1970
+ toString(): string;
1971
+ }
1972
+ /**
1973
+ * Different types of permission related changes in a diff
1974
+ */
1975
+ export declare enum PermissionChangeType {
1976
+ /**
1977
+ * No permission changes
1978
+ */
1979
+ NONE = "none",
1980
+ /**
1981
+ * Permissions are broadening
1982
+ */
1983
+ BROADENING = "broadening",
1984
+ /**
1985
+ * Permissions are changed but not broadening
1986
+ */
1987
+ NON_BROADENING = "non-broadening"
1988
+ }
1989
+ /**
1990
+ * Assembly data returned in the payload of an IO Message.
1991
+ */
1992
+ export interface AssemblyData {
1993
+ /**
1994
+ * The path to the assembly directory
1995
+ */
1996
+ readonly assemblyDirectory: string;
1997
+ /**
1998
+ * The number of stacks actioned on
1999
+ */
2000
+ readonly stacksCount: number;
2001
+ /**
2002
+ * The stack IDs
2003
+ */
2004
+ readonly stackIds: string[];
2005
+ }
2006
+ /**
2007
+ * Stack data returned in the payload of an IO Message.
2008
+ */
2009
+ export interface StackData {
2010
+ /**
2011
+ * The stack name
2012
+ */
2013
+ readonly stackName: string;
2014
+ /**
2015
+ * The stack ID
2016
+ */
2017
+ readonly hierarchicalId: string;
2018
+ /**
2019
+ * The stack template
2020
+ */
2021
+ readonly template: any;
2022
+ /**
2023
+ * The stack template converted to JSON format
2024
+ */
2025
+ readonly stringifiedJson: string;
2026
+ /**
2027
+ * The stack template converted to YAML format
2028
+ */
2029
+ readonly stringifiedYaml: string;
2030
+ }
2031
+ /**
2032
+ * Stack data returned in the payload of an IO Message.
2033
+ */
2034
+ export interface StackAndAssemblyData extends AssemblyData {
2035
+ /**
2036
+ * Stack Data
2037
+ */
2038
+ readonly stack: StackData;
2039
+ }
2040
+ /**
2041
+ * Duration information returned in the payload of an IO Message.
2042
+ */
2043
+ export interface Duration {
2044
+ /**
2045
+ * The duration of the action.
2046
+ */
2047
+ readonly duration: number;
2048
+ }
2049
+ /**
2050
+ * Generic payload of error IoMessages that pass on an instance of `Error`
2051
+ */
2052
+ export interface ErrorPayload {
2053
+ /**
2054
+ * The error that occurred
2055
+ */
2056
+ readonly error: Error;
2057
+ }
2058
+ /**
2059
+ * Generic payload of a simple yes/no question.
2060
+ *
2061
+ * The expectation is that 'yes' means moving on,
2062
+ * and 'no' means aborting the current action.
2063
+ */
2064
+ export interface ConfirmationRequest {
2065
+ /**
2066
+ * Some additional motivation for the confirmation that may be used as context for the user.
2067
+ */
2068
+ readonly motivation: string;
2069
+ /**
2070
+ * Number of on-going concurrent operations
2071
+ * If more than one operations is on-going, a client might decide that asking the user
2072
+ * for input is too complex, as the confirmation might not easily be attributed to a specific request.
2073
+ *
2074
+ * @default - no concurrency
2075
+ */
2076
+ readonly concurrency?: number;
2077
+ }
2078
+ export interface StackDeployProgress {
2079
+ /**
2080
+ * The total number of stacks being deployed
2081
+ */
2082
+ readonly total: number;
2083
+ /**
2084
+ * The count of the stack currently attempted to be deployed
2085
+ *
2086
+ * This is counting value, not an identifier.
2087
+ */
2088
+ readonly current: number;
2089
+ /**
2090
+ * The stack that's currently being deployed
2091
+ */
2092
+ readonly stack: CloudFormationStackArtifact;
2093
+ }
2094
+ /**
2095
+ * Payload for a yes/no confirmation in deploy. Includes information on
2096
+ * what kind of change is being made.
2097
+ */
2098
+ export interface DeployConfirmationRequest extends ConfirmationRequest {
2099
+ /**
2100
+ * The type of change being made to the IAM permissions.
2101
+ */
2102
+ readonly permissionChangeType: PermissionChangeType;
2103
+ }
2104
+ export type DeployStackResult = SuccessfulDeployStackResult | NeedRollbackFirstDeployStackResult | ReplacementRequiresRollbackStackResult;
2105
+ /** Successfully deployed a stack */
2106
+ export interface SuccessfulDeployStackResult {
2107
+ readonly type: "did-deploy-stack";
2108
+ readonly noOp: boolean;
2109
+ readonly outputs: {
2110
+ [name: string]: string;
2111
+ };
2112
+ readonly stackArn: string;
2113
+ }
2114
+ /** The stack is currently in a failpaused state, and needs to be rolled back before the deployment */
2115
+ export interface NeedRollbackFirstDeployStackResult {
2116
+ readonly type: "failpaused-need-rollback-first";
2117
+ readonly reason: "not-norollback" | "replacement";
2118
+ readonly status: string;
2119
+ }
2120
+ /** The upcoming change has a replacement, which requires deploying with --rollback */
2121
+ export interface ReplacementRequiresRollbackStackResult {
2122
+ readonly type: "replacement-requires-rollback";
2123
+ }
2124
+ export interface StackDeployProgress {
2125
+ /**
2126
+ * The total number of stacks being deployed
2127
+ */
2128
+ readonly total: number;
2129
+ /**
2130
+ * The count of the stack currently attempted to be deployed
2131
+ *
2132
+ * This is counting value, not an identifier.
2133
+ */
2134
+ readonly current: number;
2135
+ /**
2136
+ * The stack that's currently being deployed
2137
+ */
2138
+ readonly stack: CloudFormationStackArtifact;
2139
+ }
2140
+ /**
2141
+ * Payload for a yes/no confirmation in deploy. Includes information on
2142
+ * what kind of change is being made.
2143
+ */
2144
+ export interface DeployConfirmationRequest extends ConfirmationRequest {
2145
+ /**
2146
+ * The type of change being made to the IAM permissions.
2147
+ */
2148
+ readonly permissionChangeType: PermissionChangeType;
2149
+ }
2150
+ export interface BuildAsset {
2151
+ /**
2152
+ * The asset that is build
2153
+ */
2154
+ readonly asset: IManifestEntry;
2155
+ }
2156
+ export interface PublishAsset {
2157
+ /**
2158
+ * The asset that is published
2159
+ */
2160
+ readonly asset: IManifestEntry;
2161
+ }
2162
+ export interface StackDestroy {
2163
+ /**
2164
+ * The stacks that will be destroyed
2165
+ */
2166
+ readonly stacks: CloudFormationStackArtifact[];
2167
+ }
2168
+ export interface StackDestroyProgress {
2169
+ /**
2170
+ * The total number of stacks being destroyed
2171
+ */
2172
+ readonly total: number;
2173
+ /**
2174
+ * The count of the stack currently attempted to be destroyed
2175
+ *
2176
+ * This is counting value, not an identifier.
2177
+ */
2178
+ readonly current: number;
2179
+ /**
2180
+ * The stack that's currently being destroyed
2181
+ */
2182
+ readonly stack: CloudFormationStackArtifact;
2183
+ }
2184
+ /**
2185
+ * The dependencies of a stack.
2186
+ */
2187
+ export interface StackDependency {
2188
+ id: string;
2189
+ dependencies: StackDependency[];
2190
+ }
2191
+ /**
2192
+ * Details of a stack.
2193
+ */
2194
+ export interface StackDetails {
2195
+ id: string;
2196
+ name: string;
2197
+ environment: cxapi.Environment;
2198
+ dependencies: StackDependency[];
2199
+ }
2200
+ export interface StackDetailsPayload {
2201
+ stacks: StackDetails[];
2202
+ }
2203
+ /**
2204
+ * An SDK logging trace.
2205
+ *
2206
+ * Only info, warn and error level messages are emitted.
2207
+ * SDK traces are emitted as traces to the IoHost, but contain the original SDK logging level.
2208
+ */
2209
+ export interface SdkTrace {
2210
+ /**
2211
+ * The level the SDK has emitted the original message with
2212
+ */
2213
+ readonly sdkLevel: "info" | "warn" | "error";
2214
+ /**
2215
+ * The content of the SDK trace
2216
+ *
2217
+ * This will include the request and response data for API calls, including potentially sensitive information.
2218
+ *
2219
+ * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/logging-sdk-calls.html
2220
+ */
2221
+ readonly content: any;
2222
+ }
2223
+ interface MissingContext$1 {
2224
+ missingKeys: string[];
2225
+ }
2226
+ export interface UpdatedContext {
2227
+ contextFile: string;
2228
+ context: {
2229
+ [key: string]: any;
2230
+ };
2231
+ }
2232
+ export interface StackRollbackProgress {
2233
+ /**
2234
+ * The total number of stacks being rolled back
2235
+ */
2236
+ readonly total: number;
2237
+ /**
2238
+ * The count of the stack currently attempted to be rolled back
2239
+ *
2240
+ * This is counting value, not an identifier.
2241
+ */
2242
+ readonly current: number;
2243
+ /**
2244
+ * The stack that's currently being rolled back
2245
+ */
2246
+ readonly stack: CloudFormationStackArtifact;
2247
+ }
2248
+ export interface StackProgress {
2249
+ /**
2250
+ * The total number of progress monitored resources.
2251
+ */
2252
+ readonly total?: number;
2253
+ /**
2254
+ * The number of completed resources.
2255
+ */
2256
+ readonly completed: number;
2257
+ /**
2258
+ * The current progress as a [34/42] string, or just [34] if the total is unknown.
2259
+ */
2260
+ readonly formatted: string;
2261
+ }
2262
+ /**
2263
+ * Payload when stack monitoring is starting or stopping for a given stack deployment.
2264
+ */
2265
+ export interface StackMonitoringControlEvent {
2266
+ /**
2267
+ * A unique identifier for a specific stack deployment.
2268
+ *
2269
+ * Use this value to attribute stack activities received for concurrent deployments.
2270
+ */
2271
+ readonly deployment: string;
2272
+ /**
2273
+ * The stack artifact that is getting deployed
2274
+ */
2275
+ readonly stack: CloudFormationStackArtifact;
2276
+ /**
2277
+ * The name of the Stack that is getting deployed
2278
+ */
2279
+ readonly stackName: string;
2280
+ /**
2281
+ * Total number of resources taking part in this deployment
2282
+ *
2283
+ * The number might not always be known or accurate.
2284
+ * Only use for informational purposes and handle the case when it's unavailable.
2285
+ */
2286
+ readonly resourcesTotal?: number;
2287
+ }
2288
+ export interface StackActivity {
2289
+ /**
2290
+ * A unique identifier for a specific stack deployment.
2291
+ *
2292
+ * Use this value to attribute stack activities received for concurrent deployments.
2293
+ */
2294
+ readonly deployment: string;
2295
+ /**
2296
+ * The Stack Event as received from CloudFormation
2297
+ */
2298
+ readonly event: StackEvent;
2299
+ /**
2300
+ * Additional resource metadata
2301
+ */
2302
+ readonly metadata?: ResourceMetadata;
2303
+ /**
2304
+ * The stack progress
2305
+ */
2306
+ readonly progress: StackProgress;
2307
+ }
2308
+ export interface ResourceMetadata {
2309
+ entry: MetadataEntry;
2310
+ constructPath: string;
2311
+ }
2312
+ export interface StackSelectionDetails {
2313
+ /**
2314
+ * The selected stacks, if any
2315
+ */
2316
+ readonly stacks: StackSelector;
2317
+ }
2318
+ /**
2319
+ * The computed file watch settings
2320
+ */
2321
+ export interface WatchSettings {
2322
+ /**
2323
+ * The directory observed for file changes
2324
+ */
2325
+ readonly watchDir: string;
2326
+ /**
2327
+ * List of include patterns for watching files
2328
+ */
2329
+ readonly includes: string[];
2330
+ /**
2331
+ * List of excludes patterns for watching files
2332
+ */
2333
+ readonly excludes: string[];
2334
+ }
2335
+ export interface FileWatchEvent {
2336
+ /**
2337
+ * The change to the path
2338
+ */
2339
+ readonly event: string;
2340
+ /**
2341
+ * The path that has an observed event
2342
+ */
2343
+ readonly path?: string;
2344
+ }
2345
+ /**
2346
+ * Payload when stack monitoring is starting or stopping for a given stack deployment.
2347
+ */
2348
+ export interface CloudWatchLogMonitorControlEvent {
2349
+ /**
2350
+ * A unique identifier for a monitor
2351
+ *
2352
+ * Use this value to attribute events received for concurrent log monitoring.
2353
+ */
2354
+ readonly monitor: string;
2355
+ /**
2356
+ * The names of monitored log groups
2357
+ */
2358
+ readonly logGroupNames: string[];
2359
+ }
2360
+ /**
2361
+ * Represents a CloudWatch Log Event that will be
2362
+ * printed to the terminal
2363
+ */
2364
+ export interface CloudWatchLogEvent {
2365
+ /**
2366
+ * The log event message
2367
+ */
2368
+ readonly message: string;
2369
+ /**
2370
+ * The name of the log group
2371
+ */
2372
+ readonly logGroupName: string;
2373
+ /**
2374
+ * The time at which the event occurred
2375
+ */
2376
+ readonly timestamp: Date;
2377
+ }
2378
+ /**
2379
+ * Represents a general toolkit error in the AWS CDK Toolkit.
2380
+ */
2381
+ export declare class ToolkitError extends Error {
2382
+ /**
2383
+ * Determines if a given error is an instance of ToolkitError.
2384
+ */
2385
+ static isToolkitError(x: any): x is ToolkitError;
2386
+ /**
2387
+ * Determines if a given error is an instance of AuthenticationError.
2388
+ */
2389
+ static isAuthenticationError(x: any): x is AuthenticationError;
2390
+ /**
2391
+ * Determines if a given error is an instance of AssemblyError.
2392
+ */
2393
+ static isAssemblyError(x: any): x is AssemblyError;
2394
+ /**
2395
+ * Determines if a given error is an instance of AssemblyError.
2396
+ */
2397
+ static isContextProviderError(x: any): x is ContextProviderError;
2398
+ /**
2399
+ * The type of the error, defaults to "toolkit".
2400
+ */
2401
+ readonly type: string;
2402
+ /**
2403
+ * Denotes the source of the error as the toolkit.
2404
+ */
2405
+ readonly source: "toolkit" | "user";
2406
+ constructor(message: string, type?: string);
2407
+ }
2408
+ /**
2409
+ * Represents an authentication-specific error in the AWS CDK Toolkit.
2410
+ */
2411
+ export declare class AuthenticationError extends ToolkitError {
2412
+ /**
2413
+ * Denotes the source of the error as user.
2414
+ */
2415
+ readonly source = "user";
2416
+ constructor(message: string);
2417
+ }
2418
+ /**
2419
+ * Represents an error causes by cloud assembly synthesis
2420
+ *
2421
+ * This includes errors thrown during app execution, as well as failing annotations.
2422
+ */
2423
+ export declare class AssemblyError extends ToolkitError {
2424
+ /**
2425
+ * An AssemblyError with an original error as cause
2426
+ */
2427
+ static withCause(message: string, error: unknown): AssemblyError;
2428
+ /**
2429
+ * An AssemblyError with a list of stacks as cause
2430
+ */
2431
+ static withStacks(message: string, stacks?: cxapi.CloudFormationStackArtifact[]): AssemblyError;
2432
+ /**
2433
+ * Denotes the source of the error as user.
2434
+ */
2435
+ readonly source = "user";
2436
+ /**
2437
+ * The stacks that caused the error, if available
2438
+ *
2439
+ * The `messages` property of each `cxapi.CloudFormationStackArtifact` will contain the respective errors.
2440
+ * Absence indicates synthesis didn't fully complete.
2441
+ */
2442
+ readonly stacks?: cxapi.CloudFormationStackArtifact[];
2443
+ /**
2444
+ * The specific original cause of the error, if available
2445
+ */
2446
+ readonly cause?: unknown;
2447
+ private constructor();
2448
+ }
2449
+ /**
2450
+ * Represents an error originating from a Context Provider
2451
+ */
2452
+ export declare class ContextProviderError extends ToolkitError {
2453
+ /**
2454
+ * Denotes the source of the error as user.
2455
+ */
2456
+ readonly source = "user";
2457
+ constructor(message: string);
2458
+ }
2459
+
2460
+ export {
2461
+ MissingContext$1 as MissingContext,
2462
+ };
129
2463
 
130
2464
  export {};