@intelligems/sst 2.49.3 → 2.49.6-ig.10
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/cli/commands/dev.js +69 -3
- package/cli/sst.js +0 -1
- package/constructs/Function.d.ts +2 -1
- package/constructs/Function.js +4 -3
- package/credentials.js +4 -3
- package/iot.d.ts +31 -0
- package/iot.js +171 -10
- package/package.json +2 -2
- package/runtime/debug-bridge-logging.d.ts +24 -0
- package/runtime/debug-bridge-logging.js +98 -0
- package/runtime/debug-file-logger.d.ts +80 -0
- package/runtime/debug-file-logger.js +148 -0
- package/runtime/event-trace-logging.d.ts +27 -0
- package/runtime/event-trace-logging.js +69 -0
- package/runtime/handlers/node.js +62 -21
- package/runtime/handlers.d.ts +6 -2
- package/runtime/handlers.js +130 -59
- package/runtime/iot.js +31 -4
- package/runtime/mono-build-config.d.ts +58 -0
- package/runtime/mono-build-config.js +104 -0
- package/runtime/request-utils.d.ts +21 -0
- package/runtime/request-utils.js +102 -0
- package/runtime/runtime.d.ts +1 -0
- package/runtime/server.d.ts +4 -1
- package/runtime/server.js +122 -29
- package/runtime/worker-pool-logging.d.ts +29 -0
- package/runtime/worker-pool-logging.js +185 -0
- package/runtime/workers.d.ts +39 -7
- package/runtime/workers.js +831 -38
- package/stacks/deploy.js +14 -10
- package/stacks/synth.js +5 -4
- package/support/bridge/live-lambda.mjs +38 -38
- package/support/nodejs-runtime/index.mjs +44 -11
- package/support/python-runtime/runtime.py +116 -45
- package/util/user-configuration.js +19 -7
- package/README.md +0 -43
- package/package.json.bak +0 -156
package/stacks/deploy.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from "url";
|
|
2
3
|
import { useBus } from "../bus.js";
|
|
3
4
|
import { useProject } from "../project.js";
|
|
4
5
|
import { useAWSClient, useAWSProvider } from "../credentials.js";
|
|
@@ -7,6 +8,7 @@ import { filterOutputs, isFailed, monitor, } from "./monitor.js";
|
|
|
7
8
|
import { VisibleError } from "../error.js";
|
|
8
9
|
export async function publishAssets(stacks) {
|
|
9
10
|
Logger.debug("Publishing assets");
|
|
11
|
+
const { cdk } = useProject().config;
|
|
10
12
|
const results = {};
|
|
11
13
|
for (const stackArtifact of stacks) {
|
|
12
14
|
const cfnStack = await getCloudFormationStack(stackArtifact);
|
|
@@ -15,7 +17,7 @@ export async function publishAssets(stacks) {
|
|
|
15
17
|
await buildAndPublishAssets(deployment, stackArtifact);
|
|
16
18
|
results[stackArtifact.stackName] = {
|
|
17
19
|
isUpdate: cfnStack && cfnStack.StackStatus !== "REVIEW_IN_PROGRESS",
|
|
18
|
-
params: await buildCloudFormationStackParams(deployment, stackArtifact),
|
|
20
|
+
params: await buildCloudFormationStackParams(deployment, stackArtifact, cdk),
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
23
|
return results;
|
|
@@ -87,7 +89,7 @@ export async function deploy(stack) {
|
|
|
87
89
|
cfnStack?.StackStatus === "ROLLBACK_FAILED") {
|
|
88
90
|
await deleteCloudFormationStack(stack.stackName);
|
|
89
91
|
}
|
|
90
|
-
const stackParams = await buildCloudFormationStackParams(deployment, stack);
|
|
92
|
+
const stackParams = await buildCloudFormationStackParams(deployment, stack, cdk);
|
|
91
93
|
try {
|
|
92
94
|
cfnStack && cfnStack.StackStatus !== "REVIEW_IN_PROGRESS"
|
|
93
95
|
? await updateCloudFormationStack(stackParams)
|
|
@@ -192,9 +194,9 @@ async function addInUseExports(stackArtifact, cfnStack) {
|
|
|
192
194
|
}
|
|
193
195
|
async function createCdkDeployments() {
|
|
194
196
|
const cdkToolkitUrl = await import.meta.resolve("@aws-cdk/toolkit-lib");
|
|
195
|
-
const cdkToolkitPath =
|
|
196
|
-
const { Deployments } = await import(path.resolve(cdkToolkitPath, "..", "api", "deployments", "deployments.js"));
|
|
197
|
-
const { IoHelper } = await import(path.resolve(cdkToolkitPath, "..", "api", "io", "private", "io-helper.js"));
|
|
197
|
+
const cdkToolkitPath = fileURLToPath(cdkToolkitUrl);
|
|
198
|
+
const { Deployments } = await import(pathToFileURL(path.resolve(cdkToolkitPath, "..", "api", "deployments", "deployments.js")).href);
|
|
199
|
+
const { IoHelper } = await import(pathToFileURL(path.resolve(cdkToolkitPath, "..", "api", "io", "private", "io-helper.js")).href);
|
|
198
200
|
const provider = await useAWSProvider();
|
|
199
201
|
await useAWSProvider();
|
|
200
202
|
const ioHelper = IoHelper.fromActionAwareIoHost({
|
|
@@ -227,17 +229,19 @@ async function buildAndPublishAssets(deployment, stackArtifact) {
|
|
|
227
229
|
}
|
|
228
230
|
}
|
|
229
231
|
}
|
|
230
|
-
async function buildCloudFormationStackParams(deployment, stack) {
|
|
231
|
-
const
|
|
232
|
+
async function buildCloudFormationStackParams(deployment, stack, cdkOptions) {
|
|
233
|
+
const env = await deployment.envs.accessStackForMutableStackOperations(stack);
|
|
234
|
+
const executionRoleArn = cdkOptions?.cloudFormationExecutionRole ?? await env.replacePlaceholders(stack.cloudFormationExecutionRoleArn);
|
|
232
235
|
const s3Url = stack
|
|
233
|
-
.stackTemplateAssetObjectUrl.replace("${AWS::AccountId}",
|
|
236
|
+
.stackTemplateAssetObjectUrl.replace("${AWS::AccountId}", env.resolvedEnvironment.account)
|
|
234
237
|
.match(/s3:\/\/([^/]+)\/(.*)$/);
|
|
235
238
|
const templateUrl = s3Url
|
|
236
|
-
? `https://s3.${
|
|
239
|
+
? `https://s3.${env.resolvedEnvironment.region}.amazonaws.com/${s3Url[1]}/${s3Url[2]}`
|
|
237
240
|
: stack.stackTemplateAssetObjectUrl;
|
|
238
241
|
return {
|
|
239
242
|
StackName: stack.stackName,
|
|
240
243
|
TemplateURL: templateUrl,
|
|
244
|
+
RoleARN: executionRoleArn,
|
|
241
245
|
//TemplateBody: bodyParameter.TemplateBody,
|
|
242
246
|
//Parameters: stackParams.apiParameters,
|
|
243
247
|
Parameters: [],
|
|
@@ -257,7 +261,7 @@ async function getCloudFormationStack(stack) {
|
|
|
257
261
|
const client = useAWSClient(CloudFormationClient);
|
|
258
262
|
try {
|
|
259
263
|
const { Stacks: stacks } = await client.send(new DescribeStacksCommand({
|
|
260
|
-
StackName: stack.
|
|
264
|
+
StackName: stack.stackName,
|
|
261
265
|
}));
|
|
262
266
|
if (!stacks || stacks.length === 0)
|
|
263
267
|
return;
|
package/stacks/synth.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Logger } from "../logger.js";
|
|
|
2
2
|
import { useProject } from "../project.js";
|
|
3
3
|
import { useAWSProvider, useSTSIdentity } from "../credentials.js";
|
|
4
4
|
import path from "path";
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from "url";
|
|
5
6
|
import { VisibleError } from "../error.js";
|
|
6
7
|
import { Semaphore } from "../util/semaphore.js";
|
|
7
8
|
import { Configuration } from "../util/user-configuration.js";
|
|
@@ -11,10 +12,10 @@ export async function synth(opts) {
|
|
|
11
12
|
const { App } = await import("../constructs/App.js");
|
|
12
13
|
const cxapi = await import("@aws-cdk/cx-api");
|
|
13
14
|
const cdkToolkitUrl = await import.meta.resolve("@aws-cdk/toolkit-lib");
|
|
14
|
-
const cdkToolkitPath =
|
|
15
|
-
const { IoHelper } = await import(path.resolve(cdkToolkitPath, "..", "api", "io", "private", "io-helper.js"));
|
|
16
|
-
const { PluginHost } = await import(path.resolve(cdkToolkitPath, "..", "api", "plugin", "plugin.js"));
|
|
17
|
-
const { provideContextValues } = await import(path.resolve(cdkToolkitPath, "..", "context-providers", "index.js"));
|
|
15
|
+
const cdkToolkitPath = fileURLToPath(cdkToolkitUrl);
|
|
16
|
+
const { IoHelper } = await import(pathToFileURL(path.resolve(cdkToolkitPath, "..", "api", "io", "private", "io-helper.js")).href);
|
|
17
|
+
const { PluginHost } = await import(pathToFileURL(path.resolve(cdkToolkitPath, "..", "api", "plugin", "plugin.js")).href);
|
|
18
|
+
const { provideContextValues } = await import(pathToFileURL(path.resolve(cdkToolkitPath, "..", "context-providers", "index.js")).href);
|
|
18
19
|
const project = useProject();
|
|
19
20
|
const cwd = process.cwd();
|
|
20
21
|
process.chdir(project.paths.root);
|