sst 2.40.6 → 2.40.7
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/types.js
CHANGED
|
@@ -21,7 +21,7 @@ export const types = (program) => program.command("types", "Generate resource ty
|
|
|
21
21
|
name: project.config.name,
|
|
22
22
|
region: project.config.region,
|
|
23
23
|
});
|
|
24
|
-
sstConfig.stacks(app);
|
|
24
|
+
await sstConfig.stacks(app);
|
|
25
25
|
Colors.line(Colors.success(`✔ `), `Types generated in ${path.resolve(project.paths.out, "types")}`);
|
|
26
26
|
await exit();
|
|
27
27
|
}
|
package/constructs/Function.js
CHANGED
|
@@ -149,11 +149,15 @@ export class Function extends CDKFunction {
|
|
|
149
149
|
timeout: toCdkDuration("900 second"),
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
+
// Ensure descriptions fits the 256 chars limit
|
|
153
|
+
const description = props.description
|
|
154
|
+
? `${props.description.substring(0, 240)} (live)`
|
|
155
|
+
: `live`;
|
|
152
156
|
super(scope, id, {
|
|
153
157
|
...props,
|
|
154
158
|
...(props.runtime === "container"
|
|
155
159
|
? {
|
|
156
|
-
description
|
|
160
|
+
description,
|
|
157
161
|
code: Code.fromAssetImage(path.resolve(__dirname, "../support/bridge"), {
|
|
158
162
|
...(architecture?.dockerPlatform
|
|
159
163
|
? { platform: Platform.custom(architecture.dockerPlatform) }
|
|
@@ -164,7 +168,7 @@ export class Function extends CDKFunction {
|
|
|
164
168
|
layers: undefined,
|
|
165
169
|
}
|
|
166
170
|
: {
|
|
167
|
-
description
|
|
171
|
+
description,
|
|
168
172
|
runtime: CDKRuntime.NODEJS_18_X,
|
|
169
173
|
code: Code.fromAsset(path.resolve(__dirname, "../support/bridge")),
|
|
170
174
|
handler: "live-lambda.handler",
|
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.7",
|
|
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.7",
|
|
122
122
|
"async": "^3.2.4",
|
|
123
123
|
"tsx": "^3.12.1",
|
|
124
124
|
"typescript": "^5.2.2",
|
|
@@ -147118,7 +147118,7 @@ function safeHandler(block) {
|
|
|
147118
147118
|
}
|
|
147119
147119
|
}
|
|
147120
147120
|
const reason = [
|
|
147121
|
-
e.message,
|
|
147121
|
+
e.message.slice(0, 3e3),
|
|
147122
147122
|
`Logs: https://${process.env.AWS_REGION}.console.aws.amazon.com/cloudwatch/home?region=${process.env.AWS_REGION}#logsV2:log-groups/log-group/${encodeURIComponent(
|
|
147123
147123
|
process.env.AWS_LAMBDA_LOG_GROUP_NAME
|
|
147124
147124
|
)}/log-events/${encodeURIComponent(
|
|
@@ -153756,7 +153756,7 @@ function storeVariable(variablesAcc, variable, value) {
|
|
|
153756
153756
|
}
|
|
153757
153757
|
|
|
153758
153758
|
// support/custom-resources/secret-prefetcher.ts
|
|
153759
|
-
var lambda3 =
|
|
153759
|
+
var lambda3 = useAWSClient(import_client_lambda3.LambdaClient);
|
|
153760
153760
|
async function SecretPrefetcher(cfnRequest) {
|
|
153761
153761
|
switch (cfnRequest.RequestType) {
|
|
153762
153762
|
case "Create":
|
|
@@ -153764,10 +153764,12 @@ async function SecretPrefetcher(cfnRequest) {
|
|
|
153764
153764
|
const props = cfnRequest.ResourceProperties;
|
|
153765
153765
|
const processEnvBackup = { ...process.env };
|
|
153766
153766
|
try {
|
|
153767
|
-
const ret = await
|
|
153768
|
-
|
|
153769
|
-
|
|
153770
|
-
|
|
153767
|
+
const ret = await retryOnAccessDenied(
|
|
153768
|
+
() => lambda3.send(
|
|
153769
|
+
new import_client_lambda3.GetFunctionCommand({
|
|
153770
|
+
FunctionName: props.functionName
|
|
153771
|
+
})
|
|
153772
|
+
)
|
|
153771
153773
|
);
|
|
153772
153774
|
const envs = ret.Configuration?.Environment?.Variables ?? {};
|
|
153773
153775
|
Object.entries(envs).filter(
|
|
@@ -153779,13 +153781,15 @@ async function SecretPrefetcher(cfnRequest) {
|
|
|
153779
153781
|
Object.entries(allVariables2["Secret"] ?? {}).map(([key, value]) => {
|
|
153780
153782
|
envs[`SST_Secret_value_${key}`] = value.value.toString();
|
|
153781
153783
|
});
|
|
153782
|
-
await
|
|
153783
|
-
|
|
153784
|
-
|
|
153785
|
-
|
|
153786
|
-
|
|
153787
|
-
|
|
153788
|
-
|
|
153784
|
+
await retryOnAccessDenied(
|
|
153785
|
+
() => lambda3.send(
|
|
153786
|
+
new import_client_lambda3.UpdateFunctionConfigurationCommand({
|
|
153787
|
+
FunctionName: props.functionName,
|
|
153788
|
+
Environment: {
|
|
153789
|
+
Variables: envs
|
|
153790
|
+
}
|
|
153791
|
+
})
|
|
153792
|
+
)
|
|
153789
153793
|
);
|
|
153790
153794
|
} finally {
|
|
153791
153795
|
process.env = processEnvBackup;
|
|
@@ -153797,6 +153801,17 @@ async function SecretPrefetcher(cfnRequest) {
|
|
|
153797
153801
|
throw new Error("Unsupported request type");
|
|
153798
153802
|
}
|
|
153799
153803
|
}
|
|
153804
|
+
async function retryOnAccessDenied(cb, attempt = 0) {
|
|
153805
|
+
try {
|
|
153806
|
+
return await cb();
|
|
153807
|
+
} catch (e) {
|
|
153808
|
+
if ((e.name === "AccessDenied" || e.name === "AccessDeniedException") && e.message.includes("is not authorized to perform") && attempt < 10) {
|
|
153809
|
+
await new Promise((resolve) => setTimeout(resolve, 5e3));
|
|
153810
|
+
return retryOnAccessDenied(cb, attempt + 1);
|
|
153811
|
+
}
|
|
153812
|
+
throw e;
|
|
153813
|
+
}
|
|
153814
|
+
}
|
|
153800
153815
|
|
|
153801
153816
|
// support/custom-resources/index.ts
|
|
153802
153817
|
var handler = (event) => {
|