Socket
Socket
Sign inDemoInstall

serverless-plugin-vpc

Package Overview
Dependencies
38
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    serverless-plugin-vpc

Serverless VPC Plugin.


Version published
Weekly downloads
5
increased by400%
Maintainers
1
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 12 Feb 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc