@aws-cdk/toolkit-lib 0.1.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.
- package/LICENSE +202 -0
- package/NOTICE +16 -0
- package/README.md +432 -0
- package/build-info.json +4 -0
- package/db.json.gz +0 -0
- package/lib/actions/deploy/index.d.ts +178 -0
- package/lib/actions/deploy/index.js +78 -0
- package/lib/actions/deploy/private/deploy-options.d.ts +78 -0
- package/lib/actions/deploy/private/deploy-options.js +3 -0
- package/lib/actions/deploy/private/helpers.d.ts +15 -0
- package/lib/actions/deploy/private/helpers.js +41 -0
- package/lib/actions/deploy/private/index.d.ts +2 -0
- package/lib/actions/deploy/private/index.js +19 -0
- package/lib/actions/destroy/index.d.ts +17 -0
- package/lib/actions/destroy/index.js +3 -0
- package/lib/actions/diff/index.d.ts +83 -0
- package/lib/actions/diff/index.js +45 -0
- package/lib/actions/diff/private/helpers.d.ts +7 -0
- package/lib/actions/diff/private/helpers.js +20 -0
- package/lib/actions/diff/private/index.d.ts +1 -0
- package/lib/actions/diff/private/index.js +18 -0
- package/lib/actions/import/index.d.ts +21 -0
- package/lib/actions/import/index.js +3 -0
- package/lib/actions/index.d.ts +6 -0
- package/lib/actions/index.js +23 -0
- package/lib/actions/list/index.d.ts +7 -0
- package/lib/actions/list/index.js +3 -0
- package/lib/actions/rollback/index.d.ts +39 -0
- package/lib/actions/rollback/index.js +3 -0
- package/lib/actions/synth/index.d.ts +12 -0
- package/lib/actions/synth/index.js +3 -0
- package/lib/actions/watch/index.d.ts +35 -0
- package/lib/actions/watch/index.js +3 -0
- package/lib/actions/watch/private/helpers.d.ts +4 -0
- package/lib/actions/watch/private/helpers.js +8 -0
- package/lib/actions/watch/private/index.d.ts +1 -0
- package/lib/actions/watch/private/index.js +18 -0
- package/lib/api/aws-auth/index.d.ts +1 -0
- package/lib/api/aws-auth/index.js +18 -0
- package/lib/api/aws-auth/types.d.ts +32 -0
- package/lib/api/aws-auth/types.js +3 -0
- package/lib/api/aws-cdk.d.ts +25 -0
- package/lib/api/aws-cdk.js +9329 -0
- package/lib/api/aws-cdk.js.map +7 -0
- package/lib/api/cloud-assembly/index.d.ts +3 -0
- package/lib/api/cloud-assembly/index.js +20 -0
- package/lib/api/cloud-assembly/private/cached-source.d.ts +15 -0
- package/lib/api/cloud-assembly/private/cached-source.js +25 -0
- package/lib/api/cloud-assembly/private/context-aware-source.d.ts +45 -0
- package/lib/api/cloud-assembly/private/context-aware-source.js +89 -0
- package/lib/api/cloud-assembly/private/exec.d.ts +13 -0
- package/lib/api/cloud-assembly/private/exec.js +56 -0
- package/lib/api/cloud-assembly/private/identity-source.d.ts +10 -0
- package/lib/api/cloud-assembly/private/identity-source.js +17 -0
- package/lib/api/cloud-assembly/private/index.d.ts +8 -0
- package/lib/api/cloud-assembly/private/index.js +25 -0
- package/lib/api/cloud-assembly/private/prepare-source.d.ts +52 -0
- package/lib/api/cloud-assembly/private/prepare-source.js +166 -0
- package/lib/api/cloud-assembly/private/source-builder.d.ts +29 -0
- package/lib/api/cloud-assembly/private/source-builder.js +121 -0
- package/lib/api/cloud-assembly/private/stack-assembly.d.ts +30 -0
- package/lib/api/cloud-assembly/private/stack-assembly.js +94 -0
- package/lib/api/cloud-assembly/private/stack-selectors.d.ts +2 -0
- package/lib/api/cloud-assembly/private/stack-selectors.js +8 -0
- package/lib/api/cloud-assembly/source-builder.d.ts +113 -0
- package/lib/api/cloud-assembly/source-builder.js +3 -0
- package/lib/api/cloud-assembly/stack-selector.d.ts +81 -0
- package/lib/api/cloud-assembly/stack-selector.js +64 -0
- package/lib/api/cloud-assembly/types.d.ts +7 -0
- package/lib/api/cloud-assembly/types.js +3 -0
- package/lib/api/errors.d.ts +44 -0
- package/lib/api/errors.js +82 -0
- package/lib/api/io/index.d.ts +2 -0
- package/lib/api/io/index.js +19 -0
- package/lib/api/io/io-host.d.ts +15 -0
- package/lib/api/io/io-host.js +3 -0
- package/lib/api/io/io-message.d.ts +59 -0
- package/lib/api/io/io-message.js +3 -0
- package/lib/api/io/private/codes.d.ts +37 -0
- package/lib/api/io/private/codes.js +48 -0
- package/lib/api/io/private/index.d.ts +6 -0
- package/lib/api/io/private/index.js +23 -0
- package/lib/api/io/private/level-priority.d.ts +11 -0
- package/lib/api/io/private/level-priority.js +33 -0
- package/lib/api/io/private/logger.d.ts +40 -0
- package/lib/api/io/private/logger.js +211 -0
- package/lib/api/io/private/messages.d.ts +64 -0
- package/lib/api/io/private/messages.js +159 -0
- package/lib/api/io/private/timer.d.ts +29 -0
- package/lib/api/io/private/timer.js +54 -0
- package/lib/api/io/private/types.d.ts +25 -0
- package/lib/api/io/private/types.js +3 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +25 -0
- package/lib/index_bg.wasm +0 -0
- package/lib/toolkit/index.d.ts +1 -0
- package/lib/toolkit/index.js +18 -0
- package/lib/toolkit/private/index.d.ts +9 -0
- package/lib/toolkit/private/index.js +3 -0
- package/lib/toolkit/toolkit.d.ts +142 -0
- package/lib/toolkit/toolkit.js +644 -0
- package/package.json +147 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SdkProvider } from '../../api/aws-cdk';
|
|
2
|
+
import { ActionAwareIoHost } from '../../api/io/private';
|
|
3
|
+
/**
|
|
4
|
+
* Helper struct to pass internal services around.
|
|
5
|
+
*/
|
|
6
|
+
export interface ToolkitServices {
|
|
7
|
+
sdkProvider: SdkProvider;
|
|
8
|
+
ioHost: ActionAwareIoHost;
|
|
9
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiXG5pbXBvcnQgeyBTZGtQcm92aWRlciB9IGZyb20gJy4uLy4uL2FwaS9hd3MtY2RrJztcbmltcG9ydCB7IEFjdGlvbkF3YXJlSW9Ib3N0IH0gZnJvbSAnLi4vLi4vYXBpL2lvL3ByaXZhdGUnO1xuXG4vKipcbiAqIEhlbHBlciBzdHJ1Y3QgdG8gcGFzcyBpbnRlcm5hbCBzZXJ2aWNlcyBhcm91bmQuXG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgVG9vbGtpdFNlcnZpY2VzIHtcbiAgc2RrUHJvdmlkZXI6IFNka1Byb3ZpZGVyO1xuICBpb0hvc3Q6IEFjdGlvbkF3YXJlSW9Ib3N0O1xufVxuIl19
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { ToolkitServices } from './private';
|
|
2
|
+
import { type DeployOptions } from '../actions/deploy';
|
|
3
|
+
import { type DestroyOptions } from '../actions/destroy';
|
|
4
|
+
import { type ListOptions } from '../actions/list';
|
|
5
|
+
import { type RollbackOptions } from '../actions/rollback';
|
|
6
|
+
import { type SynthOptions } from '../actions/synth';
|
|
7
|
+
import { WatchOptions } from '../actions/watch';
|
|
8
|
+
import { type SdkConfig } from '../api/aws-auth';
|
|
9
|
+
import { StackDetails } from '../api/aws-cdk';
|
|
10
|
+
import { ICloudAssemblySource } from '../api/cloud-assembly';
|
|
11
|
+
import { CloudAssemblySourceBuilder } from '../api/cloud-assembly/private';
|
|
12
|
+
import { IIoHost } from '../api/io';
|
|
13
|
+
/**
|
|
14
|
+
* The current action being performed by the CLI. 'none' represents the absence of an action.
|
|
15
|
+
*/
|
|
16
|
+
export type ToolkitAction = 'assembly' | 'bootstrap' | 'synth' | 'list' | 'diff' | 'deploy' | 'rollback' | 'watch' | 'destroy' | 'doctor' | 'gc' | 'import' | 'metadata' | 'init' | 'migrate';
|
|
17
|
+
export interface ToolkitOptions {
|
|
18
|
+
/**
|
|
19
|
+
* The IoHost implementation, handling the inline interactions between the Toolkit and an integration.
|
|
20
|
+
*/
|
|
21
|
+
ioHost?: IIoHost;
|
|
22
|
+
/**
|
|
23
|
+
* Allow emojis in messages sent to the IoHost.
|
|
24
|
+
*
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
emojis?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether to allow ANSI colors and formatting in IoHost messages.
|
|
30
|
+
* Setting this value to `false` enforces that no color or style shows up
|
|
31
|
+
* in messages sent to the IoHost.
|
|
32
|
+
* Setting this value to true is a no-op; it is equivalent to the default.
|
|
33
|
+
*
|
|
34
|
+
* @default - detects color from the TTY status of the IoHost
|
|
35
|
+
*/
|
|
36
|
+
color?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Configuration options for the SDK.
|
|
39
|
+
*/
|
|
40
|
+
sdkConfig?: SdkConfig;
|
|
41
|
+
/**
|
|
42
|
+
* Name of the toolkit stack to be used.
|
|
43
|
+
*
|
|
44
|
+
* @default "CDKToolkit"
|
|
45
|
+
*/
|
|
46
|
+
toolkitStackName?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Fail Cloud Assemblies
|
|
49
|
+
*
|
|
50
|
+
* @default "error"
|
|
51
|
+
*/
|
|
52
|
+
assemblyFailureAt?: 'error' | 'warn' | 'none';
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The AWS CDK Programmatic Toolkit
|
|
56
|
+
*/
|
|
57
|
+
export declare class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposable {
|
|
58
|
+
private readonly props;
|
|
59
|
+
/**
|
|
60
|
+
* The toolkit stack name used for bootstrapping resources.
|
|
61
|
+
*/
|
|
62
|
+
readonly toolkitStackName: string;
|
|
63
|
+
/**
|
|
64
|
+
* The IoHost of this Toolkit
|
|
65
|
+
*/
|
|
66
|
+
readonly ioHost: IIoHost;
|
|
67
|
+
private _sdkProvider?;
|
|
68
|
+
constructor(props?: ToolkitOptions);
|
|
69
|
+
dispose(): Promise<void>;
|
|
70
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Access to the AWS SDK
|
|
73
|
+
*/
|
|
74
|
+
private sdkProvider;
|
|
75
|
+
/**
|
|
76
|
+
* Helper to provide the CloudAssemblySourceBuilder with required toolkit services
|
|
77
|
+
*/
|
|
78
|
+
protected sourceBuilderServices(): Promise<ToolkitServices>;
|
|
79
|
+
/**
|
|
80
|
+
* Synth Action
|
|
81
|
+
*/
|
|
82
|
+
synth(cx: ICloudAssemblySource, options?: SynthOptions): Promise<ICloudAssemblySource>;
|
|
83
|
+
/**
|
|
84
|
+
* List Action
|
|
85
|
+
*
|
|
86
|
+
* List selected stacks and their dependencies
|
|
87
|
+
*/
|
|
88
|
+
list(cx: ICloudAssemblySource, options?: ListOptions): Promise<StackDetails[]>;
|
|
89
|
+
/**
|
|
90
|
+
* Deploy Action
|
|
91
|
+
*
|
|
92
|
+
* Deploys the selected stacks into an AWS account
|
|
93
|
+
*/
|
|
94
|
+
deploy(cx: ICloudAssemblySource, options?: DeployOptions): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Helper to allow deploy being called as part of the watch action.
|
|
97
|
+
*/
|
|
98
|
+
private _deploy;
|
|
99
|
+
/**
|
|
100
|
+
* Watch Action
|
|
101
|
+
*
|
|
102
|
+
* Continuously observe project files and deploy the selected stacks automatically when changes are detected.
|
|
103
|
+
* Implies hotswap deployments.
|
|
104
|
+
*/
|
|
105
|
+
watch(cx: ICloudAssemblySource, options: WatchOptions): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Rollback Action
|
|
108
|
+
*
|
|
109
|
+
* Rolls back the selected stacks.
|
|
110
|
+
*/
|
|
111
|
+
rollback(cx: ICloudAssemblySource, options: RollbackOptions): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Helper to allow rollback being called as part of the deploy or watch action.
|
|
114
|
+
*/
|
|
115
|
+
private _rollback;
|
|
116
|
+
/**
|
|
117
|
+
* Destroy Action
|
|
118
|
+
*
|
|
119
|
+
* Destroys the selected Stacks.
|
|
120
|
+
*/
|
|
121
|
+
destroy(cx: ICloudAssemblySource, options: DestroyOptions): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Helper to allow destroy being called as part of the deploy action.
|
|
124
|
+
*/
|
|
125
|
+
private _destroy;
|
|
126
|
+
/**
|
|
127
|
+
* Validate the stacks for errors and warnings according to the CLI's current settings
|
|
128
|
+
*/
|
|
129
|
+
private validateStacksMetadata;
|
|
130
|
+
/**
|
|
131
|
+
* Creates a Toolkit internal CloudAssembly from a CloudAssemblySource.
|
|
132
|
+
* @param assemblySource the source for the cloud assembly
|
|
133
|
+
* @param cache if the assembly should be cached, default: `true`
|
|
134
|
+
* @returns the CloudAssembly object
|
|
135
|
+
*/
|
|
136
|
+
private assemblyFromSource;
|
|
137
|
+
/**
|
|
138
|
+
* Create a deployments class
|
|
139
|
+
*/
|
|
140
|
+
private deploymentsForAction;
|
|
141
|
+
private invokeDeployFromWatch;
|
|
142
|
+
}
|