In this article, we are going to dive into using a powerful new feature of Serverless Framework that allows us to easily create reusable patterns that we can use for future projects and share to our fellow teams or the community at large.
- Serverless CLI
- Background with the Serverless Framework
When it comes to starting new projects you always want to skip as many steps as possible. Specifically, if you’re working with the Serverless Framework you want to skip having to manually create a serverless.yml file and an initial lambda function.
Most people who use the Serverless Framework are fully aware that you can run a command like this.
$~: sls create --template aws-nodejs --path nodejs-project
However, did you know that the Serverless Framework has A LOT of other templates!? Let's get into it.
Well played sir:
How do you leverage a template to speed up new projects?
$~: sls create --template <template> --path <directory_name>
There is official template support for python 2.7 and python 3.x.
- Python 2.7 — aws-python
- Python 3.x — aws-python3
There is official template support for NodeJS 8.x, NodeJS + TypeScript and NodeJS + ECMA Script.
- NodeJS 8.x — aws-nodejs
- NodeJS + TypeScript — aws-nodejs-typescript
- NodeJS + ECMA Script — aws-nodejs-ecma-script
There is official template support for Java with Maven and Java with Gradle.
- Java with Maven — aws-java-maven
- Java with Gradle — aws-java-gradle
There is official template support for Kotlin with Maven, Kotlin with Gradle, and Kotlin with Gradle + NodeJS 🤯 🤯.
- Kotlin with Maven — aws-kotlin-jvm-maven
- Kotlin with Gradle — aws-kotlin-jvm-gradle
- Kotlin with Gradle + NodeJS — aws-kotlin-nodejs-gradle
There is official template support for Groovy, Scala, CSharp, and FSharp. Isn’t that rad! 🤙🤙
- Groovy with Gradle — aws-groovy-gradle
- Scala — aws-scala-sbt
- CSharp — aws-csharp
- FSharp — aws-fsharp
You can also easily spin up the foundation for Serverless Plugins, Alexa skills, and even your own custom templates!!
Custom templates allow you to create your own Serverless Templates which you can reference via the publicly hosted URL (e.g. GitHub).
We recently wrote an article showing how to deploy static web applications to AWS using a custom Serverless template which makes the entire process feel way to easy. Check it out!
- Industry Predictions for 2019
- Best Practices for Serverless Development
- Serverless CI/CD
- Serverless Web Applications — AWS v GCP
- Serverless Impact, Developer Velocity
- Guide, First Serverless Project
What does Serverless Guru do?
Serverless Guru helps companies build scalable and cost-effective applications on the cloud. We help train companies on how to leverage IAC, serverless, and cloud-native services. We help migrate existing applications to the cloud and optimize existing applications on the cloud to be more cost-effective. We are a Serverless development partner and an AWS Consulting partner.
What did we miss?
When you leave your answer make sure to either comment below or tweet your answer to @serverlessgurux on Twitter.
Founder — Serverless Guru
LinkedIn — @ryanjonesirl
Twitter — @ryanjonesirl
Thanks for reading 😃