sst 2.5.4 → 2.5.5
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/bind.js +89 -64
- package/cli/commands/version.js +1 -0
- package/constructs/Api.d.ts +1 -1
- package/constructs/Api.js +1 -1
- package/constructs/ApiGatewayV1Api.d.ts +1 -1
- package/constructs/ApiGatewayV1Api.js +1 -1
- package/constructs/AppSyncApi.d.ts +1 -1
- package/constructs/AppSyncApi.js +1 -1
- package/constructs/Auth.d.ts +1 -1
- package/constructs/Auth.js +1 -1
- package/constructs/Bucket.d.ts +1 -1
- package/constructs/Bucket.js +1 -1
- package/constructs/Cognito.d.ts +1 -1
- package/constructs/Cognito.js +1 -1
- package/constructs/Cron.d.ts +1 -1
- package/constructs/Cron.js +1 -1
- package/constructs/EventBus.d.ts +1 -1
- package/constructs/EventBus.js +1 -1
- package/constructs/Function.d.ts +1 -1
- package/constructs/Function.js +1 -1
- package/constructs/Job.d.ts +38 -2
- package/constructs/Job.js +4 -2
- package/constructs/KinesisStream.d.ts +1 -1
- package/constructs/KinesisStream.js +1 -1
- package/constructs/Parameter.d.ts +1 -1
- package/constructs/Parameter.js +1 -1
- package/constructs/Queue.d.ts +1 -1
- package/constructs/Queue.js +1 -1
- package/constructs/RDS.d.ts +2 -2
- package/constructs/RDS.js +1 -1
- package/constructs/Script.d.ts +2 -2
- package/constructs/Script.js +1 -1
- package/constructs/Secret.d.ts +1 -1
- package/constructs/Secret.js +1 -1
- package/constructs/Stack.d.ts +1 -1
- package/constructs/Stack.js +1 -1
- package/constructs/StaticSite.d.ts +1 -1
- package/constructs/StaticSite.js +1 -1
- package/constructs/Table.d.ts +1 -1
- package/constructs/Table.js +1 -1
- package/constructs/Topic.d.ts +1 -1
- package/constructs/Topic.js +1 -1
- package/constructs/WebSocketApi.d.ts +1 -1
- package/constructs/WebSocketApi.js +1 -1
- package/constructs/future/Auth.d.ts +1 -1
- package/constructs/future/Auth.js +1 -1
- package/package.json +1 -1
- package/project.d.ts +1 -0
- package/project.js +7 -2
- package/sst.mjs +93 -63
- package/support/bootstrap-metadata-function/index.mjs +238 -238
- package/support/custom-resources/index.mjs +238 -238
package/cli/commands/bind.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import { VisibleError } from "../../error.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
AstroSite: "astro.config",
|
|
6
|
-
RemixSite: "remix.config",
|
|
7
|
-
SolidStartSite: "vite.config",
|
|
8
|
-
SlsNextjsSite: "next.config",
|
|
9
|
-
};
|
|
3
|
+
class OutdatedMetadataError extends Error {
|
|
4
|
+
}
|
|
10
5
|
export const bind = (program) => program
|
|
11
6
|
.command(["bind <command..>", "env <command..>"], "Bind your app's resources to a command", (yargs) => yargs
|
|
12
7
|
.array("command")
|
|
@@ -25,54 +20,80 @@ export const bind = (program) => program
|
|
|
25
20
|
const bus = useBus();
|
|
26
21
|
const project = useProject();
|
|
27
22
|
const command = args.command?.join(" ");
|
|
28
|
-
const
|
|
23
|
+
const isSite = await isRunningInSite();
|
|
29
24
|
let p;
|
|
30
25
|
let timer;
|
|
31
26
|
let siteConfigCache;
|
|
32
27
|
// Handle missing command
|
|
33
28
|
if (!command) {
|
|
34
|
-
throw new VisibleError(`Command is required, e.g. sst bind ${
|
|
29
|
+
throw new VisibleError(`Command is required, e.g. sst bind ${isSite ? "next dev" : "vitest run"}`);
|
|
35
30
|
}
|
|
36
31
|
// Bind script
|
|
37
|
-
|
|
38
|
-
if (!initialMetadata && !isSsrSite) {
|
|
32
|
+
if (!isSite) {
|
|
39
33
|
Logger.debug("Running in script mode.");
|
|
40
34
|
return await bindScript();
|
|
41
35
|
}
|
|
42
36
|
// Bind site
|
|
43
|
-
|
|
37
|
+
try {
|
|
38
|
+
await bindSite("init");
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
// Bind script (fallback)
|
|
42
|
+
if (e instanceof OutdatedMetadataError) {
|
|
43
|
+
Colors.line(Colors.warning("Warning: This was deployed with an old version of SST. Run `sst dev` or `sst deploy` to update."));
|
|
44
|
+
return await bindScript();
|
|
45
|
+
}
|
|
46
|
+
throw e;
|
|
47
|
+
}
|
|
44
48
|
bus.subscribe("stacks.metadata.updated", () => bindSite("metadata_updated"));
|
|
45
49
|
bus.subscribe("stacks.metadata.deleted", () => bindSite("metadata_updated"));
|
|
46
50
|
bus.subscribe("config.secret.updated", (payload) => {
|
|
47
51
|
const secretName = payload.properties.name;
|
|
48
|
-
if (siteConfigCache?.secrets
|
|
49
|
-
return;
|
|
50
|
-
if (!siteConfigCache.secrets.includes(secretName))
|
|
52
|
+
if (!(siteConfigCache?.secrets || []).includes(secretName))
|
|
51
53
|
return;
|
|
52
54
|
Colors.line(`\n`, `SST secrets have been updated. Restarting \`${command}\`...`);
|
|
53
55
|
bindSite("secrets_updated");
|
|
54
56
|
});
|
|
55
|
-
async function
|
|
57
|
+
async function isRunningInSite() {
|
|
56
58
|
const { existsAsync } = await import("../../util/fs.js");
|
|
57
59
|
const { readFile } = await import("fs/promises");
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
const SITE_CONFIGS = [
|
|
61
|
+
{ file: "next.config", multiExtension: true },
|
|
62
|
+
{ file: "astro.config", multiExtension: true },
|
|
63
|
+
{ file: "remix.config", multiExtension: true },
|
|
64
|
+
{ file: "svelte.config", multiExtension: true },
|
|
65
|
+
{ file: "gatsby-config", multiExtension: true },
|
|
66
|
+
{ file: "angular.json" },
|
|
67
|
+
{ file: "ember-cli-build.js" },
|
|
68
|
+
{
|
|
69
|
+
file: "vite.config",
|
|
70
|
+
multiExtension: true,
|
|
71
|
+
match: /solid-start|plugin-vue|plugin-react|@preact\/preset-vite/,
|
|
72
|
+
},
|
|
73
|
+
{ file: "package.json", match: /react-scripts/ },
|
|
74
|
+
{ file: "index.html" }, // plain HTML
|
|
75
|
+
];
|
|
76
|
+
const results = await Promise.all(SITE_CONFIGS.map((site) => {
|
|
77
|
+
const files = site.multiExtension
|
|
78
|
+
? [".js", ".cjs", ".mjs", ".ts"].map((ext) => `${site.file}${ext}`)
|
|
79
|
+
: [site.file];
|
|
80
|
+
return files.map(async (file) => {
|
|
81
|
+
const exists = await existsAsync(file);
|
|
82
|
+
if (!exists)
|
|
83
|
+
return false;
|
|
84
|
+
if (site.match) {
|
|
85
|
+
const content = await readFile(file);
|
|
86
|
+
return content.toString().match(site.match);
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
});
|
|
90
|
+
}).flat());
|
|
68
91
|
return results.some(Boolean);
|
|
69
92
|
}
|
|
70
93
|
async function bindSite(reason) {
|
|
71
94
|
// Get metadata
|
|
72
|
-
const siteMetadata = (
|
|
73
|
-
|
|
74
|
-
: await getSiteMetadataUntilAvailable());
|
|
75
|
-
const siteConfig = await parseSiteConfig(siteMetadata);
|
|
95
|
+
const siteMetadata = await getSiteMetadataUntilAvailable();
|
|
96
|
+
const siteConfig = await parseSiteMetadata(siteMetadata);
|
|
76
97
|
// Handle rebind due to metadata updated
|
|
77
98
|
if (reason === "metadata_updated") {
|
|
78
99
|
if (areEnvsSame(siteConfig.envs, siteConfigCache?.envs || {}))
|
|
@@ -113,25 +134,6 @@ export const bind = (program) => program
|
|
|
113
134
|
...(await localIamCredentials()),
|
|
114
135
|
});
|
|
115
136
|
}
|
|
116
|
-
async function parseSiteConfig(metadata) {
|
|
117
|
-
const { LambdaClient, GetFunctionCommand } = await import("@aws-sdk/client-lambda");
|
|
118
|
-
const { useAWSClient } = await import("../../credentials.js");
|
|
119
|
-
const isBindSupported = metadata.type !== "StaticSite" && metadata.type !== "SlsNextjsSite";
|
|
120
|
-
// Handle StaticSite
|
|
121
|
-
if (!isBindSupported) {
|
|
122
|
-
return { envs: metadata.data.environment };
|
|
123
|
-
}
|
|
124
|
-
// Get function details
|
|
125
|
-
const lambda = useAWSClient(LambdaClient);
|
|
126
|
-
const { Configuration: functionConfig } = await lambda.send(new GetFunctionCommand({
|
|
127
|
-
FunctionName: metadata.data.server,
|
|
128
|
-
}));
|
|
129
|
-
return {
|
|
130
|
-
role: functionConfig?.Role,
|
|
131
|
-
envs: functionConfig?.Environment?.Variables || {},
|
|
132
|
-
secrets: metadata.data.secrets,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
137
|
async function getSiteMetadataUntilAvailable() {
|
|
136
138
|
const { createSpinner } = await import("../spinner.js");
|
|
137
139
|
const spinner = createSpinner({});
|
|
@@ -139,18 +141,7 @@ export const bind = (program) => program
|
|
|
139
141
|
const data = await getSiteMetadata();
|
|
140
142
|
// Handle site metadata not found
|
|
141
143
|
if (!data) {
|
|
142
|
-
spinner.start(
|
|
143
|
-
//"Waiting for SST to start for the first time. Run `sst dev`..."
|
|
144
|
-
//"Run `sst dev` for the first time. Waiting..."
|
|
145
|
-
"Make sure `sst dev` is running...");
|
|
146
|
-
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
// Handle site metadata is old
|
|
150
|
-
const isBindSupported = data.type !== "StaticSite" && data.type !== "SlsNextjsSite";
|
|
151
|
-
if ((isBindSupported && !data.data.server) ||
|
|
152
|
-
(!isBindSupported && !data.data.environment)) {
|
|
153
|
-
spinner.start("This was deployed with an old version of SST. Make sure to restart `sst dev`...");
|
|
144
|
+
spinner.start("Make sure `sst dev` is running...");
|
|
154
145
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
155
146
|
continue;
|
|
156
147
|
}
|
|
@@ -163,9 +154,43 @@ export const bind = (program) => program
|
|
|
163
154
|
const metadataData = await metadata();
|
|
164
155
|
return Object.values(metadataData)
|
|
165
156
|
.flat()
|
|
166
|
-
.filter((c) =>
|
|
167
|
-
|
|
168
|
-
|
|
157
|
+
.filter((c) => [
|
|
158
|
+
"StaticSite",
|
|
159
|
+
"NextjsSite",
|
|
160
|
+
"AstroSite",
|
|
161
|
+
"RemixSite",
|
|
162
|
+
"SolidStartSite",
|
|
163
|
+
"SlsNextjsSite",
|
|
164
|
+
].includes(c.type))
|
|
165
|
+
.find((c) => {
|
|
166
|
+
// Handle metadata prior to SST v2.3.0 doesn't have path
|
|
167
|
+
const isSsr = c.type !== "StaticSite" && c.type !== "SlsNextjsSite";
|
|
168
|
+
if (!c.data.path ||
|
|
169
|
+
(isSsr && !c.data.server) ||
|
|
170
|
+
(!isSsr && !c.data.environment)) {
|
|
171
|
+
throw new OutdatedMetadataError();
|
|
172
|
+
}
|
|
173
|
+
return (path.resolve(project.paths.root, c.data.path) === process.cwd());
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
async function parseSiteMetadata(metadata) {
|
|
177
|
+
const { LambdaClient, GetFunctionCommand } = await import("@aws-sdk/client-lambda");
|
|
178
|
+
const { useAWSClient } = await import("../../credentials.js");
|
|
179
|
+
const isBindSupported = metadata.type !== "StaticSite" && metadata.type !== "SlsNextjsSite";
|
|
180
|
+
// Handle StaticSite
|
|
181
|
+
if (!isBindSupported) {
|
|
182
|
+
return { envs: metadata.data.environment };
|
|
183
|
+
}
|
|
184
|
+
// Get function details
|
|
185
|
+
const lambda = useAWSClient(LambdaClient);
|
|
186
|
+
const { Configuration: functionConfig } = await lambda.send(new GetFunctionCommand({
|
|
187
|
+
FunctionName: metadata.data.server,
|
|
188
|
+
}));
|
|
189
|
+
return {
|
|
190
|
+
role: functionConfig?.Role,
|
|
191
|
+
envs: functionConfig?.Environment?.Variables || {},
|
|
192
|
+
secrets: metadata.data.secrets,
|
|
193
|
+
};
|
|
169
194
|
}
|
|
170
195
|
async function assumeSsrRole(roleArn) {
|
|
171
196
|
const { STSClient, AssumeRoleCommand } = await import("@aws-sdk/client-sts");
|
package/cli/commands/version.js
CHANGED
|
@@ -4,4 +4,5 @@ export const version = (program) => program.command("version", "Print SST and CD
|
|
|
4
4
|
const project = useProject();
|
|
5
5
|
Colors.line(Colors.bold(`SST:`), `v${project.version}`);
|
|
6
6
|
Colors.line(Colors.bold(`CDK:`), `v${project.cdkVersion}`);
|
|
7
|
+
Colors.line(Colors.bold(`Constructs:`), `v${project.constructsVersion}`);
|
|
7
8
|
});
|
package/constructs/Api.d.ts
CHANGED
|
@@ -594,7 +594,7 @@ export interface ApiGraphQLRouteProps<AuthorizerKeys> extends ApiBaseRouteProps<
|
|
|
594
594
|
* @example
|
|
595
595
|
*
|
|
596
596
|
* ```ts
|
|
597
|
-
* import { Api } from "
|
|
597
|
+
* import { Api } from "sst/constructs";
|
|
598
598
|
*
|
|
599
599
|
* new Api(stack, "Api", {
|
|
600
600
|
* routes: {
|
package/constructs/Api.js
CHANGED
|
@@ -461,7 +461,7 @@ export interface ApiGatewayV1ApiCustomDomainProps {
|
|
|
461
461
|
* @example
|
|
462
462
|
*
|
|
463
463
|
* ```js
|
|
464
|
-
* import { ApiGatewayV1Api } from "
|
|
464
|
+
* import { ApiGatewayV1Api } from "sst/constructs";
|
|
465
465
|
*
|
|
466
466
|
* new ApiGatewayV1Api(stack, "Api", {
|
|
467
467
|
* routes: {
|
|
@@ -372,7 +372,7 @@ export interface AppSyncApiCdkGraphqlProps extends Omit<GraphqlApiProps, "name"
|
|
|
372
372
|
* @example
|
|
373
373
|
*
|
|
374
374
|
* ```js
|
|
375
|
-
* import { AppSyncApi } from "
|
|
375
|
+
* import { AppSyncApi } from "sst/constructs";
|
|
376
376
|
*
|
|
377
377
|
* new AppSyncApi(stack, "GraphqlApi", {
|
|
378
378
|
* schema: "graphql/schema.graphql",
|
package/constructs/AppSyncApi.js
CHANGED
|
@@ -26,7 +26,7 @@ import { GraphqlApi, MappingTemplate as CDKMappingTemplate, SchemaFile, } from "
|
|
|
26
26
|
* @example
|
|
27
27
|
*
|
|
28
28
|
* ```js
|
|
29
|
-
* import { AppSyncApi } from "
|
|
29
|
+
* import { AppSyncApi } from "sst/constructs";
|
|
30
30
|
*
|
|
31
31
|
* new AppSyncApi(stack, "GraphqlApi", {
|
|
32
32
|
* schema: "graphql/schema.graphql",
|
package/constructs/Auth.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export interface ApiAttachmentProps {
|
|
|
54
54
|
* SST Auth is a lightweight authentication solution for your applications. With a simple set of configuration you can deploy a function attached to your API that can handle various authentication flows. *
|
|
55
55
|
* @example
|
|
56
56
|
* ```
|
|
57
|
-
* import { Auth } from "
|
|
57
|
+
* import { Auth } from "sst/constructs"
|
|
58
58
|
*
|
|
59
59
|
* new Auth(stack, "auth", {
|
|
60
60
|
* authenticator: "functions/authenticator.handler"
|
package/constructs/Auth.js
CHANGED
|
@@ -11,7 +11,7 @@ const PREFIX_PROP = "prefix";
|
|
|
11
11
|
* SST Auth is a lightweight authentication solution for your applications. With a simple set of configuration you can deploy a function attached to your API that can handle various authentication flows. *
|
|
12
12
|
* @example
|
|
13
13
|
* ```
|
|
14
|
-
* import { Auth } from "
|
|
14
|
+
* import { Auth } from "sst/constructs"
|
|
15
15
|
*
|
|
16
16
|
* new Auth(stack, "auth", {
|
|
17
17
|
* authenticator: "functions/authenticator.handler"
|
package/constructs/Bucket.d.ts
CHANGED
package/constructs/Bucket.js
CHANGED
|
@@ -15,7 +15,7 @@ import { LambdaDestination, SnsDestination, SqsDestination, } from "aws-cdk-lib/
|
|
|
15
15
|
* @example
|
|
16
16
|
*
|
|
17
17
|
* ```js
|
|
18
|
-
* import { Bucket } from "
|
|
18
|
+
* import { Bucket } from "sst/constructs";
|
|
19
19
|
*
|
|
20
20
|
* new Bucket(stack, "Bucket");
|
|
21
21
|
* ```
|
package/constructs/Cognito.d.ts
CHANGED
package/constructs/Cognito.js
CHANGED
package/constructs/Cron.d.ts
CHANGED
package/constructs/Cron.js
CHANGED
package/constructs/EventBus.d.ts
CHANGED
package/constructs/EventBus.js
CHANGED
package/constructs/Function.d.ts
CHANGED
|
@@ -527,7 +527,7 @@ export interface FunctionCopyFilesProps {
|
|
|
527
527
|
* @example
|
|
528
528
|
*
|
|
529
529
|
* ```js
|
|
530
|
-
* import { Function } from "
|
|
530
|
+
* import { Function } from "sst/constructs";
|
|
531
531
|
*
|
|
532
532
|
* new Function(stack, "MySnsLambda", {
|
|
533
533
|
* handler: "src/sns/index.main",
|
package/constructs/Function.js
CHANGED
package/constructs/Job.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Function, NodeJSProps } from "./Function.js";
|
|
|
5
5
|
import { Duration } from "./util/duration.js";
|
|
6
6
|
import { Permissions } from "./util/permission.js";
|
|
7
7
|
import { FunctionBindingProps } from "./util/functionBinding.js";
|
|
8
|
-
import { IVpc } from "aws-cdk-lib/aws-ec2";
|
|
8
|
+
import { ISecurityGroup, IVpc, SubnetSelection } from "aws-cdk-lib/aws-ec2";
|
|
9
9
|
export type JobMemorySize = "3 GB" | "7 GB" | "15 GB" | "145 GB";
|
|
10
10
|
export interface JobNodeJSProps extends NodeJSProps {
|
|
11
11
|
}
|
|
@@ -139,6 +139,42 @@ export interface JobProps {
|
|
|
139
139
|
* ```
|
|
140
140
|
*/
|
|
141
141
|
vpc?: IVpc;
|
|
142
|
+
/**
|
|
143
|
+
* Where to place the network interfaces within the VPC.
|
|
144
|
+
* @default All private subnets.
|
|
145
|
+
* @example
|
|
146
|
+
* ```js
|
|
147
|
+
* import { SubnetType } from "aws-cdk-lib/aws-ec2";
|
|
148
|
+
*
|
|
149
|
+
* new Job(stack, "MyJob", {
|
|
150
|
+
* handler: "src/job.handler",
|
|
151
|
+
* cdk: {
|
|
152
|
+
* vpc,
|
|
153
|
+
* vpcSubnets: { subnetType: SubnetType.PRIVATE_WITH_EGRESS }
|
|
154
|
+
* }
|
|
155
|
+
* })
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
vpcSubnets?: SubnetSelection;
|
|
159
|
+
/**
|
|
160
|
+
* The list of security groups to associate with the Job's network interfaces.
|
|
161
|
+
* @default A new security group is created.
|
|
162
|
+
* @example
|
|
163
|
+
* ```js
|
|
164
|
+
* import { SecurityGroup } from "aws-cdk-lib/aws-ec2";
|
|
165
|
+
*
|
|
166
|
+
* new Job(stack, "MyJob", {
|
|
167
|
+
* handler: "src/job.handler",
|
|
168
|
+
* cdk: {
|
|
169
|
+
* vpc,
|
|
170
|
+
* securityGroups: [
|
|
171
|
+
* new SecurityGroup(stack, "MyJobSG", { vpc })
|
|
172
|
+
* ]
|
|
173
|
+
* }
|
|
174
|
+
* })
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
securityGroups?: ISecurityGroup[];
|
|
142
178
|
};
|
|
143
179
|
}
|
|
144
180
|
/**
|
|
@@ -147,7 +183,7 @@ export interface JobProps {
|
|
|
147
183
|
* @example
|
|
148
184
|
*
|
|
149
185
|
* ```js
|
|
150
|
-
* import { Cron } from "
|
|
186
|
+
* import { Cron } from "sst/constructs";
|
|
151
187
|
*
|
|
152
188
|
* new Cron(stack, "Cron", {
|
|
153
189
|
* schedule: "rate(1 minute)",
|
package/constructs/Job.js
CHANGED
|
@@ -24,7 +24,7 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
|
24
24
|
* @example
|
|
25
25
|
*
|
|
26
26
|
* ```js
|
|
27
|
-
* import { Cron } from "
|
|
27
|
+
* import { Cron } from "sst/constructs";
|
|
28
28
|
*
|
|
29
29
|
* new Cron(stack, "Cron", {
|
|
30
30
|
* schedule: "rate(1 minute)",
|
|
@@ -135,7 +135,6 @@ export class Job extends Construct {
|
|
|
135
135
|
const { cdk, memorySize, timeout } = this.props;
|
|
136
136
|
const app = this.node.root;
|
|
137
137
|
return new Project(this, "JobProject", {
|
|
138
|
-
vpc: cdk?.vpc,
|
|
139
138
|
projectName: app.logicalPrefixedName(this.node.id),
|
|
140
139
|
environment: {
|
|
141
140
|
// CodeBuild offers different build images. The newer ones have much quicker
|
|
@@ -163,6 +162,9 @@ export class Job extends Construct {
|
|
|
163
162
|
},
|
|
164
163
|
},
|
|
165
164
|
}),
|
|
165
|
+
vpc: cdk?.vpc,
|
|
166
|
+
securityGroups: cdk?.securityGroups,
|
|
167
|
+
subnetSelection: cdk?.vpcSubnets,
|
|
166
168
|
});
|
|
167
169
|
}
|
|
168
170
|
createLogRetention() {
|
|
@@ -114,7 +114,7 @@ export interface KinesisStreamProps {
|
|
|
114
114
|
* @example
|
|
115
115
|
*
|
|
116
116
|
* ```js
|
|
117
|
-
* import { KinesisStream } from "
|
|
117
|
+
* import { KinesisStream } from "sst/constructs";
|
|
118
118
|
*
|
|
119
119
|
* new KinesisStream(stack, "Stream", {
|
|
120
120
|
* consumers: {
|
|
@@ -13,7 +13,7 @@ import { Function as Fn, } from "./Function.js";
|
|
|
13
13
|
* @example
|
|
14
14
|
*
|
|
15
15
|
* ```js
|
|
16
|
-
* import { KinesisStream } from "
|
|
16
|
+
* import { KinesisStream } from "sst/constructs";
|
|
17
17
|
*
|
|
18
18
|
* new KinesisStream(stack, "Stream", {
|
|
19
19
|
* consumers: {
|
|
@@ -14,7 +14,7 @@ export interface ParameterProps {
|
|
|
14
14
|
* ### Using the minimal config
|
|
15
15
|
*
|
|
16
16
|
* ```js
|
|
17
|
-
* import { Config } from "
|
|
17
|
+
* import { Config } from "sst/constructs";
|
|
18
18
|
*
|
|
19
19
|
* new Config.Parameter(stack, "TABLE_NAME", table.tableName);
|
|
20
20
|
* ```
|
package/constructs/Parameter.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Construct } from "constructs";
|
|
|
6
6
|
* ### Using the minimal config
|
|
7
7
|
*
|
|
8
8
|
* ```js
|
|
9
|
-
* import { Config } from "
|
|
9
|
+
* import { Config } from "sst/constructs";
|
|
10
10
|
*
|
|
11
11
|
* new Config.Parameter(stack, "TABLE_NAME", table.tableName);
|
|
12
12
|
* ```
|
package/constructs/Queue.d.ts
CHANGED
package/constructs/Queue.js
CHANGED
|
@@ -13,7 +13,7 @@ import { toCdkDuration } from "./util/duration.js";
|
|
|
13
13
|
* @example
|
|
14
14
|
*
|
|
15
15
|
* ```js
|
|
16
|
-
* import { Queue } from "
|
|
16
|
+
* import { Queue } from "sst/constructs";
|
|
17
17
|
*
|
|
18
18
|
* new Queue(stack, "Queue", {
|
|
19
19
|
* consumer: "src/queueConsumer.main",
|
package/constructs/RDS.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface RDSProps {
|
|
|
53
53
|
maxCapacity?: keyof typeof rds.AuroraCapacityUnit;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
|
-
* Path to the directory that contains the migration scripts. The `RDS` construct uses [Kysely](https://
|
|
56
|
+
* Path to the directory that contains the migration scripts. The `RDS` construct uses [Kysely](https://kysely-org.github.io/kysely/) to run and manage schema migrations. The `migrations` prop should point to the folder where your migration files are.
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
59
|
*
|
|
@@ -145,7 +145,7 @@ export interface RDSCdkServerlessClusterProps extends Omit<rds.ServerlessCluster
|
|
|
145
145
|
* @example
|
|
146
146
|
*
|
|
147
147
|
* ```js
|
|
148
|
-
* import { RDS } from "
|
|
148
|
+
* import { RDS } from "sst/constructs";
|
|
149
149
|
*
|
|
150
150
|
* new RDS(stack, "Database", {
|
|
151
151
|
* engine: "postgresql11.13",
|
package/constructs/RDS.js
CHANGED
|
@@ -20,7 +20,7 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
|
20
20
|
* @example
|
|
21
21
|
*
|
|
22
22
|
* ```js
|
|
23
|
-
* import { RDS } from "
|
|
23
|
+
* import { RDS } from "sst/constructs";
|
|
24
24
|
*
|
|
25
25
|
* new RDS(stack, "Database", {
|
|
26
26
|
* engine: "postgresql11.13",
|
package/constructs/Script.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface ScriptProps {
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```js
|
|
11
|
-
* import { Script } from "
|
|
11
|
+
* import { Script } from "sst/constructs";
|
|
12
12
|
*
|
|
13
13
|
* new Script(stack, "Script", {
|
|
14
14
|
* onCreate: "src/script.create",
|
|
@@ -76,7 +76,7 @@ export interface ScriptProps {
|
|
|
76
76
|
* @example
|
|
77
77
|
*
|
|
78
78
|
* ```js
|
|
79
|
-
* import { Script } from "
|
|
79
|
+
* import { Script } from "sst/constructs";
|
|
80
80
|
*
|
|
81
81
|
* new Script(stack, "Script", {
|
|
82
82
|
* onCreate: "src/function.create",
|
package/constructs/Script.js
CHANGED
|
@@ -14,7 +14,7 @@ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
|
14
14
|
* @example
|
|
15
15
|
*
|
|
16
16
|
* ```js
|
|
17
|
-
* import { Script } from "
|
|
17
|
+
* import { Script } from "sst/constructs";
|
|
18
18
|
*
|
|
19
19
|
* new Script(stack, "Script", {
|
|
20
20
|
* onCreate: "src/function.create",
|
package/constructs/Secret.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { FunctionBindingProps } from "./util/functionBinding.js";
|
|
|
8
8
|
* ### Using the minimal config
|
|
9
9
|
*
|
|
10
10
|
* ```js
|
|
11
|
-
* import { Config } from "
|
|
11
|
+
* import { Config } from "sst/constructs";
|
|
12
12
|
*
|
|
13
13
|
* new Config.Secret(stack, "STRIPE_KEY");
|
|
14
14
|
* ```
|
package/constructs/Secret.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getParameterPath, getParameterFallbackPath, } from "./util/functionBind
|
|
|
8
8
|
* ### Using the minimal config
|
|
9
9
|
*
|
|
10
10
|
* ```js
|
|
11
|
-
* import { Config } from "
|
|
11
|
+
* import { Config } from "sst/constructs";
|
|
12
12
|
*
|
|
13
13
|
* new Config.Secret(stack, "STRIPE_KEY");
|
|
14
14
|
* ```
|
package/constructs/Stack.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type StackProps = cdk.StackProps;
|
|
|
11
11
|
* @example
|
|
12
12
|
*
|
|
13
13
|
* ```js
|
|
14
|
-
* import { StackContext } from "
|
|
14
|
+
* import { StackContext } from "sst/constructs";
|
|
15
15
|
*
|
|
16
16
|
* export function MyStack({ stack }: StackContext) {
|
|
17
17
|
* // Define your stack
|
package/constructs/Stack.js
CHANGED
|
@@ -13,7 +13,7 @@ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
|
13
13
|
* @example
|
|
14
14
|
*
|
|
15
15
|
* ```js
|
|
16
|
-
* import { StackContext } from "
|
|
16
|
+
* import { StackContext } from "sst/constructs";
|
|
17
17
|
*
|
|
18
18
|
* export function MyStack({ stack }: StackContext) {
|
|
19
19
|
* // Define your stack
|