sst 2.1.23 → 2.1.25
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/bootstrap.d.ts +1 -1
- package/bootstrap.js +5 -2
- package/cli/commands/bootstrap.d.ts +2 -0
- package/cli/commands/bootstrap.js +5 -1
- package/package.json +1 -1
- package/runtime/iot.js +3 -3
- package/sst.mjs +32 -9
- package/support/bridge/bridge.mjs +18 -18
package/bootstrap.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export declare const useBootstrap: () => Promise<{
|
|
|
2
2
|
version: string;
|
|
3
3
|
bucket: string;
|
|
4
4
|
}>;
|
|
5
|
-
export declare function bootstrapSST(tags?: Record<string, string>, publicAccessBlockConfiguration?: boolean): Promise<void>;
|
|
5
|
+
export declare function bootstrapSST(tags?: Record<string, string>, publicAccessBlockConfiguration?: boolean, qualifier?: string): Promise<void>;
|
package/bootstrap.js
CHANGED
|
@@ -3,7 +3,7 @@ import path from "path";
|
|
|
3
3
|
import { bold, dim } from "colorette";
|
|
4
4
|
import { spawn } from "child_process";
|
|
5
5
|
import { DescribeStacksCommand, CloudFormationClient, } from "@aws-sdk/client-cloudformation";
|
|
6
|
-
import { Duration, Tags, Stack, RemovalPolicy,
|
|
6
|
+
import { App, DefaultStackSynthesizer, CfnOutput, Duration, Tags, Stack, RemovalPolicy, } from "aws-cdk-lib";
|
|
7
7
|
import { Function, Runtime, Code } from "aws-cdk-lib/aws-lambda";
|
|
8
8
|
import { SqsEventSource } from "aws-cdk-lib/aws-lambda-event-sources";
|
|
9
9
|
import { PolicyStatement } from "aws-cdk-lib/aws-iam";
|
|
@@ -81,7 +81,7 @@ async function loadCDKStatus() {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
export async function bootstrapSST(tags, publicAccessBlockConfiguration) {
|
|
84
|
+
export async function bootstrapSST(tags, publicAccessBlockConfiguration, qualifier) {
|
|
85
85
|
// Normalize input
|
|
86
86
|
tags = tags || {};
|
|
87
87
|
publicAccessBlockConfiguration =
|
|
@@ -93,6 +93,9 @@ export async function bootstrapSST(tags, publicAccessBlockConfiguration) {
|
|
|
93
93
|
env: {
|
|
94
94
|
region: project.config.region,
|
|
95
95
|
},
|
|
96
|
+
synthesizer: new DefaultStackSynthesizer({
|
|
97
|
+
qualifier,
|
|
98
|
+
}),
|
|
96
99
|
});
|
|
97
100
|
// Add tags to stack
|
|
98
101
|
for (const [key, value] of Object.entries(tags)) {
|
|
@@ -3,6 +3,10 @@ export const bootstrap = (program) => program.command("bootstrap", "Create the S
|
|
|
3
3
|
type: "array",
|
|
4
4
|
string: true,
|
|
5
5
|
describe: "Tags to add for the bootstrap stack",
|
|
6
|
+
})
|
|
7
|
+
.option("qualifier", {
|
|
8
|
+
type: "string",
|
|
9
|
+
describe: "A string that is added to the names of all resources in the bootstrap stack",
|
|
6
10
|
})
|
|
7
11
|
.option("public-access-block-configuration", {
|
|
8
12
|
type: "boolean",
|
|
@@ -21,7 +25,7 @@ export const bootstrap = (program) => program.command("bootstrap", "Create the S
|
|
|
21
25
|
Colors.line(`${Colors.primary(`➜`)} Using tags`, tags);
|
|
22
26
|
}
|
|
23
27
|
const spinner = createSpinner(" Deploying bootstrap stack").start();
|
|
24
|
-
await bootstrapSST(tags, args.publicAccessBlockConfiguration);
|
|
28
|
+
await bootstrapSST(tags, args.publicAccessBlockConfiguration, args.qualifier);
|
|
25
29
|
spinner.succeed(Colors.bold(` Bootstrapped account ${identity.Account} in region ${project.config.region}`));
|
|
26
30
|
process.exit(0);
|
|
27
31
|
});
|
package/package.json
CHANGED
package/runtime/iot.js
CHANGED
|
@@ -6,12 +6,12 @@ export const useIOTBridge = Context.memo(async () => {
|
|
|
6
6
|
const iot = await useIOT();
|
|
7
7
|
const topic = `${iot.prefix}/events`;
|
|
8
8
|
bus.subscribe("function.success", async (evt) => {
|
|
9
|
-
iot.publish(topic, "function.success", evt.properties);
|
|
9
|
+
iot.publish(topic + "/" + evt.properties.workerID, "function.success", evt.properties);
|
|
10
10
|
});
|
|
11
11
|
bus.subscribe("function.error", async (evt) => {
|
|
12
|
-
iot.publish(topic, "function.error", evt.properties);
|
|
12
|
+
iot.publish(topic + "/" + evt.properties.workerID, "function.error", evt.properties);
|
|
13
13
|
});
|
|
14
14
|
bus.subscribe("function.ack", async (evt) => {
|
|
15
|
-
iot.publish(topic, "function.ack", evt.properties);
|
|
15
|
+
iot.publish(topic + "/" + evt.properties.workerID, "function.ack", evt.properties);
|
|
16
16
|
});
|
|
17
17
|
});
|
package/sst.mjs
CHANGED
|
@@ -2742,13 +2742,25 @@ var init_iot2 = __esm({
|
|
|
2742
2742
|
const iot2 = await useIOT();
|
|
2743
2743
|
const topic = `${iot2.prefix}/events`;
|
|
2744
2744
|
bus.subscribe("function.success", async (evt) => {
|
|
2745
|
-
iot2.publish(
|
|
2745
|
+
iot2.publish(
|
|
2746
|
+
topic + "/" + evt.properties.workerID,
|
|
2747
|
+
"function.success",
|
|
2748
|
+
evt.properties
|
|
2749
|
+
);
|
|
2746
2750
|
});
|
|
2747
2751
|
bus.subscribe("function.error", async (evt) => {
|
|
2748
|
-
iot2.publish(
|
|
2752
|
+
iot2.publish(
|
|
2753
|
+
topic + "/" + evt.properties.workerID,
|
|
2754
|
+
"function.error",
|
|
2755
|
+
evt.properties
|
|
2756
|
+
);
|
|
2749
2757
|
});
|
|
2750
2758
|
bus.subscribe("function.ack", async (evt) => {
|
|
2751
|
-
iot2.publish(
|
|
2759
|
+
iot2.publish(
|
|
2760
|
+
topic + "/" + evt.properties.workerID,
|
|
2761
|
+
"function.ack",
|
|
2762
|
+
evt.properties
|
|
2763
|
+
);
|
|
2752
2764
|
});
|
|
2753
2765
|
});
|
|
2754
2766
|
}
|
|
@@ -2769,12 +2781,13 @@ import {
|
|
|
2769
2781
|
CloudFormationClient
|
|
2770
2782
|
} from "@aws-sdk/client-cloudformation";
|
|
2771
2783
|
import {
|
|
2784
|
+
App,
|
|
2785
|
+
DefaultStackSynthesizer,
|
|
2786
|
+
CfnOutput,
|
|
2772
2787
|
Duration,
|
|
2773
2788
|
Tags,
|
|
2774
2789
|
Stack,
|
|
2775
|
-
RemovalPolicy
|
|
2776
|
-
App,
|
|
2777
|
-
CfnOutput
|
|
2790
|
+
RemovalPolicy
|
|
2778
2791
|
} from "aws-cdk-lib";
|
|
2779
2792
|
import { Function, Runtime, Code } from "aws-cdk-lib/aws-lambda";
|
|
2780
2793
|
import { SqsEventSource } from "aws-cdk-lib/aws-lambda-event-sources";
|
|
@@ -2814,7 +2827,7 @@ async function loadCDKStatus() {
|
|
|
2814
2827
|
}
|
|
2815
2828
|
}
|
|
2816
2829
|
}
|
|
2817
|
-
async function bootstrapSST(tags, publicAccessBlockConfiguration) {
|
|
2830
|
+
async function bootstrapSST(tags, publicAccessBlockConfiguration, qualifier) {
|
|
2818
2831
|
tags = tags || {};
|
|
2819
2832
|
publicAccessBlockConfiguration = publicAccessBlockConfiguration === false ? false : true;
|
|
2820
2833
|
const project = useProject();
|
|
@@ -2822,7 +2835,10 @@ async function bootstrapSST(tags, publicAccessBlockConfiguration) {
|
|
|
2822
2835
|
const stack = new Stack(app, STACK_NAME, {
|
|
2823
2836
|
env: {
|
|
2824
2837
|
region: project.config.region
|
|
2825
|
-
}
|
|
2838
|
+
},
|
|
2839
|
+
synthesizer: new DefaultStackSynthesizer({
|
|
2840
|
+
qualifier
|
|
2841
|
+
})
|
|
2826
2842
|
});
|
|
2827
2843
|
for (const [key, value] of Object.entries(tags)) {
|
|
2828
2844
|
Tags.of(app).add(key, value);
|
|
@@ -7818,6 +7834,9 @@ var bootstrap = (program2) => program2.command(
|
|
|
7818
7834
|
type: "array",
|
|
7819
7835
|
string: true,
|
|
7820
7836
|
describe: "Tags to add for the bootstrap stack"
|
|
7837
|
+
}).option("qualifier", {
|
|
7838
|
+
type: "string",
|
|
7839
|
+
describe: "A string that is added to the names of all resources in the bootstrap stack"
|
|
7821
7840
|
}).option("public-access-block-configuration", {
|
|
7822
7841
|
type: "boolean",
|
|
7823
7842
|
default: true,
|
|
@@ -7838,7 +7857,11 @@ var bootstrap = (program2) => program2.command(
|
|
|
7838
7857
|
Colors2.line(`${Colors2.primary(`\u279C`)} Using tags`, tags);
|
|
7839
7858
|
}
|
|
7840
7859
|
const spinner = createSpinner2(" Deploying bootstrap stack").start();
|
|
7841
|
-
await bootstrapSST2(
|
|
7860
|
+
await bootstrapSST2(
|
|
7861
|
+
tags,
|
|
7862
|
+
args.publicAccessBlockConfiguration,
|
|
7863
|
+
args.qualifier
|
|
7864
|
+
);
|
|
7842
7865
|
spinner.succeed(
|
|
7843
7866
|
Colors2.bold(
|
|
7844
7867
|
` Bootstrapped account ${identity.Account} in region ${project.config.region}`
|