Package Exports
- serverless-vpc-plugin
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (serverless-vpc-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
serverless-vpc-plugin
Automatically creates a VPC using all available Availability Zones the region specified in the serverless.yml configuration.
This plugin provisions the following resources:
AWS::EC2::VPC
AWS::EC2::InternetGateway
(for outbound public internet access)AWS::EC2::VPCGatewayAttachment
(to attach the IGW to the VPC)
If the VPC is allocated a /16 subnet, each availability zone within the region will be allocated a /20 subnet. Within each availability zone, this plugin will further divide the subnets:
- "Application"
AWS::EC2::Subnet
(/21) - default route is eitherInternetGateway
orNatGateway
- "Public"
AWS::EC2::Subnet
(/22) - default route set toInternetGateway
- "Database"
AWS::EC2::Subnet
(/22) - no default route set in routing table
Optionally, this plugin can also create AWS::EC2::NatGateway
instances in each availability zone which requires provisioning AWS::EC2::EIP
resources (AWS limits you to 5 per VPC).
This plugin will also provision the following database-related resources:
AWS::RDS::DBSubnetGroup
AWS::ElastiCache::SubnetGroup
AWS::Redshift::ClusterSubnetGroup
AWS::EC2::VPCEndpoint
for S3AWS::EC2::VPCEndpoint
for DynamoDB
to make it easier to create these resources across all of the availability zones.
Installation
$ npm install --save-dev serverless-vpc-plugin
Configuration
- All vpcConfig configuration parameters are optional
# add in your serverless.yml
plugins:
- serverless-vpc-plugin
custom:
vpcConfig:
cidrBlock: '10.0.0.0/16'
useNatGateway: true