InterfaceVpcEndpoint vs VpcEndpoint in AWS CDK

Viewed 1150
1 Answers

Its about CDK constructs. You should know that there are 3 levels of constructs: L1 (low-level), L2 (regular) and L3 (high-level patterns).

InterfaceVpcEndpoint is L2 used to create interface VPC endpoints. VpcEndpoint class is a support class which is parent of InterfaceVpcEndpoint. You can think of VpcEndpoint as being somewhere between L2 and L1. You shouldn't use, or even cant use it directly, as its used to encapsulate common functionality between Interface VPC endpoints and Gateway VPC endpoints.

So to create interface endpoint, use InterfaceVpcEndpoint. Similarly to create gateway endpoint, use GatewayVpcEndpoint. Both are L2 constructs.

Related