sst 2.0.9 → 2.0.11
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 -0
- package/bootstrap.js +2 -3
- package/cli/commands/bootstrap.d.ts +2 -0
- package/cli/commands/bootstrap.js +14 -4
- package/constructs/Job.js +4 -1
- package/package.json +1 -1
- package/sst.mjs +20 -9
package/bootstrap.d.ts
CHANGED
package/bootstrap.js
CHANGED
|
@@ -38,7 +38,7 @@ export const useBootstrap = Context.memo(async () => {
|
|
|
38
38
|
await bootstrapCDK();
|
|
39
39
|
}
|
|
40
40
|
if (needToBootstrapSST) {
|
|
41
|
-
await bootstrapSST();
|
|
41
|
+
await bootstrapSST({});
|
|
42
42
|
// fetch bootstrap status
|
|
43
43
|
sstStatus = await loadSSTStatus();
|
|
44
44
|
if (!sstStatus)
|
|
@@ -82,7 +82,7 @@ async function loadCDKStatus() {
|
|
|
82
82
|
}
|
|
83
83
|
return false;
|
|
84
84
|
}
|
|
85
|
-
async function bootstrapSST() {
|
|
85
|
+
export async function bootstrapSST(tags) {
|
|
86
86
|
// Create bootstrap stack
|
|
87
87
|
const project = useProject();
|
|
88
88
|
const app = new App();
|
|
@@ -92,7 +92,6 @@ async function bootstrapSST() {
|
|
|
92
92
|
},
|
|
93
93
|
});
|
|
94
94
|
// Add tags to stack
|
|
95
|
-
const tags = {};
|
|
96
95
|
for (const [key, value] of Object.entries(tags)) {
|
|
97
96
|
Tags.of(app).add(key, value);
|
|
98
97
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
export const bootstrap = (program) => program.command("bootstrap", "Create the SST bootstrap stack", (yargs) => yargs,
|
|
1
|
+
export const bootstrap = (program) => program.command("bootstrap", "Create the SST bootstrap stack", (yargs) => yargs.option("tags", {
|
|
2
|
+
type: "array",
|
|
3
|
+
string: true,
|
|
4
|
+
describe: "Tags to add for the bootstrap stack",
|
|
5
|
+
}), async (args) => {
|
|
6
|
+
const { createSpinner } = await import("../spinner.js");
|
|
2
7
|
const { Colors } = await import("../colors.js");
|
|
3
8
|
const { useProject } = await import("../../project.js");
|
|
4
|
-
const {
|
|
9
|
+
const { bootstrapSST } = await import("../../bootstrap.js");
|
|
5
10
|
const { useSTSIdentity } = await import("../../credentials.js");
|
|
6
11
|
const project = useProject();
|
|
7
12
|
const identity = await useSTSIdentity();
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
const tags = Object.fromEntries(args.tags?.map((t) => t.split("=")) || []);
|
|
14
|
+
if (args.tags?.length) {
|
|
15
|
+
Colors.line(`${Colors.primary(`➜`)} Using tags`, tags);
|
|
16
|
+
}
|
|
17
|
+
const spinner = createSpinner(" Deploying bootstrap stack").start();
|
|
18
|
+
await bootstrapSST(tags);
|
|
19
|
+
spinner.succeed(Colors.bold(` Bootstrapped account ${identity.Account} in region ${project.config.region}`));
|
|
10
20
|
process.exit(0);
|
|
11
21
|
});
|
package/constructs/Job.js
CHANGED
|
@@ -257,7 +257,7 @@ export class Job extends Construct {
|
|
|
257
257
|
return fn;
|
|
258
258
|
}
|
|
259
259
|
createCodeBuildInvoker() {
|
|
260
|
-
|
|
260
|
+
const fn = new Function(this, this.node.id, {
|
|
261
261
|
handler: path.join(__dirname, "../support/job-invoker/index.main"),
|
|
262
262
|
runtime: "nodejs16.x",
|
|
263
263
|
timeout: 10,
|
|
@@ -275,7 +275,10 @@ export class Job extends Construct {
|
|
|
275
275
|
nodejs: {
|
|
276
276
|
format: "esm",
|
|
277
277
|
},
|
|
278
|
+
enableLiveDev: false,
|
|
278
279
|
});
|
|
280
|
+
fn._disableBind = true;
|
|
281
|
+
return fn;
|
|
279
282
|
}
|
|
280
283
|
useForCodeBuild(constructs) {
|
|
281
284
|
const app = this.node.root;
|
package/package.json
CHANGED
package/sst.mjs
CHANGED
|
@@ -2553,6 +2553,7 @@ var init_iot2 = __esm({
|
|
|
2553
2553
|
// src/bootstrap.ts
|
|
2554
2554
|
var bootstrap_exports = {};
|
|
2555
2555
|
__export(bootstrap_exports, {
|
|
2556
|
+
bootstrapSST: () => bootstrapSST,
|
|
2556
2557
|
useBootstrap: () => useBootstrap
|
|
2557
2558
|
});
|
|
2558
2559
|
import url3 from "url";
|
|
@@ -2603,7 +2604,7 @@ async function loadCDKStatus() {
|
|
|
2603
2604
|
}
|
|
2604
2605
|
return false;
|
|
2605
2606
|
}
|
|
2606
|
-
async function bootstrapSST() {
|
|
2607
|
+
async function bootstrapSST(tags) {
|
|
2607
2608
|
const project = useProject();
|
|
2608
2609
|
const app = new App();
|
|
2609
2610
|
const stack = new Stack(app, STACK_NAME, {
|
|
@@ -2611,7 +2612,6 @@ async function bootstrapSST() {
|
|
|
2611
2612
|
region: project.config.region
|
|
2612
2613
|
}
|
|
2613
2614
|
});
|
|
2614
|
-
const tags = {};
|
|
2615
2615
|
for (const [key, value] of Object.entries(tags)) {
|
|
2616
2616
|
Tags.of(app).add(key, value);
|
|
2617
2617
|
}
|
|
@@ -2792,7 +2792,7 @@ var init_bootstrap = __esm({
|
|
|
2792
2792
|
await bootstrapCDK();
|
|
2793
2793
|
}
|
|
2794
2794
|
if (needToBootstrapSST) {
|
|
2795
|
-
await bootstrapSST();
|
|
2795
|
+
await bootstrapSST({});
|
|
2796
2796
|
sstStatus = await loadSSTStatus();
|
|
2797
2797
|
if (!sstStatus)
|
|
2798
2798
|
throw new VisibleError("Failed to load bootstrap stack status");
|
|
@@ -7297,17 +7297,28 @@ var telemetry = (program2) => program2.command(
|
|
|
7297
7297
|
var bootstrap = (program2) => program2.command(
|
|
7298
7298
|
"bootstrap",
|
|
7299
7299
|
"Create the SST bootstrap stack",
|
|
7300
|
-
(yargs2) => yargs2,
|
|
7301
|
-
|
|
7300
|
+
(yargs2) => yargs2.option("tags", {
|
|
7301
|
+
type: "array",
|
|
7302
|
+
string: true,
|
|
7303
|
+
describe: "Tags to add for the bootstrap stack"
|
|
7304
|
+
}),
|
|
7305
|
+
async (args) => {
|
|
7306
|
+
const { createSpinner: createSpinner2 } = await Promise.resolve().then(() => (init_spinner(), spinner_exports));
|
|
7302
7307
|
const { Colors: Colors2 } = await Promise.resolve().then(() => (init_colors(), colors_exports));
|
|
7303
7308
|
const { useProject: useProject2 } = await Promise.resolve().then(() => (init_project(), project_exports));
|
|
7304
|
-
const {
|
|
7309
|
+
const { bootstrapSST: bootstrapSST2 } = await Promise.resolve().then(() => (init_bootstrap(), bootstrap_exports));
|
|
7305
7310
|
const { useSTSIdentity: useSTSIdentity2 } = await Promise.resolve().then(() => (init_credentials(), credentials_exports));
|
|
7306
7311
|
const project = useProject2();
|
|
7307
7312
|
const identity = await useSTSIdentity2();
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7313
|
+
const tags = Object.fromEntries(
|
|
7314
|
+
args.tags?.map((t) => t.split("=")) || []
|
|
7315
|
+
);
|
|
7316
|
+
if (args.tags?.length) {
|
|
7317
|
+
Colors2.line(`${Colors2.primary(`\u279C`)} Using tags`, tags);
|
|
7318
|
+
}
|
|
7319
|
+
const spinner = createSpinner2(" Deploying bootstrap stack").start();
|
|
7320
|
+
await bootstrapSST2(tags);
|
|
7321
|
+
spinner.succeed(
|
|
7311
7322
|
Colors2.bold(
|
|
7312
7323
|
` Bootstrapped account ${identity.Account} in region ${project.config.region}`
|
|
7313
7324
|
)
|