Methods to deploy Serverless Functions
Serverless Functions can be deployed and managed using several tools. This page aims to help you find the right tool for your use-case.
You can find examples using all the deployment methods shown here in our Serverless Examples repository.
Scaleway console
The Scaleway console is the easiest way to get started deploying Functions.
The console lets you deploy functions written in a single source file in your browser.
Deploying larger projects with dependencies and many files requires zipping your code before uploading it. This is covered in our tutorial on packaging functions in a zip file.
Serverless framework
Serverless Framework is a tool to dedicated to easing the deployment of serverless applications, including Scaleway Serverless Functions and Containers.
With Serverless Framework, you can deploy your Dockerfile as a Serverless Container via a single command: serverless deploy
.
Your function configuration is done via a single YAML file, which can be checked into your version control system.
Installation, examples, usage, and advanced documentation are available in the Serverless Scaleway Plugin repository.
Serverless Framework can be used in many use cases such as CI/CD, production deployments, and multi-project deployments with serverless-compose.
Many of the examples found in our Serverless Examples repository make use of Serverless Framework, and may help you get started.
Terraform
Serverless Functions integrate easily with your infrastructure as code, via our Terraform provider and resources.
Examples using Terraform can be found in our Serverless Examples repository, such as our example using Terraform with Python.
API-Framework (Python)
Writing parts of your API fully in Python is possible with the serverless-api-project.
It integrates perfectly with Python code bases where you just need to import the package to expose your handlers directly in the cloud.
Locally
In order to develop and test your function locally before deploying them we provide frameworks to test your code:
API
The Scaleway HTTP API lets you manage your Serverless Functions and Containers via HTTP calls.
The HTTP API can be useful when integrating Function management into your automated tasks, continuous integration, and more custom use-cases.
Refer to the API procedure for more information.
Deploying a function requires multiple API calls (namespace creation, function creation, generating URL to push code, function deployment), hence will require more boilerplate code than some of the other methods listed here.
CLI
The Scaleway CLI is a simple command line interface that allows you to create, update, delete and list your Serverless Functions and Containers.
Installation instructions and documentation is available in the Scaleway CLI repository.
Below is an example of using the CLI to deploy a function:
scw function namespace create name=hello# saving my namespace ID for later usescw function function create name=myfunc runtime=go120 namespace-id=<MY-NAMESPACE-ID>
Scaleway SDKs
The Scaleway SDKs allow you to manage your resources directly from your favorite languages.
The available SDKs are:
The documentation for each SDK is held in its respective repository.