sst 2.40.3 → 2.40.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 +1 -1
- package/cli/commands/secrets/list.js +1 -1
- package/constructs/Api.d.ts +4 -4
- package/constructs/Api.js +1 -1
- package/constructs/ApiGatewayV1Api.d.ts +4 -4
- package/constructs/ApiGatewayV1Api.js +1 -1
- package/constructs/App.d.ts +2 -1
- package/constructs/App.js +7 -11
- package/constructs/AppSyncApi.d.ts +4 -4
- package/constructs/AppSyncApi.js +1 -1
- package/constructs/Auth.d.ts +2 -2
- package/constructs/Auth.js +3 -3
- package/constructs/Bucket.d.ts +5 -5
- package/constructs/Bucket.js +1 -1
- package/constructs/Cognito.d.ts +4 -3
- package/constructs/Cognito.js +1 -1
- package/constructs/Construct.d.ts +2 -2
- package/constructs/Cron.d.ts +3 -2
- package/constructs/Cron.js +1 -1
- package/constructs/EdgeFunction.d.ts +2 -2
- package/constructs/EdgeFunction.js +6 -9
- package/constructs/EventBus.d.ts +4 -4
- package/constructs/EventBus.js +1 -1
- package/constructs/Function.d.ts +42 -6
- package/constructs/Function.js +19 -14
- package/constructs/Job.d.ts +43 -4
- package/constructs/Job.js +11 -14
- package/constructs/KinesisStream.d.ts +4 -4
- package/constructs/KinesisStream.js +1 -1
- package/constructs/NextjsSite.d.ts +2 -0
- package/constructs/NextjsSite.js +29 -9
- package/constructs/Parameter.d.ts +2 -2
- package/constructs/Parameter.js +1 -1
- package/constructs/Queue.d.ts +3 -3
- package/constructs/Queue.js +1 -1
- package/constructs/RDS.d.ts +2 -2
- package/constructs/RDS.js +1 -1
- package/constructs/RemixSite.d.ts +3 -2
- package/constructs/RemixSite.js +38 -12
- package/constructs/Script.d.ts +3 -2
- package/constructs/Script.js +2 -2
- package/constructs/Secret.d.ts +2 -2
- package/constructs/Secret.js +2 -2
- package/constructs/Service.d.ts +43 -4
- package/constructs/Service.js +31 -15
- package/constructs/SsrFunction.d.ts +3 -2
- package/constructs/SsrFunction.js +7 -13
- package/constructs/SsrSite.d.ts +3 -3
- package/constructs/SsrSite.js +2 -2
- package/constructs/Stack.d.ts +2 -2
- package/constructs/StaticSite.d.ts +2 -2
- package/constructs/StaticSite.js +2 -2
- package/constructs/Table.d.ts +4 -4
- package/constructs/Table.js +1 -1
- package/constructs/Topic.d.ts +4 -4
- package/constructs/Topic.js +1 -1
- package/constructs/WebSocketApi.d.ts +4 -4
- package/constructs/WebSocketApi.js +1 -1
- package/constructs/deprecated/NextjsSite.d.ts +2 -2
- package/constructs/deprecated/NextjsSite.js +2 -2
- package/constructs/future/Auth.d.ts +2 -2
- package/constructs/future/Auth.js +2 -2
- package/constructs/util/{functionBinding.d.ts → binding.d.ts} +14 -6
- package/constructs/util/{functionBinding.js → binding.js} +28 -14
- package/package.json +2 -2
- package/runtime/handlers/container.js +42 -0
- package/runtime/handlers/rust.js +3 -2
- package/support/remix-site-function/edge-server.js +0 -8
- package/support/remix-site-function/regional-server.js +0 -8
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as ssm from "aws-cdk-lib/aws-ssm";
|
|
2
|
+
import { isSSTConstruct } from "../Construct.js";
|
|
2
3
|
import { Config } from "../../config.js";
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
import { Effect, PolicyStatement } from "aws-cdk-lib/aws-iam";
|
|
5
|
+
export function getBindingEnvironments(r) {
|
|
6
|
+
const c = isSSTConstruct(r) ? r : r.resource;
|
|
7
|
+
const binding = c.getBindings();
|
|
5
8
|
let environment = {};
|
|
6
9
|
if (binding) {
|
|
7
10
|
Object.entries(binding.variables).forEach(([prop, variable]) => {
|
|
@@ -22,12 +25,12 @@ export function bindEnvironment(c) {
|
|
|
22
25
|
}
|
|
23
26
|
return environment;
|
|
24
27
|
}
|
|
25
|
-
export function
|
|
26
|
-
const
|
|
28
|
+
export function getBindingParameters(r) {
|
|
29
|
+
const c = isSSTConstruct(r) ? r : r.resource;
|
|
30
|
+
const binding = c.getBindings();
|
|
27
31
|
if (!binding) {
|
|
28
32
|
return;
|
|
29
33
|
}
|
|
30
|
-
const app = c.node.root;
|
|
31
34
|
Object.entries(binding.variables).forEach(([prop, variable]) => {
|
|
32
35
|
const resId = `Parameter_${prop}`;
|
|
33
36
|
if (!c.node.tryFindChild(resId)) {
|
|
@@ -46,15 +49,25 @@ export function bindParameters(c) {
|
|
|
46
49
|
}
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
|
-
export function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
export function getBindingPermissions(r) {
|
|
53
|
+
if (isSSTConstruct(r)) {
|
|
54
|
+
return Object.entries(r.getBindings()?.permissions ?? {}).map(([action, resources]) => new PolicyStatement({
|
|
55
|
+
actions: [action],
|
|
56
|
+
effect: Effect.ALLOW,
|
|
57
|
+
resources,
|
|
58
|
+
}));
|
|
53
59
|
}
|
|
54
|
-
return
|
|
60
|
+
return r.permissions.map((p) => {
|
|
61
|
+
return new PolicyStatement({
|
|
62
|
+
actions: p.actions,
|
|
63
|
+
effect: Effect.ALLOW,
|
|
64
|
+
resources: p.resources,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
55
67
|
}
|
|
56
|
-
export function
|
|
57
|
-
const
|
|
68
|
+
export function getBindingType(r) {
|
|
69
|
+
const c = isSSTConstruct(r) ? r : r.resource;
|
|
70
|
+
const binding = c.getBindings();
|
|
58
71
|
if (!binding) {
|
|
59
72
|
return;
|
|
60
73
|
}
|
|
@@ -63,8 +76,9 @@ export function bindType(c) {
|
|
|
63
76
|
variables: Object.keys(binding.variables),
|
|
64
77
|
};
|
|
65
78
|
}
|
|
66
|
-
export function
|
|
67
|
-
const
|
|
79
|
+
export function getBindingReferencedSecrets(r) {
|
|
80
|
+
const c = isSSTConstruct(r) ? r : r.resource;
|
|
81
|
+
const binding = c.getBindings();
|
|
68
82
|
const secrets = [];
|
|
69
83
|
if (binding) {
|
|
70
84
|
Object.values(binding.variables).forEach((variable) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "sst",
|
|
4
|
-
"version": "2.40.
|
|
4
|
+
"version": "2.40.5",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sst": "cli/sst.js"
|
|
7
7
|
},
|
|
@@ -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.40.
|
|
121
|
+
"astro-sst": "2.40.5",
|
|
122
122
|
"async": "^3.2.4",
|
|
123
123
|
"tsx": "^3.12.1",
|
|
124
124
|
"typescript": "^5.2.2",
|
|
@@ -214,6 +214,27 @@ export const useContainerHandler = () => {
|
|
|
214
214
|
? [`-f ${input.props.container.file}`]
|
|
215
215
|
: []),
|
|
216
216
|
...Object.entries(input.props.container?.buildArgs || {}).map(([k, v]) => `--build-arg ${k}=${v}`),
|
|
217
|
+
...(input.props.container?.buildSsh
|
|
218
|
+
? [`--ssh ${input.props.container.buildSsh}`]
|
|
219
|
+
: []),
|
|
220
|
+
...(input.props.container?.cacheFrom || []).map((v) => "--cache-from=" +
|
|
221
|
+
[
|
|
222
|
+
`type=${v.type}`,
|
|
223
|
+
...(v.params
|
|
224
|
+
? Object.entries(v.params).map(([pk, pv]) => `${pk}=${pv}`)
|
|
225
|
+
: []),
|
|
226
|
+
].join(",")),
|
|
227
|
+
...(input.props.container?.cacheTo
|
|
228
|
+
? [
|
|
229
|
+
"--cache-to=" +
|
|
230
|
+
[
|
|
231
|
+
`type=${input.props.container?.cacheTo.type}`,
|
|
232
|
+
...(input.props.container?.cacheTo?.params
|
|
233
|
+
? Object.entries(input.props.container?.cacheTo?.params).map(([pk, pv]) => `${pk}=${pv}`)
|
|
234
|
+
: []).join(","),
|
|
235
|
+
],
|
|
236
|
+
]
|
|
237
|
+
: []),
|
|
217
238
|
`.`,
|
|
218
239
|
].join(" "), {
|
|
219
240
|
cwd: project,
|
|
@@ -241,6 +262,27 @@ export const useContainerHandler = () => {
|
|
|
241
262
|
? [`-f ${input.props.container.file}`]
|
|
242
263
|
: []),
|
|
243
264
|
...Object.entries(input.props.container?.buildArgs || {}).map(([k, v]) => `--build-arg ${k}=${v}`),
|
|
265
|
+
...(input.props.container?.buildSsh
|
|
266
|
+
? [`--ssh ${input.props.container.buildSsh}`]
|
|
267
|
+
: []),
|
|
268
|
+
...(input.props.container?.cacheFrom || []).map((v) => "--cache-from=" +
|
|
269
|
+
[
|
|
270
|
+
`type=${v.type}`,
|
|
271
|
+
...(v.params
|
|
272
|
+
? Object.entries(v.params).map(([pk, pv]) => `${pk}=${pv}`)
|
|
273
|
+
: []),
|
|
274
|
+
].join(",")),
|
|
275
|
+
...(input.props.container?.cacheTo
|
|
276
|
+
? [
|
|
277
|
+
"--cache-to=" +
|
|
278
|
+
[
|
|
279
|
+
`type=${input.props.container?.cacheTo.type}`,
|
|
280
|
+
...(input.props.container?.cacheTo?.params
|
|
281
|
+
? Object.entries(input.props.container?.cacheTo?.params).map(([pk, pv]) => `${pk}=${pv}`)
|
|
282
|
+
: []).join(","),
|
|
283
|
+
],
|
|
284
|
+
]
|
|
285
|
+
: []),
|
|
244
286
|
`--platform ${platform}`,
|
|
245
287
|
`.`,
|
|
246
288
|
].join(" "), {
|
package/runtime/handlers/rust.js
CHANGED
|
@@ -9,7 +9,8 @@ const execAsync = promisify(exec);
|
|
|
9
9
|
export const useRustHandler = () => {
|
|
10
10
|
const processes = new Map();
|
|
11
11
|
const sources = new Map();
|
|
12
|
-
const
|
|
12
|
+
const isWindows = process.platform === "win32";
|
|
13
|
+
const handlerName = isWindows ? `handler.exe` : `handler`;
|
|
13
14
|
return {
|
|
14
15
|
shouldBuild: (input) => {
|
|
15
16
|
if (!input.file.endsWith(".rs"))
|
|
@@ -68,7 +69,7 @@ export const useRustHandler = () => {
|
|
|
68
69
|
...process.env,
|
|
69
70
|
},
|
|
70
71
|
});
|
|
71
|
-
await fs.cp(path.join(project, `target/debug`, parsed.name), path.join(input.out, "handler"));
|
|
72
|
+
await fs.cp(path.join(project, `target/debug`, `${parsed.name}${isWindows ? ".exe" : ""}`), path.join(input.out, "handler"));
|
|
72
73
|
}
|
|
73
74
|
catch (ex) {
|
|
74
75
|
return {
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
// This is a custom Lambda@Edge handler which imports the Remix server
|
|
2
2
|
// build and performs the Remix server rendering.
|
|
3
3
|
|
|
4
|
-
// We have to ensure that our polyfills are imported prior to any other modules
|
|
5
|
-
// which may depend on them;
|
|
6
|
-
import { installGlobals } from "@remix-run/node";
|
|
7
|
-
installGlobals();
|
|
8
|
-
|
|
9
4
|
import {
|
|
10
5
|
createRequestHandler as createNodeRequestHandler,
|
|
11
6
|
readableStreamToString,
|
|
12
7
|
} from "@remix-run/node";
|
|
13
8
|
import { URL } from "url";
|
|
14
9
|
|
|
15
|
-
// Import the server build that was produced by `remix build`;
|
|
16
|
-
import * as remixServerBuild from "./index.js";
|
|
17
|
-
|
|
18
10
|
/**
|
|
19
11
|
* Common binary MIME types
|
|
20
12
|
*/
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
// This is a custom Lambda URL handler which imports the Remix server
|
|
2
2
|
// build and performs the Remix server rendering.
|
|
3
3
|
|
|
4
|
-
// We have to ensure that our polyfills are imported prior to any other modules
|
|
5
|
-
// which may depend on them;
|
|
6
|
-
import { installGlobals } from "@remix-run/node";
|
|
7
|
-
installGlobals();
|
|
8
|
-
|
|
9
4
|
import {
|
|
10
5
|
createRequestHandler as createNodeRequestHandler,
|
|
11
6
|
readableStreamToString,
|
|
12
7
|
} from "@remix-run/node";
|
|
13
8
|
|
|
14
|
-
// Import the server build that was produced by `remix build`;
|
|
15
|
-
import * as remixServerBuild from "./index.js";
|
|
16
|
-
|
|
17
9
|
/**
|
|
18
10
|
* Common binary MIME types
|
|
19
11
|
*/
|