Socket
Book a DemoInstallSign in
Socket

serverless-plugin-vpc

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-plugin-vpc

Serverless VPC Plugin.

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Serverless Plugin VPC

NPM

This plugin adds vpc support to your lambda functions.

Note: This plugin supports Serverless 0.4*

Installation

cd projectfolder
npm install serverless-plugin-vpc
  • add the plugin to your s-project.json file
"plugins": [
    "serverless-plugin-vpc"
]

Run the Plugin

  • the plugin uses a hook that is called after each deployment of a function
  • you only have to deploy your function as usual sls function deploy
  • add the following attribute to the s-function.json in your functions folder
  ...
  "vpcConfig": {
      "SubnetIds": [
          "subnet-abcda004"
      ],
      "SecurityGroupIds": [
          "sg-abcdc999"
      ]
  },
  ...

modify IAM

  • Check the role, that executes your Lambda.
  • Normally you will receive an error:
Unhandled rejection AccessDeniedException: Your access has been denied by EC2, please make sure your function execution role have permission to CreateNetworkInterface. EC2 Error Code: UnauthorizedOperation. EC2 Error Message: You are not authorized to perform this operation.

  • Please add the following role policy to the functions role:
{
  "Effect": "Allow",
  "Action": [
    "ec2:CreateNetworkInterface",
    "ec2:DescribeNetworkInterfaces",
    "ec2:DeleteNetworkInterface"
  ],
  "Resource": "*"
},

Keywords

serverless plugin vpc

FAQs

Package last updated on 12 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts