smoketurner / serverless-vpc-plugin

Serverless Plugin to create a VPC
MIT License
88 stars 35 forks source link

Use the CDK behaviour as a saner default #822

Closed nponeccop closed 2 years ago

nponeccop commented 2 years ago

Currently, when configured with 2 AZs, the plugin creates a few inessential resources in a non-configurable manner. I suggest changing the behavior so it matches the CDK behavior, or at least to make it configurable so that the CDK behavior is achievable.

From the comparison below, it can be seen that the plugin currently configures 10 extra resources:

Additionally, the AWS::EC2::SecurityGroup and AWS::EC2::SecurityGroupEgress have a rather strange configuration - e.g. many applications would require either a stricter or more relaxed rule set, and neither of it is configurable.

I guess the easiest way is to introduce 3 options to suppress:


serverless-vpc-plugin resources:

      1       "Type": "AWS::EC2::DHCPOptions",
      2       "Type": "AWS::EC2::EIP",
      1       "Type": "AWS::EC2::InternetGateway",
      2       "Type": "AWS::EC2::NatGateway",
      4       "Type": "AWS::EC2::Route",
      6       "Type": "AWS::EC2::RouteTable",
      1       "Type": "AWS::EC2::SecurityGroup",
      1       "Type": "AWS::EC2::SecurityGroupEgress",
      6       "Type": "AWS::EC2::Subnet",
      6       "Type": "AWS::EC2::SubnetRouteTableAssociation",
      1       "Type": "AWS::EC2::VPC",
      1       "Type": "AWS::EC2::VPCDHCPOptionsAssociation",
      1       "Type": "AWS::EC2::VPCGatewayAttachment",

CDK resources:

      1       "Type": "AWS::CDK::Metadata",
      2       "Type": "AWS::EC2::EIP",
      1       "Type": "AWS::EC2::InternetGateway",
      2       "Type": "AWS::EC2::NatGateway",
      4       "Type": "AWS::EC2::Route",
      4       "Type": "AWS::EC2::RouteTable",
      4       "Type": "AWS::EC2::Subnet",
      4       "Type": "AWS::EC2::SubnetRouteTableAssociation",
      1       "Type": "AWS::EC2::VPC",
      1       "Type": "AWS::EC2::VPCGatewayAttachment",
github-actions[bot] commented 2 years ago

This issue is stale because it has been open 90 days with no activity. Remove the "stale" label or comment or this will be closed in 14 days.