Open sockthedev opened 1 month ago
the default timeout on the router is 20s, i tried to increase the timeout via the router.route config, like so:
router.route
const API_TIMEOUT_SECONDS = 120 const foo = new sst.aws.Function("Foo", { handler: "pkgs/functions/src/foo/handler.handler", timeout: `${API_TIMEOUT_SECONDS} seconds`, url: { cors: API_CORS_CONFIG, // ℹ️ this gets ignored when using router.route } }) // ℹ️ add this config, with the `readTimeout` set, which works router.route("/foo", foo.url, { readTimeout: `${API_TIMEOUT_SECONDS} seconds`, })
the issue is, when i do this, the cors config is completely ignored and i just get cors errors.
cors
trying to configure the lambda like this, with the router config embedded does not expose any override on the cloudfront timeout:
const API_TIMEOUT_SECONDS = 120 const foo = new sst.aws.Function("Foo", { handler: "pkgs/functions/src/foo/handler.handler", timeout: `${API_TIMEOUT_SECONDS} seconds`, url: { router: { instance: router, path: "/foo", // ℹ️ can't override readTimeout }, cors: API_CORS_CONFIG, } })
the default timeout on the router is 20s, i tried to increase the timeout via the
router.route
config, like so:the issue is, when i do this, the
cors
config is completely ignored and i just get cors errors.trying to configure the lambda like this, with the router config embedded does not expose any override on the cloudfront timeout: