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:
AWS::EC2::DHCPOptions
2 extra AWS::EC2::RouteTable
2 extra AWS::EC2::Subnet
2 extra AWS::EC2::SubnetRouteTableAssociation
AWS::EC2::SecurityGroup
AWS::EC2::SecurityGroupEgress
AWS::EC2::VPCDHCPOptionsAssociation
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:
the extra subnets
the extra DHCP options
the security groups (only the default security group which doesn't need to be explicitly created is enough)
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
andAWS::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:CDK resources: