@aws-cdk/toolkit-lib 0.1.7 → 0.1.8
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/build-info.json +2 -2
- package/db.json.gz +0 -0
- package/lib/actions/bootstrap/index.d.ts +0 -1
- package/lib/actions/bootstrap/index.js +13 -6
- package/lib/actions/diff/index.d.ts +19 -15
- package/lib/actions/diff/index.js +4 -1
- package/lib/actions/index.d.ts +1 -0
- package/lib/actions/index.js +2 -1
- package/lib/api/aws-cdk.d.ts +1 -1
- package/lib/api/aws-cdk.js +340 -216
- package/lib/api/aws-cdk.js.map +4 -4
- package/lib/api/cloud-assembly/private/prepare-source.d.ts +49 -39
- package/lib/api/cloud-assembly/private/prepare-source.js +113 -94
- package/lib/api/cloud-assembly/private/source-builder.js +9 -8
- package/lib/api/cloud-assembly/private/stack-assembly.d.ts +1 -1
- package/lib/api/cloud-assembly/private/stack-assembly.js +3 -3
- package/lib/api/shared-private.js +23 -0
- package/lib/api/shared-private.js.map +2 -2
- package/lib/api/shared-public.d.ts +492 -217
- package/lib/api/shared-public.js +904 -36
- package/lib/api/shared-public.js.map +4 -4
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/private/dispose-polyfill.d.ts +1 -0
- package/lib/private/dispose-polyfill.js +20 -0
- package/lib/toolkit/private/index.d.ts +1 -1
- package/lib/toolkit/private/index.js +4 -4
- package/lib/toolkit/toolkit.d.ts +5 -0
- package/lib/toolkit/toolkit.js +143 -12
- package/package.json +19 -19
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as cxapi from '@aws-cdk/cx-api';
|
|
2
2
|
import { CloudFormationStackArtifact } from '@aws-cdk/cx-api';
|
|
3
|
-
import { StackEvent } from '@aws-sdk/client-cloudformation';
|
|
3
|
+
import { DescribeChangeSetOutput as DescribeChangeSet, StackEvent } from '@aws-sdk/client-cloudformation';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Which stacks should be selected from a cloud assembly
|
|
@@ -83,99 +83,85 @@ export interface StackSelector {
|
|
|
83
83
|
*/
|
|
84
84
|
failOnEmpty?: boolean;
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
readonly
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
readonly
|
|
114
|
-
|
|
115
|
-
* The action that triggered the message.
|
|
116
|
-
*/
|
|
117
|
-
readonly action: ToolkitAction;
|
|
118
|
-
/**
|
|
119
|
-
* A short message code uniquely identifying a message type using the format CDK_[CATEGORY]_[E/W/I][0000-9999].
|
|
120
|
-
*
|
|
121
|
-
* The level indicator follows these rules:
|
|
122
|
-
* - 'E' for error level messages
|
|
123
|
-
* - 'W' for warning level messages
|
|
124
|
-
* - 'I' for info/debug/trace level messages
|
|
125
|
-
*
|
|
126
|
-
* Codes ending in 000 0 are generic messages, while codes ending in 0001-9999 are specific to a particular message.
|
|
127
|
-
* The following are examples of valid and invalid message codes:
|
|
128
|
-
* ```ts
|
|
129
|
-
* 'CDK_ASSETS_I0000' // valid: generic assets info message
|
|
130
|
-
* 'CDK_TOOLKIT_E0002' // valid: specific toolkit error message
|
|
131
|
-
* 'CDK_SDK_W0023' // valid: specific sdk warning message
|
|
132
|
-
* ```
|
|
133
|
-
*
|
|
134
|
-
* @see https://github.com/aws/aws-cdk-cli/blob/main/packages/%40aws-cdk/toolkit-lib/CODE_REGISTRY.md
|
|
135
|
-
*/
|
|
136
|
-
readonly code: IoMessageCode;
|
|
137
|
-
/**
|
|
138
|
-
* The message text.
|
|
139
|
-
* This is safe to print to an end-user.
|
|
140
|
-
*/
|
|
141
|
-
readonly message: string;
|
|
86
|
+
export interface Template {
|
|
87
|
+
Parameters?: Record<string, TemplateParameter>;
|
|
88
|
+
[section: string]: any;
|
|
89
|
+
}
|
|
90
|
+
export interface TemplateParameter {
|
|
91
|
+
Type: string;
|
|
92
|
+
Default?: any;
|
|
93
|
+
Description?: string;
|
|
94
|
+
[key: string]: any;
|
|
95
|
+
}
|
|
96
|
+
export interface NestedStackTemplates {
|
|
97
|
+
readonly physicalName: string | undefined;
|
|
98
|
+
readonly deployedTemplate: Template;
|
|
99
|
+
readonly generatedTemplate: Template;
|
|
100
|
+
readonly nestedStackTemplates: {
|
|
101
|
+
[nestedStackLogicalId: string]: NestedStackTemplates;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
interface IDifference<ValueType> {
|
|
105
|
+
readonly oldValue: ValueType | undefined;
|
|
106
|
+
readonly newValue: ValueType | undefined;
|
|
107
|
+
readonly isDifferent: boolean;
|
|
108
|
+
readonly isAddition: boolean;
|
|
109
|
+
readonly isRemoval: boolean;
|
|
110
|
+
readonly isUpdate: boolean;
|
|
111
|
+
}
|
|
112
|
+
declare class Difference<ValueType> implements IDifference<ValueType> {
|
|
113
|
+
readonly oldValue: ValueType | undefined;
|
|
114
|
+
readonly newValue: ValueType | undefined;
|
|
142
115
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* A message span, groups multiple messages together that semantically related to the same operation.
|
|
146
|
-
* This is an otherwise meaningless identifier.
|
|
116
|
+
* Whether this is an actual different or the values are actually the same
|
|
147
117
|
*
|
|
148
|
-
*
|
|
118
|
+
* isDifferent => (isUpdate | isRemoved | isUpdate)
|
|
149
119
|
*/
|
|
150
|
-
|
|
120
|
+
isDifferent: boolean;
|
|
151
121
|
/**
|
|
152
|
-
*
|
|
122
|
+
* @param oldValue the old value, cannot be equal (to the sense of +deepEqual+) to +newValue+.
|
|
123
|
+
* @param newValue the new value, cannot be equal (to the sense of +deepEqual+) to +oldValue+.
|
|
153
124
|
*/
|
|
154
|
-
|
|
125
|
+
constructor(oldValue: ValueType | undefined, newValue: ValueType | undefined);
|
|
126
|
+
/** @returns +true+ if the element is new to the template. */
|
|
127
|
+
get isAddition(): boolean;
|
|
128
|
+
/** @returns +true+ if the element was removed from the template. */
|
|
129
|
+
get isRemoval(): boolean;
|
|
130
|
+
/** @returns +true+ if the element was already in the template and is updated. */
|
|
131
|
+
get isUpdate(): boolean;
|
|
155
132
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
* The default response that will be used if no data is returned.
|
|
162
|
-
*/
|
|
163
|
-
readonly defaultResponse: U;
|
|
133
|
+
declare class PropertyDifference<ValueType> extends Difference<ValueType> {
|
|
134
|
+
changeImpact?: ResourceImpact;
|
|
135
|
+
constructor(oldValue: ValueType | undefined, newValue: ValueType | undefined, args: {
|
|
136
|
+
changeImpact?: ResourceImpact;
|
|
137
|
+
});
|
|
164
138
|
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
139
|
+
declare enum ResourceImpact {
|
|
140
|
+
/** The existing physical resource will be updated */
|
|
141
|
+
WILL_UPDATE = "WILL_UPDATE",
|
|
142
|
+
/** A new physical resource will be created */
|
|
143
|
+
WILL_CREATE = "WILL_CREATE",
|
|
144
|
+
/** The existing physical resource will be replaced */
|
|
145
|
+
WILL_REPLACE = "WILL_REPLACE",
|
|
146
|
+
/** The existing physical resource may be replaced */
|
|
147
|
+
MAY_REPLACE = "MAY_REPLACE",
|
|
148
|
+
/** The existing physical resource will be destroyed */
|
|
149
|
+
WILL_DESTROY = "WILL_DESTROY",
|
|
150
|
+
/** The existing physical resource will be removed from CloudFormation supervision */
|
|
151
|
+
WILL_ORPHAN = "WILL_ORPHAN",
|
|
152
|
+
/** The existing physical resource will be added to CloudFormation supervision */
|
|
153
|
+
WILL_IMPORT = "WILL_IMPORT",
|
|
154
|
+
/** There is no change in this resource */
|
|
155
|
+
NO_CHANGE = "NO_CHANGE"
|
|
178
156
|
}
|
|
157
|
+
interface Resource {
|
|
158
|
+
Type: string;
|
|
159
|
+
Properties?: {
|
|
160
|
+
[name: string]: any;
|
|
161
|
+
};
|
|
162
|
+
[key: string]: any;
|
|
163
|
+
}
|
|
164
|
+
type DescribeChangeSetOutput = DescribeChangeSet;
|
|
179
165
|
interface BootstrapRole {
|
|
180
166
|
/**
|
|
181
167
|
* The ARN of the IAM role created as part of bootrapping
|
|
@@ -871,15 +857,15 @@ interface KeyContextQuery extends ContextLookupRoleOptions {
|
|
|
871
857
|
}
|
|
872
858
|
interface CcApiContextQuery extends ContextLookupRoleOptions {
|
|
873
859
|
/**
|
|
874
|
-
* The
|
|
860
|
+
* The CloudFormation resource type.
|
|
875
861
|
* See https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/supported-resources.html
|
|
876
862
|
*/
|
|
877
863
|
readonly typeName: string;
|
|
878
864
|
/**
|
|
879
865
|
* Identifier of the resource to look up using `GetResource`.
|
|
880
866
|
*
|
|
881
|
-
* Specifying exactIdentifier will return exactly one result, or throw an error
|
|
882
|
-
*
|
|
867
|
+
* Specifying exactIdentifier will return exactly one result, or throw an error
|
|
868
|
+
* unless `ignoreErrorOnMissingContext` is set.
|
|
883
869
|
*
|
|
884
870
|
* @default - Either exactIdentifier or propertyMatch should be specified.
|
|
885
871
|
*/
|
|
@@ -887,7 +873,10 @@ interface CcApiContextQuery extends ContextLookupRoleOptions {
|
|
|
887
873
|
/**
|
|
888
874
|
* Returns any resources matching these properties, using `ListResources`.
|
|
889
875
|
*
|
|
890
|
-
*
|
|
876
|
+
* By default, specifying propertyMatch will successfully return 0 or more
|
|
877
|
+
* results. To throw an error if the number of results is unexpected (and
|
|
878
|
+
* prevent the query results from being committed to context), specify
|
|
879
|
+
* `expectedMatchCount`.
|
|
891
880
|
*
|
|
892
881
|
* ## Notes on property completeness
|
|
893
882
|
*
|
|
@@ -921,6 +910,22 @@ interface CcApiContextQuery extends ContextLookupRoleOptions {
|
|
|
921
910
|
* `GetResource` call for resources matched by `propertyMatch`.
|
|
922
911
|
*/
|
|
923
912
|
readonly propertiesToReturn: string[];
|
|
913
|
+
/**
|
|
914
|
+
* Expected count of results if `propertyMatch` is specified.
|
|
915
|
+
*
|
|
916
|
+
* If the expected result count does not match the actual count,
|
|
917
|
+
* by default an error is produced and the result is not committed to cached
|
|
918
|
+
* context, and the user can correct the situation and try again without
|
|
919
|
+
* having to manually clear out the context key using `cdk context --remove`
|
|
920
|
+
*
|
|
921
|
+
* If the value of * `ignoreErrorOnMissingContext` is `true`, the value of
|
|
922
|
+
* `expectedMatchCount` is `at-least-one | exactly-one` and the number
|
|
923
|
+
* of found resources is 0, `dummyValue` is returned and committed to context
|
|
924
|
+
* instead.
|
|
925
|
+
*
|
|
926
|
+
* @default 'any'
|
|
927
|
+
*/
|
|
928
|
+
readonly expectedMatchCount?: "any" | "at-least-one" | "at-most-one" | "exactly-one";
|
|
924
929
|
/**
|
|
925
930
|
* The value to return if the resource was not found and `ignoreErrorOnMissingContext` is true.
|
|
926
931
|
*
|
|
@@ -939,8 +944,8 @@ interface CcApiContextQuery extends ContextLookupRoleOptions {
|
|
|
939
944
|
*
|
|
940
945
|
* - In case of an `exactIdentifier` lookup, return the `dummyValue` if the resource with
|
|
941
946
|
* that identifier was not found.
|
|
942
|
-
* - In case of a `propertyMatch` lookup,
|
|
943
|
-
*
|
|
947
|
+
* - In case of a `propertyMatch` lookup, return the `dummyValue` if `expectedMatchCount`
|
|
948
|
+
* is `at-least-one | exactly-one` and the number of resources found was 0.
|
|
944
949
|
*
|
|
945
950
|
* if `ignoreErrorOnMissingContext` is set, `dummyValue` should be set and be an array.
|
|
946
951
|
*
|
|
@@ -1957,88 +1962,140 @@ declare class Manifest {
|
|
|
1957
1962
|
private static replaceStackTags;
|
|
1958
1963
|
private constructor();
|
|
1959
1964
|
}
|
|
1960
|
-
|
|
1965
|
+
/**
|
|
1966
|
+
* The current action being performed by the CLI. 'none' represents the absence of an action.
|
|
1967
|
+
*/
|
|
1968
|
+
export type ToolkitAction = "assembly" | "bootstrap" | "synth" | "list" | "diff" | "deploy" | "rollback" | "watch" | "destroy" | "doctor" | "gc" | "import" | "metadata" | "init" | "migrate";
|
|
1969
|
+
/**
|
|
1970
|
+
* The reporting level of the message.
|
|
1971
|
+
* All messages are always reported, it's up to the IoHost to decide what to log.
|
|
1972
|
+
*/
|
|
1973
|
+
export type IoMessageLevel = "error" | "result" | "warn" | "info" | "debug" | "trace";
|
|
1974
|
+
/**
|
|
1975
|
+
* A valid message code.
|
|
1976
|
+
*/
|
|
1977
|
+
export type IoMessageCode = `CDK_${string}_${"E" | "W" | "I"}${number}${number}${number}${number}`;
|
|
1978
|
+
/**
|
|
1979
|
+
* An IO message emitted.
|
|
1980
|
+
*/
|
|
1981
|
+
export interface IoMessage<T> {
|
|
1961
1982
|
/**
|
|
1962
|
-
* The
|
|
1983
|
+
* The time the message was emitted.
|
|
1963
1984
|
*/
|
|
1964
|
-
readonly
|
|
1985
|
+
readonly time: Date;
|
|
1965
1986
|
/**
|
|
1966
|
-
* The
|
|
1987
|
+
* The recommended log level of the message.
|
|
1967
1988
|
*
|
|
1968
|
-
* This is
|
|
1989
|
+
* This is an indicative level and should not be used to explicitly match messages, instead match the `code`.
|
|
1990
|
+
* The level of a message may change without notice.
|
|
1969
1991
|
*/
|
|
1970
|
-
readonly
|
|
1992
|
+
readonly level: IoMessageLevel;
|
|
1971
1993
|
/**
|
|
1972
|
-
* The
|
|
1994
|
+
* The action that triggered the message.
|
|
1973
1995
|
*/
|
|
1974
|
-
readonly
|
|
1975
|
-
}
|
|
1976
|
-
interface IManifestEntry {
|
|
1996
|
+
readonly action: ToolkitAction;
|
|
1977
1997
|
/**
|
|
1978
|
-
*
|
|
1998
|
+
* A short message code uniquely identifying a message type using the format CDK_[CATEGORY]_[E/W/I][0000-9999].
|
|
1999
|
+
*
|
|
2000
|
+
* The level indicator follows these rules:
|
|
2001
|
+
* - 'E' for error level messages
|
|
2002
|
+
* - 'W' for warning level messages
|
|
2003
|
+
* - 'I' for info/debug/trace level messages
|
|
2004
|
+
*
|
|
2005
|
+
* Codes ending in 000 0 are generic messages, while codes ending in 0001-9999 are specific to a particular message.
|
|
2006
|
+
* The following are examples of valid and invalid message codes:
|
|
2007
|
+
* ```ts
|
|
2008
|
+
* 'CDK_ASSETS_I0000' // valid: generic assets info message
|
|
2009
|
+
* 'CDK_TOOLKIT_E0002' // valid: specific toolkit error message
|
|
2010
|
+
* 'CDK_SDK_W0023' // valid: specific sdk warning message
|
|
2011
|
+
* ```
|
|
2012
|
+
*
|
|
2013
|
+
* @see https://github.com/aws/aws-cdk-cli/blob/main/packages/%40aws-cdk/toolkit-lib/CODE_REGISTRY.md
|
|
1979
2014
|
*/
|
|
1980
|
-
readonly
|
|
2015
|
+
readonly code: IoMessageCode;
|
|
1981
2016
|
/**
|
|
1982
|
-
* The
|
|
2017
|
+
* The message text.
|
|
2018
|
+
* This is safe to print to an end-user.
|
|
1983
2019
|
*/
|
|
1984
|
-
readonly
|
|
2020
|
+
readonly message: string;
|
|
1985
2021
|
/**
|
|
1986
|
-
*
|
|
2022
|
+
* Identifies the message span, this message belongs to.
|
|
2023
|
+
*
|
|
2024
|
+
* A message span, groups multiple messages together that semantically related to the same operation.
|
|
2025
|
+
* This is an otherwise meaningless identifier.
|
|
2026
|
+
*
|
|
2027
|
+
* A message without a `spanId`, does not belong to a span.
|
|
1987
2028
|
*/
|
|
1988
|
-
readonly
|
|
2029
|
+
readonly span?: string;
|
|
1989
2030
|
/**
|
|
1990
|
-
*
|
|
2031
|
+
* The data attached to the message.
|
|
1991
2032
|
*/
|
|
1992
|
-
readonly
|
|
2033
|
+
readonly data: T;
|
|
2034
|
+
}
|
|
2035
|
+
/**
|
|
2036
|
+
* An IO request emitted.
|
|
2037
|
+
*/
|
|
2038
|
+
export interface IoRequest<T, U> extends IoMessage<T> {
|
|
1993
2039
|
/**
|
|
1994
|
-
*
|
|
1995
|
-
*
|
|
1996
|
-
* The `includeDestination` parameter controls whether or not to include the
|
|
1997
|
-
* destination ID in the display name.
|
|
1998
|
-
*
|
|
1999
|
-
* - Pass `false` if you are displaying notifications about building the
|
|
2000
|
-
* asset, or if you are describing the work of building the asset and publishing
|
|
2001
|
-
* to all destinations at the same time.
|
|
2002
|
-
* - Pass `true` if you are displaying notifications about publishing to a
|
|
2003
|
-
* specific destination.
|
|
2040
|
+
* The default response that will be used if no data is returned.
|
|
2004
2041
|
*/
|
|
2005
|
-
|
|
2042
|
+
readonly defaultResponse: U;
|
|
2006
2043
|
}
|
|
2007
|
-
|
|
2044
|
+
export interface IIoHost {
|
|
2008
2045
|
/**
|
|
2009
|
-
*
|
|
2046
|
+
* Notifies the host of a message.
|
|
2047
|
+
* The caller waits until the notification completes.
|
|
2048
|
+
*/
|
|
2049
|
+
notify(msg: IoMessage<unknown>): Promise<void>;
|
|
2050
|
+
/**
|
|
2051
|
+
* Notifies the host of a message that requires a response.
|
|
2010
2052
|
*
|
|
2011
|
-
*
|
|
2012
|
-
* the
|
|
2053
|
+
* If the host does not return a response the suggested
|
|
2054
|
+
* default response from the input message will be used.
|
|
2013
2055
|
*/
|
|
2014
|
-
|
|
2056
|
+
requestResponse<T, U>(msg: IoRequest<T, U>): Promise<U>;
|
|
2057
|
+
}
|
|
2058
|
+
interface CodeInfo {
|
|
2015
2059
|
/**
|
|
2016
|
-
*
|
|
2060
|
+
* The message code.
|
|
2017
2061
|
*/
|
|
2018
|
-
readonly
|
|
2019
|
-
constructor(assetId: string, destinationId: string);
|
|
2062
|
+
readonly code: IoMessageCode;
|
|
2020
2063
|
/**
|
|
2021
|
-
*
|
|
2064
|
+
* A brief description of the meaning of this IO Message.
|
|
2022
2065
|
*/
|
|
2023
|
-
|
|
2066
|
+
readonly description: string;
|
|
2067
|
+
/**
|
|
2068
|
+
* The name of the payload interface, if applicable.
|
|
2069
|
+
* Some Io Messages include a payload, with a specific interface. The name of
|
|
2070
|
+
* the interface is specified here so that it can be linked with the message
|
|
2071
|
+
* when documentation is generated.
|
|
2072
|
+
*
|
|
2073
|
+
* The interface _must_ be exposed directly from toolkit-lib, so that it will
|
|
2074
|
+
* have a documentation page generated (that can be linked to).
|
|
2075
|
+
*/
|
|
2076
|
+
readonly interface?: string;
|
|
2024
2077
|
}
|
|
2025
|
-
|
|
2026
|
-
* Different types of permission related changes in a diff
|
|
2027
|
-
*/
|
|
2028
|
-
export declare enum PermissionChangeType {
|
|
2078
|
+
interface MessageInfo extends CodeInfo {
|
|
2029
2079
|
/**
|
|
2030
|
-
*
|
|
2080
|
+
* The message level
|
|
2031
2081
|
*/
|
|
2032
|
-
|
|
2082
|
+
readonly level: IoMessageLevel;
|
|
2083
|
+
}
|
|
2084
|
+
interface IoMessageMaker<T> extends MessageInfo {
|
|
2033
2085
|
/**
|
|
2034
|
-
*
|
|
2086
|
+
* Create a message for this code, with or without payload.
|
|
2035
2087
|
*/
|
|
2036
|
-
|
|
2088
|
+
msg: [
|
|
2089
|
+
T
|
|
2090
|
+
] extends [
|
|
2091
|
+
AbsentData
|
|
2092
|
+
] ? (message: string) => ActionLessMessage<AbsentData> : (message: string, data: T) => ActionLessMessage<T>;
|
|
2037
2093
|
/**
|
|
2038
|
-
*
|
|
2094
|
+
* Returns whether the given `IoMessage` instance matches the current message definition
|
|
2039
2095
|
*/
|
|
2040
|
-
|
|
2096
|
+
is(x: IoMessage<unknown>): x is IoMessage<T>;
|
|
2041
2097
|
}
|
|
2098
|
+
type AbsentData = void;
|
|
2042
2099
|
/**
|
|
2043
2100
|
* Assembly data returned in the payload of an IO Message.
|
|
2044
2101
|
*/
|
|
@@ -2134,6 +2191,177 @@ export interface ContextProviderMessageSource {
|
|
|
2134
2191
|
*/
|
|
2135
2192
|
readonly provider: string;
|
|
2136
2193
|
}
|
|
2194
|
+
interface SpanEnd {
|
|
2195
|
+
readonly duration: number;
|
|
2196
|
+
}
|
|
2197
|
+
interface SpanDefinition<S extends object, E extends SpanEnd> {
|
|
2198
|
+
readonly name: string;
|
|
2199
|
+
readonly start: IoMessageMaker<S>;
|
|
2200
|
+
readonly end: IoMessageMaker<E>;
|
|
2201
|
+
}
|
|
2202
|
+
type EmptyObject = {
|
|
2203
|
+
[index: string | number | symbol]: never;
|
|
2204
|
+
};
|
|
2205
|
+
type VoidWhenEmpty<T> = T extends EmptyObject ? void : T;
|
|
2206
|
+
type ForceEmpty<T> = T extends EmptyObject ? EmptyObject : T;
|
|
2207
|
+
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
2208
|
+
interface ElapsedTime {
|
|
2209
|
+
readonly asMs: number;
|
|
2210
|
+
readonly asSec: number;
|
|
2211
|
+
}
|
|
2212
|
+
interface IMessageSpan<E extends SpanEnd> {
|
|
2213
|
+
/**
|
|
2214
|
+
* Get the time elapsed since the start
|
|
2215
|
+
*/
|
|
2216
|
+
elapsedTime(): Promise<ElapsedTime>;
|
|
2217
|
+
/**
|
|
2218
|
+
* Sends a simple, generic message with the current timing
|
|
2219
|
+
* For more complex intermediate messages, get the `elapsedTime` and use `notify`
|
|
2220
|
+
*/
|
|
2221
|
+
timing(maker: IoMessageMaker<Duration>, message?: string): Promise<ElapsedTime>;
|
|
2222
|
+
/**
|
|
2223
|
+
* Sends an arbitrary intermediate message as part of the span
|
|
2224
|
+
*/
|
|
2225
|
+
notify(message: ActionLessMessage<unknown>): Promise<void>;
|
|
2226
|
+
/**
|
|
2227
|
+
* End the span with a payload
|
|
2228
|
+
*/
|
|
2229
|
+
end(payload: VoidWhenEmpty<Omit<E, keyof SpanEnd>>): Promise<ElapsedTime>;
|
|
2230
|
+
/**
|
|
2231
|
+
* End the span with a payload, overwriting
|
|
2232
|
+
*/
|
|
2233
|
+
end(payload: VoidWhenEmpty<Optional<E, keyof SpanEnd>>): Promise<ElapsedTime>;
|
|
2234
|
+
/**
|
|
2235
|
+
* End the span with a message and payload
|
|
2236
|
+
*/
|
|
2237
|
+
end(message: string, payload: ForceEmpty<Optional<E, keyof SpanEnd>>): Promise<ElapsedTime>;
|
|
2238
|
+
}
|
|
2239
|
+
declare class SpanMaker<S extends object, E extends SpanEnd> {
|
|
2240
|
+
private readonly definition;
|
|
2241
|
+
private readonly ioHelper;
|
|
2242
|
+
constructor(ioHelper: IoHelper, definition: SpanDefinition<S, E>);
|
|
2243
|
+
/**
|
|
2244
|
+
* Starts the span and initially notifies the IoHost
|
|
2245
|
+
* @returns a message span
|
|
2246
|
+
*/
|
|
2247
|
+
begin(payload: VoidWhenEmpty<S>): Promise<IMessageSpan<E>>;
|
|
2248
|
+
begin(message: string, payload: S): Promise<IMessageSpan<E>>;
|
|
2249
|
+
}
|
|
2250
|
+
type ActionLessMessage<T> = Omit<IoMessage<T>, "action">;
|
|
2251
|
+
type ActionLessRequest<T, U> = Omit<IoRequest<T, U>, "action">;
|
|
2252
|
+
declare class IoHelper implements IIoHost {
|
|
2253
|
+
static fromIoHost(ioHost: IIoHost, action: ToolkitAction): IoHelper;
|
|
2254
|
+
private readonly ioHost;
|
|
2255
|
+
private readonly action;
|
|
2256
|
+
private constructor();
|
|
2257
|
+
/**
|
|
2258
|
+
* Forward a message to the IoHost, while injection the current action
|
|
2259
|
+
*/
|
|
2260
|
+
notify(msg: ActionLessMessage<unknown>): Promise<void>;
|
|
2261
|
+
/**
|
|
2262
|
+
* Forward a request to the IoHost, while injection the current action
|
|
2263
|
+
*/
|
|
2264
|
+
requestResponse<T, U>(msg: ActionLessRequest<T, U>): Promise<U>;
|
|
2265
|
+
/**
|
|
2266
|
+
* Create a new marker from a given registry entry
|
|
2267
|
+
*/
|
|
2268
|
+
span<S extends object, E extends SpanEnd>(definition: SpanDefinition<S, E>): SpanMaker<S, E>;
|
|
2269
|
+
}
|
|
2270
|
+
export interface BootstrapEnvironmentProgress {
|
|
2271
|
+
/**
|
|
2272
|
+
* The total number of environments being deployed
|
|
2273
|
+
*/
|
|
2274
|
+
readonly total: number;
|
|
2275
|
+
/**
|
|
2276
|
+
* The count of the environment currently bootstrapped
|
|
2277
|
+
*
|
|
2278
|
+
* This is counting value, not an identifier.
|
|
2279
|
+
*/
|
|
2280
|
+
readonly current: number;
|
|
2281
|
+
/**
|
|
2282
|
+
* The environment that's currently being bootstrapped
|
|
2283
|
+
*/
|
|
2284
|
+
readonly environment: cxapi.Environment;
|
|
2285
|
+
}
|
|
2286
|
+
interface IManifestEntry {
|
|
2287
|
+
/**
|
|
2288
|
+
* The identifier of the asset and its destination
|
|
2289
|
+
*/
|
|
2290
|
+
readonly id: DestinationIdentifier;
|
|
2291
|
+
/**
|
|
2292
|
+
* The type of asset
|
|
2293
|
+
*/
|
|
2294
|
+
readonly type: string;
|
|
2295
|
+
/**
|
|
2296
|
+
* Type-dependent source data
|
|
2297
|
+
*/
|
|
2298
|
+
readonly genericSource: unknown;
|
|
2299
|
+
/**
|
|
2300
|
+
* Type-dependent destination data
|
|
2301
|
+
*/
|
|
2302
|
+
readonly genericDestination: unknown;
|
|
2303
|
+
/**
|
|
2304
|
+
* Return a display name for this asset
|
|
2305
|
+
*
|
|
2306
|
+
* The `includeDestination` parameter controls whether or not to include the
|
|
2307
|
+
* destination ID in the display name.
|
|
2308
|
+
*
|
|
2309
|
+
* - Pass `false` if you are displaying notifications about building the
|
|
2310
|
+
* asset, or if you are describing the work of building the asset and publishing
|
|
2311
|
+
* to all destinations at the same time.
|
|
2312
|
+
* - Pass `true` if you are displaying notifications about publishing to a
|
|
2313
|
+
* specific destination.
|
|
2314
|
+
*/
|
|
2315
|
+
displayName(includeDestination: boolean): string;
|
|
2316
|
+
}
|
|
2317
|
+
declare class DestinationIdentifier {
|
|
2318
|
+
/**
|
|
2319
|
+
* Identifies the asset, by source.
|
|
2320
|
+
*
|
|
2321
|
+
* The assetId will be the same between assets that represent
|
|
2322
|
+
* the same physical file or image.
|
|
2323
|
+
*/
|
|
2324
|
+
readonly assetId: string;
|
|
2325
|
+
/**
|
|
2326
|
+
* Identifies the destination where this asset will be published
|
|
2327
|
+
*/
|
|
2328
|
+
readonly destinationId: string;
|
|
2329
|
+
constructor(assetId: string, destinationId: string);
|
|
2330
|
+
/**
|
|
2331
|
+
* Return a string representation for this asset identifier
|
|
2332
|
+
*/
|
|
2333
|
+
toString(): string;
|
|
2334
|
+
}
|
|
2335
|
+
/**
|
|
2336
|
+
* Different types of permission related changes in a diff
|
|
2337
|
+
*/
|
|
2338
|
+
export declare enum PermissionChangeType {
|
|
2339
|
+
/**
|
|
2340
|
+
* No permission changes
|
|
2341
|
+
*/
|
|
2342
|
+
NONE = "none",
|
|
2343
|
+
/**
|
|
2344
|
+
* Permissions are broadening
|
|
2345
|
+
*/
|
|
2346
|
+
BROADENING = "broadening",
|
|
2347
|
+
/**
|
|
2348
|
+
* Permissions are changed but not broadening
|
|
2349
|
+
*/
|
|
2350
|
+
NON_BROADENING = "non-broadening"
|
|
2351
|
+
}
|
|
2352
|
+
/**
|
|
2353
|
+
* Output of the diff command
|
|
2354
|
+
*/
|
|
2355
|
+
export interface DiffResult extends Duration {
|
|
2356
|
+
/**
|
|
2357
|
+
* Stack diff formatted as a string
|
|
2358
|
+
*/
|
|
2359
|
+
readonly formattedStackDiff: string;
|
|
2360
|
+
/**
|
|
2361
|
+
* Security diff formatted as a string
|
|
2362
|
+
*/
|
|
2363
|
+
readonly formattedSecurityDiff: string;
|
|
2364
|
+
}
|
|
2137
2365
|
export interface StackDeployProgress {
|
|
2138
2366
|
/**
|
|
2139
2367
|
* The total number of stacks being deployed
|
|
@@ -2257,7 +2485,7 @@ export interface StackDetails {
|
|
|
2257
2485
|
dependencies: StackDependency[];
|
|
2258
2486
|
}
|
|
2259
2487
|
export interface StackDetailsPayload {
|
|
2260
|
-
stacks: StackDetails[];
|
|
2488
|
+
readonly stacks: StackDetails[];
|
|
2261
2489
|
}
|
|
2262
2490
|
/**
|
|
2263
2491
|
* An SDK logging trace.
|
|
@@ -2443,66 +2671,6 @@ export interface CloudWatchLogEvent {
|
|
|
2443
2671
|
*/
|
|
2444
2672
|
readonly timestamp: Date;
|
|
2445
2673
|
}
|
|
2446
|
-
interface IDifference<ValueType> {
|
|
2447
|
-
readonly oldValue: ValueType | undefined;
|
|
2448
|
-
readonly newValue: ValueType | undefined;
|
|
2449
|
-
readonly isDifferent: boolean;
|
|
2450
|
-
readonly isAddition: boolean;
|
|
2451
|
-
readonly isRemoval: boolean;
|
|
2452
|
-
readonly isUpdate: boolean;
|
|
2453
|
-
}
|
|
2454
|
-
declare class Difference<ValueType> implements IDifference<ValueType> {
|
|
2455
|
-
readonly oldValue: ValueType | undefined;
|
|
2456
|
-
readonly newValue: ValueType | undefined;
|
|
2457
|
-
/**
|
|
2458
|
-
* Whether this is an actual different or the values are actually the same
|
|
2459
|
-
*
|
|
2460
|
-
* isDifferent => (isUpdate | isRemoved | isUpdate)
|
|
2461
|
-
*/
|
|
2462
|
-
isDifferent: boolean;
|
|
2463
|
-
/**
|
|
2464
|
-
* @param oldValue the old value, cannot be equal (to the sense of +deepEqual+) to +newValue+.
|
|
2465
|
-
* @param newValue the new value, cannot be equal (to the sense of +deepEqual+) to +oldValue+.
|
|
2466
|
-
*/
|
|
2467
|
-
constructor(oldValue: ValueType | undefined, newValue: ValueType | undefined);
|
|
2468
|
-
/** @returns +true+ if the element is new to the template. */
|
|
2469
|
-
get isAddition(): boolean;
|
|
2470
|
-
/** @returns +true+ if the element was removed from the template. */
|
|
2471
|
-
get isRemoval(): boolean;
|
|
2472
|
-
/** @returns +true+ if the element was already in the template and is updated. */
|
|
2473
|
-
get isUpdate(): boolean;
|
|
2474
|
-
}
|
|
2475
|
-
declare class PropertyDifference<ValueType> extends Difference<ValueType> {
|
|
2476
|
-
changeImpact?: ResourceImpact;
|
|
2477
|
-
constructor(oldValue: ValueType | undefined, newValue: ValueType | undefined, args: {
|
|
2478
|
-
changeImpact?: ResourceImpact;
|
|
2479
|
-
});
|
|
2480
|
-
}
|
|
2481
|
-
declare enum ResourceImpact {
|
|
2482
|
-
/** The existing physical resource will be updated */
|
|
2483
|
-
WILL_UPDATE = "WILL_UPDATE",
|
|
2484
|
-
/** A new physical resource will be created */
|
|
2485
|
-
WILL_CREATE = "WILL_CREATE",
|
|
2486
|
-
/** The existing physical resource will be replaced */
|
|
2487
|
-
WILL_REPLACE = "WILL_REPLACE",
|
|
2488
|
-
/** The existing physical resource may be replaced */
|
|
2489
|
-
MAY_REPLACE = "MAY_REPLACE",
|
|
2490
|
-
/** The existing physical resource will be destroyed */
|
|
2491
|
-
WILL_DESTROY = "WILL_DESTROY",
|
|
2492
|
-
/** The existing physical resource will be removed from CloudFormation supervision */
|
|
2493
|
-
WILL_ORPHAN = "WILL_ORPHAN",
|
|
2494
|
-
/** The existing physical resource will be added to CloudFormation supervision */
|
|
2495
|
-
WILL_IMPORT = "WILL_IMPORT",
|
|
2496
|
-
/** There is no change in this resource */
|
|
2497
|
-
NO_CHANGE = "NO_CHANGE"
|
|
2498
|
-
}
|
|
2499
|
-
interface Resource {
|
|
2500
|
-
Type: string;
|
|
2501
|
-
Properties?: {
|
|
2502
|
-
[name: string]: any;
|
|
2503
|
-
};
|
|
2504
|
-
[key: string]: any;
|
|
2505
|
-
}
|
|
2506
2674
|
/**
|
|
2507
2675
|
* A resource affected by a change
|
|
2508
2676
|
*/
|
|
@@ -2710,6 +2878,125 @@ export interface HotswapResult extends Duration, HotswapDeploymentDetails {
|
|
|
2710
2878
|
*/
|
|
2711
2879
|
readonly hotswapped: boolean;
|
|
2712
2880
|
}
|
|
2881
|
+
/**
|
|
2882
|
+
* @deprecated
|
|
2883
|
+
*/
|
|
2884
|
+
declare enum RequireApproval$1 {
|
|
2885
|
+
/**
|
|
2886
|
+
* Never require any security approvals
|
|
2887
|
+
*/
|
|
2888
|
+
NEVER = "never",
|
|
2889
|
+
/**
|
|
2890
|
+
* Any security changes require an approval
|
|
2891
|
+
*/
|
|
2892
|
+
ANY_CHANGE = "any-change",
|
|
2893
|
+
/**
|
|
2894
|
+
* Require approval only for changes that are access broadening
|
|
2895
|
+
*/
|
|
2896
|
+
BROADENING = "broadening"
|
|
2897
|
+
}
|
|
2898
|
+
interface FormatSecurityDiffOutput {
|
|
2899
|
+
/**
|
|
2900
|
+
* Complete formatted security diff, if it is prompt-worthy
|
|
2901
|
+
*/
|
|
2902
|
+
readonly formattedDiff?: string;
|
|
2903
|
+
}
|
|
2904
|
+
interface FormatStackDiffOutput {
|
|
2905
|
+
/**
|
|
2906
|
+
* Number of stacks with diff changes
|
|
2907
|
+
*/
|
|
2908
|
+
readonly numStacksWithChanges: number;
|
|
2909
|
+
/**
|
|
2910
|
+
* Complete formatted diff
|
|
2911
|
+
*/
|
|
2912
|
+
readonly formattedDiff: string;
|
|
2913
|
+
}
|
|
2914
|
+
interface DiffFormatterProps {
|
|
2915
|
+
/**
|
|
2916
|
+
* Helper for the IoHost class
|
|
2917
|
+
*/
|
|
2918
|
+
readonly ioHelper: IoHelper;
|
|
2919
|
+
/**
|
|
2920
|
+
* The old/current state of the stack.
|
|
2921
|
+
*/
|
|
2922
|
+
readonly oldTemplate: any;
|
|
2923
|
+
/**
|
|
2924
|
+
* The new/target state of the stack.
|
|
2925
|
+
*/
|
|
2926
|
+
readonly newTemplate: cxapi.CloudFormationStackArtifact;
|
|
2927
|
+
}
|
|
2928
|
+
interface FormatSecurityDiffOptions {
|
|
2929
|
+
/**
|
|
2930
|
+
* The approval level of the security diff
|
|
2931
|
+
*/
|
|
2932
|
+
readonly requireApproval: RequireApproval$1;
|
|
2933
|
+
/**
|
|
2934
|
+
* The name of the Stack.
|
|
2935
|
+
*/
|
|
2936
|
+
readonly stackName?: string;
|
|
2937
|
+
/**
|
|
2938
|
+
* The changeSet for the Stack.
|
|
2939
|
+
*
|
|
2940
|
+
* @default undefined
|
|
2941
|
+
*/
|
|
2942
|
+
readonly changeSet?: DescribeChangeSetOutput;
|
|
2943
|
+
}
|
|
2944
|
+
interface FormatStackDiffOptions {
|
|
2945
|
+
/**
|
|
2946
|
+
* do not filter out AWS::CDK::Metadata or Rules
|
|
2947
|
+
*
|
|
2948
|
+
* @default false
|
|
2949
|
+
*/
|
|
2950
|
+
readonly strict?: boolean;
|
|
2951
|
+
/**
|
|
2952
|
+
* lines of context to use in arbitrary JSON diff
|
|
2953
|
+
*
|
|
2954
|
+
* @default 3
|
|
2955
|
+
*/
|
|
2956
|
+
readonly context?: number;
|
|
2957
|
+
/**
|
|
2958
|
+
* silences \'There were no differences\' messages
|
|
2959
|
+
*
|
|
2960
|
+
* @default false
|
|
2961
|
+
*/
|
|
2962
|
+
readonly quiet?: boolean;
|
|
2963
|
+
/**
|
|
2964
|
+
* The name of the stack
|
|
2965
|
+
*/
|
|
2966
|
+
readonly stackName?: string;
|
|
2967
|
+
/**
|
|
2968
|
+
* @default undefined
|
|
2969
|
+
*/
|
|
2970
|
+
readonly changeSet?: DescribeChangeSetOutput;
|
|
2971
|
+
/**
|
|
2972
|
+
* @default false
|
|
2973
|
+
*/
|
|
2974
|
+
readonly isImport?: boolean;
|
|
2975
|
+
/**
|
|
2976
|
+
* @default undefined
|
|
2977
|
+
*/
|
|
2978
|
+
readonly nestedStackTemplates?: {
|
|
2979
|
+
[nestedStackLogicalId: string]: NestedStackTemplates;
|
|
2980
|
+
};
|
|
2981
|
+
}
|
|
2982
|
+
/**
|
|
2983
|
+
* Class for formatting the diff output
|
|
2984
|
+
*/
|
|
2985
|
+
export declare class DiffFormatter {
|
|
2986
|
+
private readonly ioHelper;
|
|
2987
|
+
private readonly oldTemplate;
|
|
2988
|
+
private readonly newTemplate;
|
|
2989
|
+
constructor(props: DiffFormatterProps);
|
|
2990
|
+
/**
|
|
2991
|
+
* Format the stack diff
|
|
2992
|
+
*/
|
|
2993
|
+
formatStackDiff(options: FormatStackDiffOptions): FormatStackDiffOutput;
|
|
2994
|
+
private formatStackDiffHelper;
|
|
2995
|
+
/**
|
|
2996
|
+
* Format the security diff
|
|
2997
|
+
*/
|
|
2998
|
+
formatSecurityDiff(options: FormatSecurityDiffOptions): FormatSecurityDiffOutput;
|
|
2999
|
+
}
|
|
2713
3000
|
/**
|
|
2714
3001
|
* Represents a general toolkit error in the AWS CDK Toolkit.
|
|
2715
3002
|
*/
|
|
@@ -2796,22 +3083,10 @@ export declare class ContextProviderError extends ToolkitError {
|
|
|
2796
3083
|
constructor(message: string);
|
|
2797
3084
|
}
|
|
2798
3085
|
/**
|
|
2799
|
-
*
|
|
3086
|
+
* Removes CDKMetadata and Outputs in the template so that only resources for importing are left.
|
|
3087
|
+
* @returns template with import resources only
|
|
2800
3088
|
*/
|
|
2801
|
-
declare
|
|
2802
|
-
/**
|
|
2803
|
-
* Never require any security approvals
|
|
2804
|
-
*/
|
|
2805
|
-
NEVER = "never",
|
|
2806
|
-
/**
|
|
2807
|
-
* Any security changes require an approval
|
|
2808
|
-
*/
|
|
2809
|
-
ANY_CHANGE = "any-change",
|
|
2810
|
-
/**
|
|
2811
|
-
* Require approval only for changes that are access broadening
|
|
2812
|
-
*/
|
|
2813
|
-
BROADENING = "broadening"
|
|
2814
|
-
}
|
|
3089
|
+
export declare function removeNonImportResources(stack: CloudFormationStackArtifact): any;
|
|
2815
3090
|
|
|
2816
3091
|
export {
|
|
2817
3092
|
MissingContext$1 as MissingContext,
|