Today we're happy to announce the release of the Serverless Framework v1.5.0.
Here are some of the release highlights!
Note: You can find a complete list of all the updates in the changelog.
v1.5 introduces the new
iot event source.
Lambda functions can now be triggered by AWS IoT events. Here's a simple code snippet that demonstrates how this looks:
functions: weatherReporter: handler: handler.handler events: - iot: sql: "SELECT * FROM 'weather_data'"
In this example the
weatherReporter function will be called every time an IoT event is sent to the
As usual you can learn more about this new event source in the docs. You should also check out the IoT example in our Serverless Examples repository to see the code for a fully functional Serverless service using the
IoT devices and
iot event support are a hot topic as it makes it possible to connect and interact with other hardware devices through Lambda functions. It's a great use case for a serverless architecture.
In fact, we have an upcoming guest blog post that will show you how an IoT device made it possible to see (from home) if the weather at the lake is nice enough to go hang out there. Stay tuned!
Serverless supports the use of custom authorizers for your API Gateway endpoints (see the docs for more information about it).
However up until now only custom authorizers were supported. What if you have a Cognito user pool you want to use to authorize your users?
Serverless has you covered! You can now specify the
arn to your user pool so that it'll be used by the authorizer function to authorize incoming requests.
Here's a code snippet that shows what the setup looks like:
functions: hello: handler: handler.hello events: - http: path: hello method: get integration: lambda authorizer: name: authorizer arn: arn:aws:cognito-idp:us-east-1:123456789:userpool/us-east-1_XXXXXX claims: - email
Want to see a more in-depth example? The following Serverless example service shows everything in detail:
serverless install is a widely used command to download existing Serverless services from GitHub.
Often times you want to use and deploy the service you download under a different name. Serverless v1.5.0 makes it possible to rename services directly after they've been downloaded.
Just provide the
--name flag and the service will be renamed after it was downloaded:
serverless install --url https://github.com/serverless/examples/tree/master/aws-node-iot-event --name iot
With every release we also implement a bunch of enhancements and bug fixes (thanks for reporting!).
The Serverless Examples Repository is an excellent resource if you want to explore some real world examples and learn more about what Serverless architectures look like.
Note that we're using strict Semver for our Serverless Framework versioning. This way you'll know when we introduce major features or breaking changes.
Philipp Müns is a core developer at Serverless, Inc.