yandex-cloud / serverless-plugin

MIT License
57 stars 15 forks source link

npm License

Serverless Yandex Cloud Functions Plugin

This plugin enables support for Yandex Cloud Functions within the Serverless Framework.

Quick Start

First you need to install the serverless command-line tool. Check the official getting started guide. Fastest way to do this is to use npm:

npm install serverless -g

Now you can create new project from template provided by this plugin:

serverless create \
  --template-url https://github.com/yandex-cloud/serverless-plugin/tree/master/templates/nodejs

Before you deploy your first functions using Serverless, you need to configure Yandex.Cloud credentials. There are two ways to do it:

To deploy your project use:

serverless deploy

To invoke (test) your function:

serverless invoke -f simple

To remove all deployed resources:

serverless remove

Configuration variables from Lockbox

This plugin adds configuration variable source, which allows to retrieve secrets from Lockbox. Usage example:

functions:
  simple:
    handler: dist/index.hello
    memorySize: 128
    timeout: '5'
    account: function-sa
    environment:
      DB_PASSWORD: ${lockbox:<lockbox_secret_id>/<lockbox_secret_key>}

Environment Variables

API Endpoints

AWS Access Key (for YMQ and Object Storage manipulations)

Supported resources