@kensio/yulin 1.6.1 → 1.7.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/README.md +72 -0
- package/dist/cli/sim-cli.d.ts +20 -0
- package/dist/cli/sim-cli.d.ts.map +1 -0
- package/dist/cli/sim-cli.js +42 -0
- package/dist/cli/sim-cli.js.map +1 -0
- package/dist/cli/watch/sim-watch-arguments.d.ts +30 -0
- package/dist/cli/watch/sim-watch-arguments.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-arguments.js +67 -0
- package/dist/cli/watch/sim-watch-arguments.js.map +1 -0
- package/dist/cli/watch/sim-watch-child-environment.d.ts +30 -0
- package/dist/cli/watch/sim-watch-child-environment.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-child-environment.js +51 -0
- package/dist/cli/watch/sim-watch-child-environment.js.map +1 -0
- package/dist/cli/watch/sim-watch-child-message.d.ts +19 -0
- package/dist/cli/watch/sim-watch-child-message.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-child-message.js +42 -0
- package/dist/cli/watch/sim-watch-child-message.js.map +1 -0
- package/dist/cli/watch/sim-watch-child-process.d.ts +22 -0
- package/dist/cli/watch/sim-watch-child-process.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-child-process.js +33 -0
- package/dist/cli/watch/sim-watch-child-process.js.map +1 -0
- package/dist/cli/watch/sim-watch-child-shutdown.d.ts +28 -0
- package/dist/cli/watch/sim-watch-child-shutdown.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-child-shutdown.js +59 -0
- package/dist/cli/watch/sim-watch-child-shutdown.js.map +1 -0
- package/dist/cli/watch/sim-watch-child.d.ts +42 -0
- package/dist/cli/watch/sim-watch-child.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-child.js +62 -0
- package/dist/cli/watch/sim-watch-child.js.map +1 -0
- package/dist/cli/watch/sim-watch-command.d.ts +22 -0
- package/dist/cli/watch/sim-watch-command.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-command.js +41 -0
- package/dist/cli/watch/sim-watch-command.js.map +1 -0
- package/dist/cli/watch/sim-watch-event-path.d.ts +27 -0
- package/dist/cli/watch/sim-watch-event-path.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-event-path.js +48 -0
- package/dist/cli/watch/sim-watch-event-path.js.map +1 -0
- package/dist/cli/watch/sim-watch-ignore.d.ts +15 -0
- package/dist/cli/watch/sim-watch-ignore.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-ignore.js +64 -0
- package/dist/cli/watch/sim-watch-ignore.js.map +1 -0
- package/dist/cli/watch/sim-watch-loop-guard.d.ts +35 -0
- package/dist/cli/watch/sim-watch-loop-guard.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-loop-guard.js +51 -0
- package/dist/cli/watch/sim-watch-loop-guard.js.map +1 -0
- package/dist/cli/watch/sim-watch-reporter.d.ts +38 -0
- package/dist/cli/watch/sim-watch-reporter.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-reporter.js +65 -0
- package/dist/cli/watch/sim-watch-reporter.js.map +1 -0
- package/dist/cli/watch/sim-watch-restarts.d.ts +30 -0
- package/dist/cli/watch/sim-watch-restarts.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-restarts.js +62 -0
- package/dist/cli/watch/sim-watch-restarts.js.map +1 -0
- package/dist/cli/watch/sim-watch-supervisor.d.ts +52 -0
- package/dist/cli/watch/sim-watch-supervisor.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-supervisor.js +127 -0
- package/dist/cli/watch/sim-watch-supervisor.js.map +1 -0
- package/dist/cli/watch/sim-watch-watcher.d.ts +69 -0
- package/dist/cli/watch/sim-watch-watcher.d.ts.map +1 -0
- package/dist/cli/watch/sim-watch-watcher.js +144 -0
- package/dist/cli/watch/sim-watch-watcher.js.map +1 -0
- package/dist/cli/yulin.d.ts +3 -0
- package/dist/cli/yulin.d.ts.map +1 -0
- package/dist/cli/yulin.js +14 -0
- package/dist/cli/yulin.js.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload-client.d.ts +32 -0
- package/dist/serve/http/live-reload/sim-live-reload-client.d.ts.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload-client.js +55 -0
- package/dist/serve/http/live-reload/sim-live-reload-client.js.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload-injectable.d.ts +47 -0
- package/dist/serve/http/live-reload/sim-live-reload-injectable.d.ts.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload-injectable.js +86 -0
- package/dist/serve/http/live-reload/sim-live-reload-injectable.js.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload-injector.d.ts +22 -0
- package/dist/serve/http/live-reload/sim-live-reload-injector.d.ts.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload-injector.js +72 -0
- package/dist/serve/http/live-reload/sim-live-reload-injector.js.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload-report.d.ts +18 -0
- package/dist/serve/http/live-reload/sim-live-reload-report.d.ts.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload-report.js +27 -0
- package/dist/serve/http/live-reload/sim-live-reload-report.js.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload-script.d.ts +20 -0
- package/dist/serve/http/live-reload/sim-live-reload-script.d.ts.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload-script.js +45 -0
- package/dist/serve/http/live-reload/sim-live-reload-script.js.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload.config.d.ts +12 -0
- package/dist/serve/http/live-reload/sim-live-reload.config.d.ts.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload.config.js +19 -0
- package/dist/serve/http/live-reload/sim-live-reload.config.js.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload.d.ts +52 -0
- package/dist/serve/http/live-reload/sim-live-reload.d.ts.map +1 -0
- package/dist/serve/http/live-reload/sim-live-reload.js +82 -0
- package/dist/serve/http/live-reload/sim-live-reload.js.map +1 -0
- package/dist/serve/http/live-reload/sim-local-live-reload.d.ts +42 -0
- package/dist/serve/http/live-reload/sim-local-live-reload.d.ts.map +1 -0
- package/dist/serve/http/live-reload/sim-local-live-reload.js +60 -0
- package/dist/serve/http/live-reload/sim-local-live-reload.js.map +1 -0
- package/dist/serve/http/local-server/node-server-port-binder.d.ts +39 -0
- package/dist/serve/http/local-server/node-server-port-binder.d.ts.map +1 -0
- package/dist/serve/http/local-server/node-server-port-binder.js +71 -0
- package/dist/serve/http/local-server/node-server-port-binder.js.map +1 -0
- package/dist/serve/http/local-server/node-server-port.d.ts +10 -0
- package/dist/serve/http/local-server/node-server-port.d.ts.map +1 -0
- package/dist/serve/http/local-server/node-server-port.js +19 -0
- package/dist/serve/http/local-server/node-server-port.js.map +1 -0
- package/dist/serve/http/local-server/sim-aws-local-port.error.d.ts +13 -0
- package/dist/serve/http/local-server/sim-aws-local-port.error.d.ts.map +1 -0
- package/dist/serve/http/local-server/sim-aws-local-port.error.js +16 -0
- package/dist/serve/http/local-server/sim-aws-local-port.error.js.map +1 -0
- package/dist/serve/http/local-server/sim-aws-local-request-handler.d.ts +14 -1
- package/dist/serve/http/local-server/sim-aws-local-request-handler.d.ts.map +1 -1
- package/dist/serve/http/local-server/sim-aws-local-request-handler.js +20 -2
- package/dist/serve/http/local-server/sim-aws-local-request-handler.js.map +1 -1
- package/dist/serve/http/local-server/sim-aws-local-server.d.ts +23 -0
- package/dist/serve/http/local-server/sim-aws-local-server.d.ts.map +1 -1
- package/dist/serve/http/local-server/sim-aws-local-server.js +41 -16
- package/dist/serve/http/local-server/sim-aws-local-server.js.map +1 -1
- package/dist/serve/http/local-server/sim-aws-local.config.d.ts +2 -0
- package/dist/serve/http/local-server/sim-aws-local.config.d.ts.map +1 -1
- package/dist/serve/http/local-server/sim-aws-local.config.js +6 -0
- package/dist/serve/http/local-server/sim-aws-local.config.js.map +1 -1
- package/dist/serve/index.d.ts +3 -0
- package/dist/serve/index.d.ts.map +1 -1
- package/dist/serve/index.js +3 -0
- package/dist/serve/index.js.map +1 -1
- package/dist/service/cloudformation/authorize/sim-cloudformation-authorization.d.ts +44 -0
- package/dist/service/cloudformation/authorize/sim-cloudformation-authorization.d.ts.map +1 -0
- package/dist/service/cloudformation/authorize/sim-cloudformation-authorization.js +53 -0
- package/dist/service/cloudformation/authorize/sim-cloudformation-authorization.js.map +1 -0
- package/dist/service/cloudformation/command/update-stack/update-stack.handler.d.ts +7 -0
- package/dist/service/cloudformation/command/update-stack/update-stack.handler.d.ts.map +1 -1
- package/dist/service/cloudformation/command/update-stack/update-stack.handler.js +3 -1
- package/dist/service/cloudformation/command/update-stack/update-stack.handler.js.map +1 -1
- package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.d.ts +19 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.d.ts.map +1 -1
- package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.js +40 -1
- package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.js.map +1 -1
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-deployment.d.ts +10 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-deployment.d.ts.map +1 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-deployment.js +14 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-deployment.js.map +1 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.d.ts +11 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.d.ts.map +1 -1
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.js +5 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.js.map +1 -1
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-updater.d.ts +49 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-updater.d.ts.map +1 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-updater.js +59 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-updater.js.map +1 -0
- package/dist/service/cloudformation/index.d.ts +1 -0
- package/dist/service/cloudformation/index.d.ts.map +1 -1
- package/dist/service/cloudformation/sim-cloudformation.d.ts +30 -5
- package/dist/service/cloudformation/sim-cloudformation.d.ts.map +1 -1
- package/dist/service/cloudformation/sim-cloudformation.js +45 -14
- package/dist/service/cloudformation/sim-cloudformation.js.map +1 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.d.ts +10 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.d.ts.map +1 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.js +12 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.js.map +1 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack.d.ts +14 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack.d.ts.map +1 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack.js +10 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack.js.map +1 -1
- package/dist/service/cloudformation/stack/update/sim-cfn-stack-updater.d.ts +8 -0
- package/dist/service/cloudformation/stack/update/sim-cfn-stack-updater.d.ts.map +1 -1
- package/dist/service/cloudformation/stack/update/sim-cfn-stack-updater.js +9 -1
- package/dist/service/cloudformation/stack/update/sim-cfn-stack-updater.js.map +1 -1
- package/dist/service/cloudformation/watch/sim-cfn-template-file-events.d.ts +30 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-events.d.ts.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-events.js +51 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-events.js.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-watch.d.ts +39 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-watch.d.ts.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-watch.js +73 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-watch.js.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-watches.d.ts +46 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-watches.d.ts.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-watches.js +0 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-file-watches.js.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch-report.d.ts +25 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch-report.d.ts.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch-report.js +35 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch-report.js.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch-update.d.ts +44 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch-update.d.ts.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch-update.js +75 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch-update.js.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch.type.d.ts +30 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch.type.d.ts.map +1 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch.type.js +2 -0
- package/dist/service/cloudformation/watch/sim-cfn-template-watch.type.js.map +1 -0
- package/dist/service/s3/bucket/sim-s3-bucket-access.d.ts +4 -0
- package/dist/service/s3/bucket/sim-s3-bucket-access.d.ts.map +1 -1
- package/dist/service/s3/bucket/sim-s3-bucket-access.js +6 -0
- package/dist/service/s3/bucket/sim-s3-bucket-access.js.map +1 -1
- package/dist/watch/sim-watch-runtime.d.ts +76 -0
- package/dist/watch/sim-watch-runtime.d.ts.map +1 -0
- package/dist/watch/sim-watch-runtime.js +124 -0
- package/dist/watch/sim-watch-runtime.js.map +1 -0
- package/dist/watch/sim-watch-settle.d.ts +32 -0
- package/dist/watch/sim-watch-settle.d.ts.map +1 -0
- package/dist/watch/sim-watch-settle.js +43 -0
- package/dist/watch/sim-watch-settle.js.map +1 -0
- package/dist/watch/sim-watch.config.d.ts +22 -0
- package/dist/watch/sim-watch.config.d.ts.map +1 -0
- package/dist/watch/sim-watch.config.js +39 -0
- package/dist/watch/sim-watch.config.js.map +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { SimIamActionAuthorizer } from "../../iam/authorize/sim-iam-action-authorizer.js";
|
|
2
|
+
/**
|
|
3
|
+
* Who may do what to a simulated CloudFormation Stack.
|
|
4
|
+
*
|
|
5
|
+
* Every Stack command authorizes the same way: one IAM action against the ARN
|
|
6
|
+
* of the Stack it names. Keeping the action names and the ARN together here
|
|
7
|
+
* leaves the service class with the commands themselves, and means a command
|
|
8
|
+
* says which action it is rather than assembling an ARN to ask about.
|
|
9
|
+
*/
|
|
10
|
+
export class SimCloudFormationAuthorization {
|
|
11
|
+
authorizer;
|
|
12
|
+
accountRegionScope;
|
|
13
|
+
constructor(properties) {
|
|
14
|
+
this.authorizer = new SimIamActionAuthorizer({ iam: properties.iam });
|
|
15
|
+
this.accountRegionScope = properties.accountRegionScope;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Ensure the caller may create the named Stack.
|
|
19
|
+
*/
|
|
20
|
+
createStack(stackName, caller) {
|
|
21
|
+
this.authorize("cloudformation:CreateStack", stackName, caller);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Ensure the caller may describe the named Stack.
|
|
25
|
+
*/
|
|
26
|
+
describeStacks(stackName, caller) {
|
|
27
|
+
this.authorize("cloudformation:DescribeStacks", stackName, caller);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Ensure the caller may update the named Stack.
|
|
31
|
+
*/
|
|
32
|
+
updateStack(stackName, caller) {
|
|
33
|
+
this.authorize("cloudformation:UpdateStack", stackName, caller);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Ensure the caller may delete the named Stack.
|
|
37
|
+
*/
|
|
38
|
+
deleteStack(stackName, caller) {
|
|
39
|
+
this.authorize("cloudformation:DeleteStack", stackName, caller);
|
|
40
|
+
}
|
|
41
|
+
authorize(action, stackName, caller) {
|
|
42
|
+
this.authorizer.authorize(action, this.stackArn(stackName), caller);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The Stack ARN a command operates on. A command naming no Stack, which
|
|
46
|
+
* DescribeStacks allows, is asking about every Stack in the scope.
|
|
47
|
+
*/
|
|
48
|
+
stackArn(stackName) {
|
|
49
|
+
const { accountId, regionName } = this.accountRegionScope;
|
|
50
|
+
return `arn:aws:cloudformation:${regionName}:${accountId}:stack/${stackName ?? "*"}/*`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=sim-cloudformation-authorization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cloudformation-authorization.js","sourceRoot":"","sources":["../../../../src/service/cloudformation/authorize/sim-cloudformation-authorization.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAQ1F;;;;;;;GAOG;AACH,MAAM,OAAO,8BAA8B;IACxB,UAAU,CAAyB;IACnC,kBAAkB,CAA2B;IAE9D,YAAY,UAAoD;QAC9D,IAAI,CAAC,UAAU,GAAG,IAAI,sBAAsB,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;QACtE,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,SAA6B,EAAE,MAAqB;QAC9D,IAAI,CAAC,SAAS,CAAC,4BAA4B,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,SAA6B,EAAE,MAAqB;QACjE,IAAI,CAAC,SAAS,CAAC,+BAA+B,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,SAA6B,EAAE,MAAqB;QAC9D,IAAI,CAAC,SAAS,CAAC,4BAA4B,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,SAA6B,EAAE,MAAqB;QAC9D,IAAI,CAAC,SAAS,CAAC,4BAA4B,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAEO,SAAS,CACf,MAAc,EACd,SAA6B,EAC7B,MAAqB;QAErB,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;IAED;;;OAGG;IACK,QAAQ,CAAC,SAA6B;QAC5C,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC;QAE1D,OAAO,0BAA0B,UAAU,IAAI,SAAS,UAAU,SAAS,IAAI,GAAG,IAAI,CAAC;IACzF,CAAC;CACF"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { CommandHandler } from "../../../../command/command-handler.js";
|
|
2
2
|
import type { BackgroundCompleter, BackgroundScheduler } from "../../../../util/background/background.js";
|
|
3
3
|
import type { SimAwsAccountRegionScope } from "../../../aws/sim-aws-account-region-scope.js";
|
|
4
|
+
import type { SimCdkOutContext } from "../../cdk/sim-cdk-out-context.js";
|
|
4
5
|
import type { SimCfnStack, SimCloudFormationStackName } from "../../stack/sim-cfn-stack.js";
|
|
5
6
|
import type { SimUpdateStackCommand, SimUpdateStackCommandOutput } from "./update-stack.command.js";
|
|
6
7
|
interface UpdateStackCommandHandlerProperties {
|
|
7
8
|
readonly accountRegionScope: SimAwsAccountRegionScope;
|
|
8
9
|
readonly stacks: Map<SimCloudFormationStackName, SimCfnStack>;
|
|
9
10
|
readonly background: BackgroundScheduler & BackgroundCompleter;
|
|
11
|
+
/**
|
|
12
|
+
* The CDK cloud assembly the new template was synthesized into, for an update
|
|
13
|
+
* applied from a template file rather than from an SDK Command.
|
|
14
|
+
*/
|
|
15
|
+
readonly cdkOutContext?: SimCdkOutContext | undefined;
|
|
10
16
|
}
|
|
11
17
|
/**
|
|
12
18
|
* Simulated CloudFormation UpdateStackCommand handler.
|
|
@@ -17,6 +23,7 @@ export declare class UpdateStackCommandHandler implements CommandHandler<SimUpda
|
|
|
17
23
|
private readonly accountRegionScope;
|
|
18
24
|
private readonly stacks;
|
|
19
25
|
private readonly background;
|
|
26
|
+
private readonly cdkOutContext;
|
|
20
27
|
constructor(properties: UpdateStackCommandHandlerProperties);
|
|
21
28
|
/**
|
|
22
29
|
* Apply a changed template to a simulated CloudFormation Stack.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-stack.handler.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudformation/command/update-stack/update-stack.handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AAOtC,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,2BAA2B,CAAC;AAEnC,UAAU,mCAAmC;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,0BAA0B,EAAE,WAAW,CAAC,CAAC;IAC9D,QAAQ,CAAC,UAAU,EAAE,mBAAmB,GAAG,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"update-stack.handler.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudformation/command/update-stack/update-stack.handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AAOtC,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,2BAA2B,CAAC;AAEnC,UAAU,mCAAmC;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,0BAA0B,EAAE,WAAW,CAAC,CAAC;IAC9D,QAAQ,CAAC,UAAU,EAAE,mBAAmB,GAAG,mBAAmB,CAAC;IAE/D;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACvD;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,cAAc,CAC9D,qBAAqB,EACrB,2BAA2B,CAC5B;IACC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA2B;IAC9D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+C;IACtE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4C;IACvE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA+B;IAE7D,YAAY,UAAU,EAAE,mCAAmC,EAK1D;IAED;;;;;;;;;;OAUG;IACG,MAAM,CACV,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,2BAA2B,CAAC,CAsCtC;CACF"}
|
|
@@ -11,10 +11,12 @@ export class UpdateStackCommandHandler {
|
|
|
11
11
|
accountRegionScope;
|
|
12
12
|
stacks;
|
|
13
13
|
background;
|
|
14
|
+
cdkOutContext;
|
|
14
15
|
constructor(properties) {
|
|
15
16
|
this.accountRegionScope = properties.accountRegionScope;
|
|
16
17
|
this.stacks = properties.stacks;
|
|
17
18
|
this.background = properties.background;
|
|
19
|
+
this.cdkOutContext = properties.cdkOutContext;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Apply a changed template to a simulated CloudFormation Stack.
|
|
@@ -41,7 +43,7 @@ export class UpdateStackCommandHandler {
|
|
|
41
43
|
stackName,
|
|
42
44
|
parameters: SimCfnParameters.fromInput(command.input, { stackName }),
|
|
43
45
|
accountRegionScope: this.accountRegionScope,
|
|
44
|
-
}));
|
|
46
|
+
}), { cdkOutContext: this.cdkOutContext });
|
|
45
47
|
return {
|
|
46
48
|
StackId: stack.stackName,
|
|
47
49
|
$metadata: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-stack.handler.js","sourceRoot":"","sources":["../../../../../src/service/cloudformation/command/update-stack/update-stack.handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"update-stack.handler.js","sourceRoot":"","sources":["../../../../../src/service/cloudformation/command/update-stack/update-stack.handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAYvE,OAAO,EAEL,cAAc,GACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAkB3F;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IAInB,kBAAkB,CAA2B;IAC7C,MAAM,CAA+C;IACrD,UAAU,CAA4C;IACtD,aAAa,CAA+B;IAE7D,YAAY,UAA+C;QACzD,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC,kBAAkB,CAAC;QACxD,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;IAChD,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,MAAM,CACV,OAA8B;QAE9B,aAAa,CACX,OAAO,CAAC,KAAK,CAAC,SAAS,EACvB,oCAAoC,CACrC,CAAC;QACF,aAAa,CACX,OAAO,CAAC,KAAK,CAAC,YAAY,EAC1B,uCAAuC,CACxC,CAAC;QAEF,oEAAoE;QACpE,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAEjC,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,SAAuC,CAAC;QACxE,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAEzC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,gCAAgC,CACxC,iBAAiB,SAAS,iBAAiB,CAC5C,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,CAAC,MAAM,CAChB,cAAc,CAAC,QAAQ,CACrB,OAAO,CAAC,KAAK,CAAC,YAAiD,EAC/D;YACE,SAAS;YACT,UAAU,EAAE,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC;YACpE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;SAC5C,CACF,EACD,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CACtC,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,SAAS;YACxB,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -43,6 +43,8 @@ export declare class SimCloudFormationTemplateDeployer {
|
|
|
43
43
|
private readonly stacks;
|
|
44
44
|
private readonly background;
|
|
45
45
|
private readonly templateFileLoader;
|
|
46
|
+
private readonly templateFileUpdater;
|
|
47
|
+
private readonly watches;
|
|
46
48
|
constructor(properties: SimCloudFormationTemplateDeployerProperties);
|
|
47
49
|
/**
|
|
48
50
|
* Create and deploy a simulated CloudFormation Stack from a parsed template
|
|
@@ -52,8 +54,25 @@ export declare class SimCloudFormationTemplateDeployer {
|
|
|
52
54
|
/**
|
|
53
55
|
* Create and deploy a simulated CloudFormation Stack from a synthesized CDK
|
|
54
56
|
* template file.
|
|
57
|
+
*
|
|
58
|
+
* A deployment asked to watch the file starts watching once the Stack is
|
|
59
|
+
* deployed, so a template that could not be deployed at all is not one this
|
|
60
|
+
* keeps trying to update.
|
|
55
61
|
*/
|
|
56
62
|
deployTemplateFile(properties: SimCloudFormationDeployTemplateFileProperties | string): Promise<SimCfnStack>;
|
|
63
|
+
/**
|
|
64
|
+
* Apply a synthesized CDK template file to the Stack it was deployed as, and
|
|
65
|
+
* wait for the Resource work to finish.
|
|
66
|
+
*/
|
|
67
|
+
updateTemplateFile(properties: SimCloudFormationDeployTemplateFileProperties | string): Promise<SimCfnStack>;
|
|
68
|
+
/**
|
|
69
|
+
* The template files being watched for changes.
|
|
70
|
+
*/
|
|
71
|
+
watchedTemplateFiles(): readonly string[];
|
|
72
|
+
/**
|
|
73
|
+
* Stop watching every template file being watched.
|
|
74
|
+
*/
|
|
75
|
+
stopWatchingTemplateFiles(): void;
|
|
57
76
|
private deployTemplateWithContext;
|
|
58
77
|
private createStackWithContext;
|
|
59
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-template-deployer.d.ts","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template-deployer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAO7E,OAAO,EAEL,KAAK,6CAA6C,IAAI,6CAA6C,EACpG,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cfn-template-deployer.d.ts","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template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,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA2B;IAC9D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+C;IACtE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4C;IACvE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAkC;IACrE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA4B;IAChE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;IAEpD,YAAY,UAAU,EAAE,2CAA2C,EAalE;IAED;;;OAGG;IACG,cAAc,CAClB,UAAU,EAAE,sCAAsC,GACjD,OAAO,CAAC,WAAW,CAAC,CAUtB;IAED;;;;;;;OAOG;IACG,kBAAkB,CACtB,UAAU,EAAE,6CAA6C,GAAG,MAAM,GACjE,OAAO,CAAC,WAAW,CAAC,CAStB;IAED;;;OAGG;IACG,kBAAkB,CACtB,UAAU,EAAE,6CAA6C,GAAG,MAAM,GACjE,OAAO,CAAC,WAAW,CAAC,CAItB;IAED;;OAEG;IACH,oBAAoB,IAAI,SAAS,MAAM,EAAE,CAExC;IAED;;OAEG;IACH,yBAAyB,IAAI,IAAI,CAEhC;YAEa,yBAAyB;YAqCzB,sBAAsB;CAyBrC"}
|
|
@@ -2,6 +2,9 @@ import { jsonStringify } from "../../../util/type-guard/json.js";
|
|
|
2
2
|
import { assertDefined } from "../../../util/type-guard/defined.js";
|
|
3
3
|
import { loadSiblingCdkAssetsManifest, } from "../cdk/sim-cdk-out-context.js";
|
|
4
4
|
import { SimCfnTemplateFileLoader, } from "./sim-cfn-template-file-loader.js";
|
|
5
|
+
import { SimCfnTemplateFileUpdater } from "./sim-cfn-template-file-updater.js";
|
|
6
|
+
import { simCfnTemplateFileDeployment } from "./sim-cfn-template-file-deployment.js";
|
|
7
|
+
import { SimCfnTemplateFileWatches } from "../watch/sim-cfn-template-file-watches.js";
|
|
5
8
|
import { CreateStackCommandHandler } from "../command/create-stack/create-stack.handler.js";
|
|
6
9
|
import { faker } from "@faker-js/faker";
|
|
7
10
|
/**
|
|
@@ -20,11 +23,21 @@ export class SimCloudFormationTemplateDeployer {
|
|
|
20
23
|
stacks;
|
|
21
24
|
background;
|
|
22
25
|
templateFileLoader = new SimCfnTemplateFileLoader();
|
|
26
|
+
templateFileUpdater;
|
|
27
|
+
watches;
|
|
23
28
|
constructor(properties) {
|
|
24
29
|
this.simAws = properties.simAws;
|
|
25
30
|
this.accountRegionScope = properties.accountRegionScope;
|
|
26
31
|
this.stacks = properties.stacks;
|
|
27
32
|
this.background = properties.background;
|
|
33
|
+
this.templateFileUpdater = new SimCfnTemplateFileUpdater({
|
|
34
|
+
accountRegionScope: this.accountRegionScope,
|
|
35
|
+
stacks: this.stacks,
|
|
36
|
+
background: this.background,
|
|
37
|
+
});
|
|
38
|
+
this.watches = new SimCfnTemplateFileWatches({
|
|
39
|
+
updater: this.templateFileUpdater,
|
|
40
|
+
});
|
|
28
41
|
}
|
|
29
42
|
/**
|
|
30
43
|
* Create and deploy a simulated CloudFormation Stack from a parsed template
|
|
@@ -42,9 +55,35 @@ export class SimCloudFormationTemplateDeployer {
|
|
|
42
55
|
/**
|
|
43
56
|
* Create and deploy a simulated CloudFormation Stack from a synthesized CDK
|
|
44
57
|
* template file.
|
|
58
|
+
*
|
|
59
|
+
* A deployment asked to watch the file starts watching once the Stack is
|
|
60
|
+
* deployed, so a template that could not be deployed at all is not one this
|
|
61
|
+
* keeps trying to update.
|
|
45
62
|
*/
|
|
46
63
|
async deployTemplateFile(properties) {
|
|
47
|
-
|
|
64
|
+
const deployment = simCfnTemplateFileDeployment(properties);
|
|
65
|
+
const stack = await this.deployTemplateWithContext(await this.templateFileLoader.load(deployment));
|
|
66
|
+
this.watches.watchIfAsked(deployment);
|
|
67
|
+
return stack;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Apply a synthesized CDK template file to the Stack it was deployed as, and
|
|
71
|
+
* wait for the Resource work to finish.
|
|
72
|
+
*/
|
|
73
|
+
async updateTemplateFile(properties) {
|
|
74
|
+
return await this.templateFileUpdater.update(simCfnTemplateFileDeployment(properties));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The template files being watched for changes.
|
|
78
|
+
*/
|
|
79
|
+
watchedTemplateFiles() {
|
|
80
|
+
return this.watches.paths();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Stop watching every template file being watched.
|
|
84
|
+
*/
|
|
85
|
+
stopWatchingTemplateFiles() {
|
|
86
|
+
this.watches.stopAll();
|
|
48
87
|
}
|
|
49
88
|
async deployTemplateWithContext(properties) {
|
|
50
89
|
await this.createStackWithContext({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-template-deployer.js","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template-deployer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,4BAA4B,GAE7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,wBAAwB,GAEzB,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cfn-template-deployer.js","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template-deployer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,4BAA4B,GAE7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,wBAAwB,GAEzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C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AAC,SAAuC,CACnD,CAAC;QACF,aAAa,CACX,KAAK,EACL,kCAAkC,UAAU,CAAC,SAAS,EAAE,CACzD,CAAC;QAEF,MAAM,KAAK,CAAC,qBAAqB,EAAE,CAAC;QAEpC,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,KAAK,CAAC,sBAAsB,CAClC,OASC,EACD,aAAgC,EAChC,QAAqD;QAErD,MAAM,OAAO,GAAG,IAAI,yBAAyB,CAAC;YAC5C,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,aAAa;YACb,QAAQ;SACT,CAAC,CAAC;QAEH,OAAO,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAED;;;GAGG;AACH,KAAK,UAAU,4BAA4B,CACzC,YAAgC;IAEhC,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,MAAM,4BAA4B,CAAC,YAAY,CAAC,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,SAAS,8BAA8B;IACrC,OAAO,WAAW,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAgC,CAAC;AAC7F,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SimCloudFormationDeployTemplateFileProperties } from "./sim-cfn-template-file-loader.js";
|
|
2
|
+
/**
|
|
3
|
+
* The deployment of a template file, however it was asked for.
|
|
4
|
+
*
|
|
5
|
+
* A path on its own is the same deployment as an object naming only the path.
|
|
6
|
+
* Holding one shape means a watch can deploy the file again with everything the
|
|
7
|
+
* deployment was given, rather than with only the path it came from.
|
|
8
|
+
*/
|
|
9
|
+
export declare function simCfnTemplateFileDeployment(properties: SimCloudFormationDeployTemplateFileProperties | string): SimCloudFormationDeployTemplateFileProperties;
|
|
10
|
+
//# sourceMappingURL=sim-cfn-template-file-deployment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cfn-template-file-deployment.d.ts","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template-file-deployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6CAA6C,EAAE,MAAM,mCAAmC,CAAC;AAEvG;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,6CAA6C,GAAG,MAAM,GACjE,6CAA6C,CAM/C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The deployment of a template file, however it was asked for.
|
|
3
|
+
*
|
|
4
|
+
* A path on its own is the same deployment as an object naming only the path.
|
|
5
|
+
* Holding one shape means a watch can deploy the file again with everything the
|
|
6
|
+
* deployment was given, rather than with only the path it came from.
|
|
7
|
+
*/
|
|
8
|
+
export function simCfnTemplateFileDeployment(properties) {
|
|
9
|
+
if (typeof properties === "string") {
|
|
10
|
+
return { templatePath: properties };
|
|
11
|
+
}
|
|
12
|
+
return properties;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=sim-cfn-template-file-deployment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cfn-template-file-deployment.js","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template-file-deployment.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,4BAA4B,CAC1C,UAAkE;IAElE,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;IACtC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -2,11 +2,22 @@ import type { SimCloudFormationStackName } from "../stack/sim-cfn-stack.js";
|
|
|
2
2
|
import type { CfnTemplateBodyRecord } from "../template/sim-cfn-template.js";
|
|
3
3
|
import { type SimCdkOutContext } from "../cdk/sim-cdk-out-context.js";
|
|
4
4
|
import type { SimCfnExecutableResourceBinding } from "../bind/sim-cfn-exec-binding.type.js";
|
|
5
|
+
import type { SimCfnTemplateFileWatchOptions } from "../watch/sim-cfn-template-watch.type.js";
|
|
5
6
|
export interface SimCloudFormationDeployTemplateFileProperties {
|
|
6
7
|
readonly templatePath: string;
|
|
7
8
|
readonly stackName?: SimCloudFormationStackName | string | undefined;
|
|
8
9
|
readonly parameters?: Record<string, string> | undefined;
|
|
9
10
|
readonly bindings?: readonly SimCfnExecutableResourceBinding[] | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Keep watching the template file, and apply it to the Stack again whenever
|
|
13
|
+
* it changes, rather than the deployment being the one time it is read.
|
|
14
|
+
*
|
|
15
|
+
* `true` watches with nothing to do afterwards. An options object is where a
|
|
16
|
+
* served page gets reloaded once the update is complete. Watching holds the
|
|
17
|
+
* process open until `stopWatchingTemplateFiles()`, which is what a dev
|
|
18
|
+
* process wants and a test has to remember.
|
|
19
|
+
*/
|
|
20
|
+
readonly watch?: boolean | SimCfnTemplateFileWatchOptions | undefined;
|
|
10
21
|
}
|
|
11
22
|
export interface SimCfnLoadedTemplateFile {
|
|
12
23
|
readonly stackName: SimCloudFormationStackName | string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-template-file-loader.d.ts","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template-file-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAE5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C;IACxD,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,+BAA+B,EAAE,GAAG,SAAS,CAAC;IAC3E,QAAQ,CAAC,aAAa,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACvD;AAED;;;GAGG;AACH,qBAAa,wBAAwB;IACnC;;;OAGG;IACG,IAAI,CACR,UAAU,EAAE,6CAA6C,GAAG,MAAM,GACjE,OAAO,CAAC,wBAAwB,CAAC,CA+BnC;CACF"}
|
|
@@ -2,6 +2,7 @@ import { readFile } from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { jsonParse } from "../../../util/type-guard/json.js";
|
|
4
4
|
import { loadSiblingCdkAssetsManifest, } from "../cdk/sim-cdk-out-context.js";
|
|
5
|
+
import { simWatch } from "../../../watch/sim-watch-runtime.js";
|
|
5
6
|
/**
|
|
6
7
|
* Loads a synthesized CloudFormation template file and gathers adjacent CDK
|
|
7
8
|
* context needed to deploy it.
|
|
@@ -18,6 +19,10 @@ export class SimCfnTemplateFileLoader {
|
|
|
18
19
|
const stackName = typeof properties === "string"
|
|
19
20
|
? stackNameFromTemplatePath(templatePath)
|
|
20
21
|
: (properties.stackName ?? stackNameFromTemplatePath(templatePath));
|
|
22
|
+
// The template is named to a `yulin watch` supervisor, so re-synthing a
|
|
23
|
+
// stack restarts the process that deployed it. Nothing happens outside
|
|
24
|
+
// watch mode.
|
|
25
|
+
simWatch.reportPath(templatePath);
|
|
21
26
|
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
22
27
|
const templateBody = await readFile(templatePath, "utf8");
|
|
23
28
|
const template = jsonParse(templateBody);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cfn-template-file-loader.js","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template-file-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,SAAS,EAAmB,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EACL,4BAA4B,GAE7B,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-cfn-template-file-loader.js","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template-file-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,SAAS,EAAmB,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EACL,4BAA4B,GAE7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AA6B/D;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IACnC;;;OAGG;IACH,KAAK,CAAC,IAAI,CACR,UAAkE;QAElE,MAAM,YAAY,GAChB,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC;QACxE,MAAM,UAAU,GACd,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;QACrE,MAAM,QAAQ,GACZ,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;QACnE,MAAM,SAAS,GACb,OAAO,UAAU,KAAK,QAAQ;YAC5B,CAAC,CAAC,yBAAyB,CAAC,YAAY,CAAC;YACzC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,IAAI,yBAAyB,CAAC,YAAY,CAAC,CAAC,CAAC;QAExE,wEAAwE;QACxE,uEAAuE;QACvE,cAAc;QACd,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAElC,mEAAmE;QACnE,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,QAAQ,GAAG,SAAS,CACxB,YAAiD,CAClD,CAAC;QACF,MAAM,aAAa,GAAG,MAAM,4BAA4B,CAAC,YAAY,CAAC,CAAC;QAEvE,OAAO;YACL,SAAS;YACT,QAAQ;YACR,UAAU;YACV,QAAQ;YACR,aAAa;SACd,CAAC;IACJ,CAAC;CACF;AAED,SAAS,yBAAyB,CAChC,YAAoB;IAEpB,OAAO,IAAI;SACR,QAAQ,CAAC,YAAY,CAAC;SACtB,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAA+B,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { SimCfnStack, SimCloudFormationStackName } from "../stack/sim-cfn-stack.js";
|
|
2
|
+
import { type SimCloudFormationDeployTemplateFileProperties } from "./sim-cfn-template-file-loader.js";
|
|
3
|
+
import type { SimAwsAccountRegionScope } from "../../aws/sim-aws-account-region-scope.js";
|
|
4
|
+
import type { BackgroundCompleter, BackgroundScheduler } from "../../../util/background/background.js";
|
|
5
|
+
/**
|
|
6
|
+
* Applying a template file to the Stack it was deployed as.
|
|
7
|
+
*
|
|
8
|
+
* Named as an interface because a watch only needs the applying, and standing
|
|
9
|
+
* in for it is how the answer to an update that failed is tested without a
|
|
10
|
+
* failure having to be arranged in simulated AWS.
|
|
11
|
+
*/
|
|
12
|
+
export interface SimCfnTemplateFileUpdating {
|
|
13
|
+
update(properties: SimCloudFormationDeployTemplateFileProperties): Promise<SimCfnStack>;
|
|
14
|
+
}
|
|
15
|
+
interface SimCfnTemplateFileUpdaterProperties {
|
|
16
|
+
readonly accountRegionScope: SimAwsAccountRegionScope;
|
|
17
|
+
readonly stacks: Map<SimCloudFormationStackName, SimCfnStack>;
|
|
18
|
+
readonly background: BackgroundScheduler & BackgroundCompleter;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Applies a template file to the Stack it was deployed as.
|
|
22
|
+
*
|
|
23
|
+
* The same file, read again. Whatever the deployment was given alongside the
|
|
24
|
+
* path, such as parameters or a Stack name, is given again, so the difference
|
|
25
|
+
* applied is the difference in the file rather than the difference between one
|
|
26
|
+
* call and another.
|
|
27
|
+
*
|
|
28
|
+
* Reading it here rather than in the watch is what makes the deployed Stack and
|
|
29
|
+
* the updated Stack read the same way, including the sibling assets manifest a
|
|
30
|
+
* re-synthesis rewrites beside the template.
|
|
31
|
+
*/
|
|
32
|
+
export declare class SimCfnTemplateFileUpdater implements SimCfnTemplateFileUpdating {
|
|
33
|
+
private readonly accountRegionScope;
|
|
34
|
+
private readonly stacks;
|
|
35
|
+
private readonly background;
|
|
36
|
+
private readonly templateFileLoader;
|
|
37
|
+
constructor(properties: SimCfnTemplateFileUpdaterProperties);
|
|
38
|
+
/**
|
|
39
|
+
* Read the template file and apply it to its Stack.
|
|
40
|
+
*
|
|
41
|
+
* Returns once the Resource work has finished, so a caller knows the
|
|
42
|
+
* simulated environment is serving the new template rather than part way to
|
|
43
|
+
* it. An update that fails throws what failed it, and a template that changed
|
|
44
|
+
* nothing throws the ValidationError CloudFormation refuses it with.
|
|
45
|
+
*/
|
|
46
|
+
update(properties: SimCloudFormationDeployTemplateFileProperties): Promise<SimCfnStack>;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=sim-cfn-template-file-updater.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cfn-template-file-updater.d.ts","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template-file-updater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAEL,KAAK,6CAA6C,EACnD,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,wCAAwC,CAAC;AAGhD;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,MAAM,CACJ,UAAU,EAAE,6CAA6C,GACxD,OAAO,CAAC,WAAW,CAAC,CAAC;CACzB;AAED,UAAU,mCAAmC;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,0BAA0B,EAAE,WAAW,CAAC,CAAC;IAC9D,QAAQ,CAAC,UAAU,EAAE,mBAAmB,GAAG,mBAAmB,CAAC;CAChE;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,yBAA0B,YAAW,0BAA0B;IAC1E,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA2B;IAC9D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+C;IACtE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4C;IACvE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAkC;IAErE,YAAY,UAAU,EAAE,mCAAmC,EAI1D;IAED;;;;;;;OAOG;IACG,MAAM,CACV,UAAU,EAAE,6CAA6C,GACxD,OAAO,CAAC,WAAW,CAAC,CA8BtB;CACF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsonStringify } from "../../../util/type-guard/json.js";
|
|
2
|
+
import { assertDefined } from "../../../util/type-guard/defined.js";
|
|
3
|
+
import { SimCfnTemplateFileLoader, } from "./sim-cfn-template-file-loader.js";
|
|
4
|
+
import { UpdateStackCommandHandler } from "../command/update-stack/update-stack.handler.js";
|
|
5
|
+
/**
|
|
6
|
+
* Applies a template file to the Stack it was deployed as.
|
|
7
|
+
*
|
|
8
|
+
* The same file, read again. Whatever the deployment was given alongside the
|
|
9
|
+
* path, such as parameters or a Stack name, is given again, so the difference
|
|
10
|
+
* applied is the difference in the file rather than the difference between one
|
|
11
|
+
* call and another.
|
|
12
|
+
*
|
|
13
|
+
* Reading it here rather than in the watch is what makes the deployed Stack and
|
|
14
|
+
* the updated Stack read the same way, including the sibling assets manifest a
|
|
15
|
+
* re-synthesis rewrites beside the template.
|
|
16
|
+
*/
|
|
17
|
+
export class SimCfnTemplateFileUpdater {
|
|
18
|
+
accountRegionScope;
|
|
19
|
+
stacks;
|
|
20
|
+
background;
|
|
21
|
+
templateFileLoader = new SimCfnTemplateFileLoader();
|
|
22
|
+
constructor(properties) {
|
|
23
|
+
this.accountRegionScope = properties.accountRegionScope;
|
|
24
|
+
this.stacks = properties.stacks;
|
|
25
|
+
this.background = properties.background;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Read the template file and apply it to its Stack.
|
|
29
|
+
*
|
|
30
|
+
* Returns once the Resource work has finished, so a caller knows the
|
|
31
|
+
* simulated environment is serving the new template rather than part way to
|
|
32
|
+
* it. An update that fails throws what failed it, and a template that changed
|
|
33
|
+
* nothing throws the ValidationError CloudFormation refuses it with.
|
|
34
|
+
*/
|
|
35
|
+
async update(properties) {
|
|
36
|
+
const loaded = await this.templateFileLoader.load(properties);
|
|
37
|
+
const handler = new UpdateStackCommandHandler({
|
|
38
|
+
accountRegionScope: this.accountRegionScope,
|
|
39
|
+
stacks: this.stacks,
|
|
40
|
+
background: this.background,
|
|
41
|
+
cdkOutContext: loaded.cdkOutContext,
|
|
42
|
+
});
|
|
43
|
+
await handler.handle({
|
|
44
|
+
input: {
|
|
45
|
+
StackName: loaded.stackName,
|
|
46
|
+
TemplateBody: jsonStringify(loaded.template),
|
|
47
|
+
Parameters: Object.entries(loaded.parameters ?? {}).map(([parameterKey, parameterValue]) => ({
|
|
48
|
+
ParameterKey: parameterKey,
|
|
49
|
+
ParameterValue: parameterValue,
|
|
50
|
+
})),
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
const stack = this.stacks.get(loaded.stackName);
|
|
54
|
+
assertDefined(stack, `Sim CloudFormation Stack named ${loaded.stackName}`);
|
|
55
|
+
await stack.waitForUpdateComplete();
|
|
56
|
+
return stack;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=sim-cfn-template-file-updater.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-cfn-template-file-updater.js","sourceRoot":"","sources":["../../../../src/service/cloudformation/deploy/sim-cfn-template-file-updater.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,wBAAwB,GAEzB,MAAM,mCAAmC,CAAC;AAM3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAqB5F;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,yBAAyB;IACnB,kBAAkB,CAA2B;IAC7C,MAAM,CAA+C;IACrD,UAAU,CAA4C;IACtD,kBAAkB,GAAG,IAAI,wBAAwB,EAAE,CAAC;IAErE,YAAY,UAA+C;QACzD,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC,kBAAkB,CAAC;QACxD,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;IAC1C,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,MAAM,CACV,UAAyD;QAEzD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,IAAI,yBAAyB,CAAC;YAC5C,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,aAAa,EAAE,MAAM,CAAC,aAAa;SACpC,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,MAAM,CAAC;YACnB,KAAK,EAAE;gBACL,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC;gBAC5C,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CACrD,CAAC,CAAC,YAAY,EAAE,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC;oBACnC,YAAY,EAAE,YAAY;oBAC1B,cAAc,EAAE,cAAc;iBAC/B,CAAC,CACH;aACF;SACF,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAC3B,MAAM,CAAC,SAAuC,CAC/C,CAAC;QACF,aAAa,CAAC,KAAK,EAAE,kCAAkC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAE3E,MAAM,KAAK,CAAC,qBAAqB,EAAE,CAAC;QAEpC,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/cloudformation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/cloudformation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -33,7 +33,7 @@ export declare class SimCloudFormation {
|
|
|
33
33
|
private readonly stacks;
|
|
34
34
|
private readonly templateDeployer;
|
|
35
35
|
private readonly sdkRouter;
|
|
36
|
-
private readonly
|
|
36
|
+
private readonly authorization;
|
|
37
37
|
constructor(properties: SimCloudFormationProperties);
|
|
38
38
|
/**
|
|
39
39
|
* Get a simulated CloudFormation Stack by name.
|
|
@@ -81,13 +81,38 @@ export declare class SimCloudFormation {
|
|
|
81
81
|
*/
|
|
82
82
|
deployTemplateFile(properties: SimCloudFormationDeployTemplateFileProperties | string): Promise<SimCfnStack>;
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Convenience wrapper method to apply a synthesized CDK template file to the
|
|
85
|
+
* simulated CloudFormation Stack it was deployed as.
|
|
86
|
+
*
|
|
87
|
+
* The file is read again, so a template synthesized a second time is applied
|
|
88
|
+
* as the change it is: Resources it adds are created, ones it drops are
|
|
89
|
+
* deleted, and everything else keeps what it holds. Give it what the
|
|
90
|
+
* deployment was given, since parameters are part of what an update applies.
|
|
91
|
+
*
|
|
92
|
+
* Returns once the update has finished, and throws what stopped it if it
|
|
93
|
+
* failed, including the `No updates are to be performed.` a file that was
|
|
94
|
+
* written without being changed is refused with.
|
|
85
95
|
*/
|
|
86
|
-
|
|
96
|
+
updateTemplateFile(properties: SimCloudFormationDeployTemplateFileProperties | string): Promise<SimCfnStack>;
|
|
97
|
+
/**
|
|
98
|
+
* The template files being watched for changes.
|
|
99
|
+
*
|
|
100
|
+
* A file deployed with `watch` is read again whenever it changes, and the
|
|
101
|
+
* Stack it deployed is updated in place from it.
|
|
102
|
+
*/
|
|
103
|
+
watchedTemplateFiles(): readonly string[];
|
|
104
|
+
/**
|
|
105
|
+
* Stop watching template files.
|
|
106
|
+
*
|
|
107
|
+
* A watch holds an open filesystem handle, so a process with one open does
|
|
108
|
+
* not exit on its own. A dev process wants exactly that and never calls this;
|
|
109
|
+
* anything with an end, such as a test, calls it when it is done.
|
|
110
|
+
*/
|
|
111
|
+
stopWatchingTemplateFiles(): void;
|
|
87
112
|
/**
|
|
88
|
-
*
|
|
113
|
+
* Get this service's SDK Command router for SDK client interception.
|
|
89
114
|
*/
|
|
90
|
-
|
|
115
|
+
sdkCommandRouter(): SimSdkCommandRouter;
|
|
91
116
|
private createStackWithContext;
|
|
92
117
|
}
|
|
93
118
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-cloudformation.d.ts","sourceRoot":"","sources":["../../../src/service/cloudformation/sim-cloudformation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACV,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,sDAAsD,CAAC;AAE9D,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,gDAAgD,CAAC;AAExD,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,gDAAgD,CAAC;AAGxD,OAAO,EACL,KAAK,sCAAsC,IAAI,sCAAsC,EAEtF,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,6CAA6C,IAAI,6CAA6C,EAAE,MAAM,0CAA0C,CAAC;AAI/J,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,kDAAkD,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;CAChC;AAED,UAAU,2BAA2B;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACx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