Skip to main content

Duration

caution

This is the SST v1.x Constructs doc. SST v2 is now released. If you are using v2, see the v2 Constructs doc. If you are looking to upgrade to v2, check out the upgrade steps.

SST makes it easy to specify length of time values as typed string values.

Type : number | ${number} second | ${number} seconds | ${number} minute | ${number} minutes | ${number} hour | ${number} hours | ${number} day | ${number} days

Examples

Function timeout

new Function(this, "MyFunction", {
handler: "src/lambda.main",
timeout: "20 seconds",
});

Api CORS max age

new Api(this, "MyApi", {
cors: {
allowMethods: ["GET"],
allowOrigins: ["https://domain.com"],
maxAge: "5 minutes",
}
});