Joe Kendal
11/05/2021, 4:37 PMthdxr
11/05/2021, 5:56 PMJoe Kendal
11/05/2021, 5:56 PMJoe Kendal
11/05/2021, 5:57 PMJoe Kendal
11/05/2021, 5:57 PMthdxr
11/05/2021, 5:58 PMthdxr
11/05/2021, 5:58 PMconst router = new sst.Function(this, "router", {
handler: `src/functions/router.handler`,
currentVersionOptions: {
provisionedConcurrentExecutions:
this.stage === "production" ? 1 : undefined,
},
})
// <https://github.com/aws/aws-cdk/issues/13731#issuecomment-814801449>
router.currentVersion
thdxr
11/05/2021, 5:58 PMJoe Kendal
11/05/2021, 6:00 PMthdxr
11/05/2021, 6:02 PMthdxr
11/05/2021, 6:02 PMJoe Kendal
11/05/2021, 6:02 PMthdxr
11/05/2021, 6:03 PMJoe Kendal
11/05/2021, 6:21 PMconst api = new AppSyncApi(this, "Api", {
...
defaultFunctionProps: {
timeout: Duration.seconds(15),
currentVersionOptions: {
provisionedConcurrentExecutions: 2
}
},
Actual behaviour: The lambda resolvers don’t have a provisioned concurrency config and the appsync data sources don’t point to a versionJoe Kendal
11/05/2021, 6:24 PMJoe Kendal
11/05/2021, 6:25 PMthdxr
11/05/2021, 6:36 PMthdxr
11/05/2021, 6:36 PMthdxr
11/05/2021, 6:36 PM// <https://github.com/aws/aws-cdk/issues/13731#issuecomment-814801449>
router.currentVersion
Joe Kendal
11/05/2021, 6:36 PMJoe Kendal
11/05/2021, 6:37 PMthdxr
11/05/2021, 6:37 PMthdxr
11/05/2021, 6:37 PMJoe Kendal
11/05/2021, 6:37 PMJoe Kendal
11/05/2021, 6:38 PMJoe Kendal
11/05/2021, 6:38 PMJoe Kendal
11/05/2021, 6:38 PMthdxr
11/05/2021, 6:39 PMJoe Kendal
11/05/2021, 6:40 PMthdxr
11/05/2021, 6:41 PMthdxr
11/05/2021, 6:42 PM.build/sst-debug.log
I can make sure it's not on sst's sideJoe Kendal
11/05/2021, 6:47 PMJoe Kendal
11/05/2021, 6:49 PMJoe Kendal
11/05/2021, 6:49 PMJoe Kendal
11/05/2021, 6:50 PMthdxr
11/05/2021, 6:50 PMJoe Kendal
11/05/2021, 6:51 PMJoe Kendal
11/05/2021, 6:52 PMthdxr
11/05/2021, 6:52 PMthdxr
11/05/2021, 6:52 PMJoe Kendal
11/05/2021, 11:08 PMJoe Kendal
11/05/2021, 11:10 PMJP (junaway)
11/06/2021, 9:58 AMthdxr
11/06/2021, 1:29 PMJoe Kendal
11/06/2021, 1:49 PMthdxr
11/06/2021, 1:50 PMthdxr
11/06/2021, 1:51 PMJoe Kendal
11/06/2021, 1:51 PMJoe Kendal
11/06/2021, 1:52 PMJoe Kendal
11/06/2021, 1:52 PMJoe Kendal
11/06/2021, 1:53 PMJoe Kendal
11/06/2021, 1:54 PMJoe Kendal
11/06/2021, 1:54 PMthdxr
11/06/2021, 1:55 PMthdxr
11/06/2021, 1:55 PMthdxr
11/06/2021, 1:55 PMthdxr
11/06/2021, 1:57 PMJoe Kendal
11/06/2021, 2:00 PMJoe Kendal
11/06/2021, 2:01 PMLukasz K
11/12/2021, 3:42 PMconst getUserSettings = new Function(this, "getSettings", {
handler: "src/userAPI/userController.getUserSettingsAPI",
currentVersionOptions: {
provisionedConcurrentExecutions: this.isNamedEnv ? 1 : 0,
},
environment: {
..
},
});
// REQUIRED TO CREATE PROVISIONED FUNCTIONS
const userSettingsVersion = getUserSettings.currentVersion;
props.api.addRoutes(this, {
'GET /user/settings': getUserSettings
});
I'm seeing the reserved instances being created and idle.
I'm seeing (oddly) lower latency in the requests, but according to all sources available I'm not calling the reserved instances (couldn't find any invocation different than "AWS_LAMBDA_INITIALIZATION_TYPE": "on-demand"
)
Should the version construct be referenced somewhere when adding the actual route?Joe Kendal
11/12/2021, 4:21 PMJoe Kendal
11/12/2021, 4:22 PMLukasz K
11/12/2021, 4:27 PMsst build
when trying to do it is:
Error: Invalid function definition for the "Lambda_GET_/company" Function
since API construct is looking for
FunctionDefinition | ApiFunctionRouteProps | ApiHttpRouteProps | ApiAlbRouteProps
Joe Kendal
11/12/2021, 4:28 PMLukasz K
11/12/2021, 4:32 PMLukasz K
11/12/2021, 4:34 PM.currentVersion
for one to be created)Lukasz K
11/12/2021, 5:33 PMcurrentVersion.lambda
it's gonna get right back to the root function def and use $latest as version in integration details)Lukasz K
11/12/2021, 5:36 PMJoe Kendal
11/12/2021, 7:43 PMFrank
Frank
Artem Pabacham
01/13/2022, 9:05 AMLukasz K
01/13/2022, 9:12 AMlambda-warmer
+ created a small supporting method in my extension class of Stack so it only takes one line in the definition and 2 lines (including import) in actual function for warmer to process stuff properly.
If you wish I can send you a snippet via PMArtem Pabacham
01/13/2022, 9:36 AM