sst 2.43.8 → 2.44.1
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/cdk/deploy-stack.js +8 -0
- package/cdk/deployments.js +12 -5
- package/node/event-bus/index.d.ts +7 -1
- package/node/event-bus/index.js +4 -1
- package/package.json +11 -11
package/cdk/deploy-stack.js
CHANGED
|
@@ -434,6 +434,11 @@ async function canSkipDeploy(deployStackOptions, cloudFormationStack, parameterC
|
|
|
434
434
|
debug(`${deployName}: tags have changed`);
|
|
435
435
|
return false;
|
|
436
436
|
}
|
|
437
|
+
// Notification arns have changed
|
|
438
|
+
if (!arrayEquals(cloudFormationStack.notificationArns, deployStackOptions.notificationArns ?? [])) {
|
|
439
|
+
debug(`${deployName}: notification arns have changed`);
|
|
440
|
+
return false;
|
|
441
|
+
}
|
|
437
442
|
// Termination protection has been updated
|
|
438
443
|
if (!!deployStackOptions.stack.terminationProtection !==
|
|
439
444
|
!!cloudFormationStack.terminationProtection) {
|
|
@@ -476,3 +481,6 @@ function compareTags(a, b) {
|
|
|
476
481
|
function suffixWithErrors(msg, errors) {
|
|
477
482
|
return errors && errors.length > 0 ? `${msg}: ${errors.join(", ")}` : msg;
|
|
478
483
|
}
|
|
484
|
+
function arrayEquals(a, b) {
|
|
485
|
+
return (a.every((item) => b.includes(item)) && b.every((item) => a.includes(item)));
|
|
486
|
+
}
|
package/cdk/deployments.js
CHANGED
|
@@ -10,7 +10,8 @@ import { EnvironmentResourcesRegistry, } from "sst-aws-cdk/lib/api/environment-r
|
|
|
10
10
|
import { loadCurrentTemplateWithNestedStacks, loadCurrentTemplate, } from "sst-aws-cdk/lib/api/nested-stack-helpers.js";
|
|
11
11
|
import { CloudFormationStack, } from "sst-aws-cdk/lib/api/util/cloudformation.js";
|
|
12
12
|
import { replaceEnvPlaceholders } from "sst-aws-cdk/lib/api/util/placeholders.js";
|
|
13
|
-
import {
|
|
13
|
+
import { makeBodyParameter } from "sst-aws-cdk/lib/api/util/template-body-parameter.js";
|
|
14
|
+
import { AssetManifestBuilder } from "sst-aws-cdk/lib/util/asset-manifest-builder.js";
|
|
14
15
|
/**
|
|
15
16
|
* Scope for a single set of deployments from a set of Cloud Assembly Artifacts
|
|
16
17
|
*
|
|
@@ -51,7 +52,7 @@ export class Deployments {
|
|
|
51
52
|
const { stackSdk, resolvedEnvironment, envResources } = await this.prepareSdkFor(stackArtifact, undefined, Mode.ForReading);
|
|
52
53
|
const cfn = stackSdk.cloudFormation();
|
|
53
54
|
// Upload the template, if necessary, before passing it to CFN
|
|
54
|
-
const cfnParam = await
|
|
55
|
+
const cfnParam = await makeBodyParameter(stackArtifact, resolvedEnvironment, new AssetManifestBuilder(), envResources, stackSdk);
|
|
55
56
|
const response = await cfn.getTemplateSummary(cfnParam).promise();
|
|
56
57
|
if (!response.ResourceIdentifierSummaries) {
|
|
57
58
|
debug('GetTemplateSummary API call did not return "ResourceIdentifierSummaries"');
|
|
@@ -175,6 +176,7 @@ export class Deployments {
|
|
|
175
176
|
const stackSdk = await this.cachedSdkForEnvironment(resolvedEnvironment, mode, {
|
|
176
177
|
assumeRoleArn: arns.assumeRoleArn,
|
|
177
178
|
assumeRoleExternalId: stack.assumeRoleExternalId,
|
|
179
|
+
assumeRoleAdditionalOptions: stack.assumeRoleAdditionalOptions,
|
|
178
180
|
});
|
|
179
181
|
return {
|
|
180
182
|
stackSdk: stackSdk.sdk,
|
|
@@ -214,6 +216,7 @@ export class Deployments {
|
|
|
214
216
|
const stackSdk = await this.cachedSdkForEnvironment(resolvedEnvironment, Mode.ForReading, {
|
|
215
217
|
assumeRoleArn: arns.lookupRoleArn,
|
|
216
218
|
assumeRoleExternalId: stack.lookupRole?.assumeRoleExternalId,
|
|
219
|
+
assumeRoleAdditionalOptions: stack.lookupRole?.assumeRoleAdditionalOptions,
|
|
217
220
|
});
|
|
218
221
|
const envResources = this.environmentResources.for(resolvedEnvironment, stackSdk.sdk);
|
|
219
222
|
// if we succeed in assuming the lookup role, make sure we have the correct bootstrap stack version
|
|
@@ -310,13 +313,17 @@ export class Deployments {
|
|
|
310
313
|
}
|
|
311
314
|
}
|
|
312
315
|
async cachedSdkForEnvironment(environment, mode, options) {
|
|
313
|
-
const
|
|
316
|
+
const cacheKeyElements = [
|
|
314
317
|
environment.account,
|
|
315
318
|
environment.region,
|
|
316
319
|
`${mode}`,
|
|
317
320
|
options?.assumeRoleArn ?? "",
|
|
318
321
|
options?.assumeRoleExternalId ?? "",
|
|
319
|
-
]
|
|
322
|
+
];
|
|
323
|
+
if (options?.assumeRoleAdditionalOptions) {
|
|
324
|
+
cacheKeyElements.push(JSON.stringify(options.assumeRoleAdditionalOptions));
|
|
325
|
+
}
|
|
326
|
+
const cacheKey = cacheKeyElements.join(":");
|
|
320
327
|
const existing = this.sdkCache.get(cacheKey);
|
|
321
328
|
if (existing) {
|
|
322
329
|
return existing;
|
|
@@ -351,7 +358,7 @@ class ParallelSafeAssetProgress {
|
|
|
351
358
|
}
|
|
352
359
|
onPublishEvent(type, event) {
|
|
353
360
|
const handler = this.quiet && type !== "fail" ? debug : EVENT_TO_LOGGER[type];
|
|
354
|
-
handler(`${this.prefix}
|
|
361
|
+
handler(`${this.prefix}${type}: ${event.message}`);
|
|
355
362
|
}
|
|
356
363
|
}
|
|
357
364
|
/**
|
|
@@ -4,6 +4,12 @@ export declare const EventBus: EventBusResources;
|
|
|
4
4
|
import { PutEventsCommandOutput } from "@aws-sdk/client-eventbridge";
|
|
5
5
|
import { EventBridgeEvent } from "aws-lambda";
|
|
6
6
|
import { ZodObject, ZodSchema, z } from "zod";
|
|
7
|
+
/**
|
|
8
|
+
* @link https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eventbridge/Interface/PutEventsCommandInput/
|
|
9
|
+
*/
|
|
10
|
+
type PublishOptions = {
|
|
11
|
+
traceHeader?: string;
|
|
12
|
+
};
|
|
7
13
|
/**
|
|
8
14
|
* PutEventsCommandOutput is used in return type of createEvent, in case the consumer of SST builds
|
|
9
15
|
* their project with declaration files, this is not portable. In order to allow TS to generate a
|
|
@@ -18,7 +24,7 @@ export declare function createEventBuilder<Bus extends keyof typeof EventBus, Me
|
|
|
18
24
|
metadataFn?: MetadataFunction;
|
|
19
25
|
validator: Validator;
|
|
20
26
|
}): <Type extends string, Schema extends Parameters<Validator>[0]>(type: Type, schema: Schema) => {
|
|
21
|
-
publish: undefined extends MetadataSchema ? (properties: inferParser<Schema>["in"]) => Promise<PutEventsCommandOutput> : (properties: inferParser<Schema>["in"], metadata: inferParser<MetadataSchema>["in"]) => Promise<void>;
|
|
27
|
+
publish: undefined extends MetadataSchema ? (properties: inferParser<Schema>["in"], options?: PublishOptions) => Promise<PutEventsCommandOutput> : (properties: inferParser<Schema>["in"], metadata: inferParser<MetadataSchema>["in"], options?: PublishOptions) => Promise<void>;
|
|
22
28
|
type: Type;
|
|
23
29
|
$input: inferParser<Schema>["in"];
|
|
24
30
|
$output: inferParser<Schema>["out"];
|
package/node/event-bus/index.js
CHANGED
|
@@ -10,7 +10,7 @@ export function createEventBuilder(input) {
|
|
|
10
10
|
const metadataValidator = input.metadata ? validator(input.metadata) : null;
|
|
11
11
|
return function event(type, schema) {
|
|
12
12
|
const validate = validator(schema);
|
|
13
|
-
async function publish(properties, metadata) {
|
|
13
|
+
async function publish(properties, metadata, options) {
|
|
14
14
|
const result = await useLoader("sst.bus.publish", async (input) => {
|
|
15
15
|
const size = 10;
|
|
16
16
|
const promises = [];
|
|
@@ -18,6 +18,9 @@ export function createEventBuilder(input) {
|
|
|
18
18
|
const chunk = input.slice(i, i + size);
|
|
19
19
|
promises.push(client.send(new PutEventsCommand({
|
|
20
20
|
Entries: chunk,
|
|
21
|
+
...(options?.traceHeader && {
|
|
22
|
+
TraceHeader: options.traceHeader,
|
|
23
|
+
}),
|
|
21
24
|
})));
|
|
22
25
|
}
|
|
23
26
|
const settled = await Promise.allSettled(promises);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "sst",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.44.1",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sst": "cli/sst.js"
|
|
7
7
|
},
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/sst/
|
|
13
|
+
"url": "git+https://github.com/sst/v2.git",
|
|
14
14
|
"directory": "packages/cli"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://sst.dev",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aws-cdk/aws-lambda-python-alpha": "2.
|
|
29
|
-
"@aws-cdk/cloud-assembly-schema": "
|
|
30
|
-
"@aws-cdk/cloudformation-diff": "2.
|
|
31
|
-
"@aws-cdk/cx-api": "2.
|
|
28
|
+
"@aws-cdk/aws-lambda-python-alpha": "2.161.1-alpha.0",
|
|
29
|
+
"@aws-cdk/cloud-assembly-schema": "38.0.1",
|
|
30
|
+
"@aws-cdk/cloudformation-diff": "2.161.1",
|
|
31
|
+
"@aws-cdk/cx-api": "2.161.1",
|
|
32
32
|
"@aws-crypto/sha256-js": "^5.2.0",
|
|
33
33
|
"@aws-sdk/client-cloudformation": "^3.454.0",
|
|
34
34
|
"@aws-sdk/client-ecs": "^3.454.0",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"@smithy/signature-v4": "^2.0.16",
|
|
54
54
|
"@trpc/server": "9.16.0",
|
|
55
55
|
"adm-zip": "^0.5.10",
|
|
56
|
-
"aws-cdk-lib": "2.
|
|
56
|
+
"aws-cdk-lib": "2.161.1",
|
|
57
57
|
"aws-iot-device-sdk": "^2.2.13",
|
|
58
58
|
"aws-sdk": "^2.1501.0",
|
|
59
59
|
"builtin-modules": "3.2.0",
|
|
60
|
-
"cdk-assets": "2.
|
|
60
|
+
"cdk-assets": "2.155.6",
|
|
61
61
|
"chalk": "^5.2.0",
|
|
62
62
|
"chokidar": "^3.5.3",
|
|
63
63
|
"ci-info": "^3.7.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"ora": "^6.1.2",
|
|
86
86
|
"react": "^18.0.0",
|
|
87
87
|
"remeda": "^1.3.0",
|
|
88
|
-
"sst-aws-cdk": "2.
|
|
88
|
+
"sst-aws-cdk": "2.161.1-2",
|
|
89
89
|
"tree-kill": "^1.2.2",
|
|
90
90
|
"undici": "^5.12.0",
|
|
91
91
|
"uuid": "^9.0.0",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"@types/ws": "^8.5.3",
|
|
119
119
|
"@types/yargs": "^17.0.13",
|
|
120
120
|
"archiver": "^5.3.1",
|
|
121
|
-
"astro-sst": "2.
|
|
121
|
+
"astro-sst": "2.44.1",
|
|
122
122
|
"async": "^3.2.4",
|
|
123
123
|
"tsx": "^3.12.1",
|
|
124
124
|
"typescript": "^5.2.2",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
"bugs": {
|
|
136
|
-
"url": "https://github.com/sst/
|
|
136
|
+
"url": "https://github.com/sst/v2/issues"
|
|
137
137
|
},
|
|
138
138
|
"main": "index.js",
|
|
139
139
|
"directories": {
|