Serverless Stack (SST) is designed around a few core principles.
The constructs that SST provides for building serverless apps is based on the idea of progressive disclosure. This means that the basic configuration for these constructs are simple, easy to understand, and readable. But they still allow you to progressively customize them for more complex use cases.
Let's look at the two areas where we apply this idea.
Api construct for example, in its simplest form only needs the routes and the function handlers as strings.
This format makes it easy to understand what is being defined. But if you wanted to customize the function properties, you could:
We could go even further and specifically customize one of the routes.
A similar idea can be seen in the pattern SST uses for attaching permissions to functions.
Let's look at a cronjob as an example.
For simplicity's sake we could give the cronjob function access to everything.
Or just give it access to a type of resource.
Or to a specific construct that we created.
Or grant a specific permission for a construct.
Or attach a list of granular IAM policy statements.
That said, you might run into cases where you are trying to do something that these constructs do not support. In these cases, you can fallback to using the native CDK constructs instead. This escape hatch ensures that you won't be locked in to using SST's constructs.
One of the big reasons we built SST was because the development environment for serverless always felt lacking. It lacked a tight feedback loop, something the Live Lambda Development tries to address. But you also needed to configure multiple plugins, Webpack, Babel, TypeScript, testing frameworks, linters etc. These setups were often brittle and relied on separate project maintainers to keep up to date. This might've been fine if you are an individual developer who has a ton of experience with serverless. But if you are a part of a larger team or are just getting started with serverless, it can be very challenging just to get your dev environment up and running.
Hence, one of the design principles of SST is to make sure that the development environment works out of the box. It comes batteries included. And needs little to no configuration.