-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
The RestApi interface allows for VPC Ids to be associated with the private endpoint:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html
The CDK construct for RestApi allows for setting of a endpoint type to be private, but it does not yet allow to associated VPC Ids with it. I would like to propose that we extend the interface to allow for this association to be done.
Use Case
This is supported by the cloud formation templates.
https://docs.aws.amazon.com/apigateway/latest/developerguide/associate-private-api-with-vpc-endpoint.html
This would allow for a simplified access to the resource without passing the Host header.
Proposed Solution
There are a few ways that one can go about implementing this.
One way to implement this is to modify the endpointTypes property that currently exists on RestApi construct. We can change it to endpointConfiguration and combine both types and vpcEndpointIds just like how cloudformation documentation defines it. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.html
The other option is to just extend the props on RestApi construct with vpcEndpointIds. This would allow us to prevent breaking changes on the interface, but is a digression from a standard interface defined by Cfn.
The other point of consideration is a possibility to allow passing an array of IVpc objects for vpcEndpoints and then extract the IDs from them when we are constructing vpcEndpointIds on the CfnRestApi.
Other
- 👋 I may be able to implement this feature request
-
⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request