Add vpcEndpointIds as an option on RestApi #6038
Labels
@aws-cdk/aws-apigateway
Related to Amazon API Gateway
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
in-progress
This issue is being actively worked on.
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 toendpointConfiguration
and combine bothtypes
andvpcEndpointIds
just like how cloudformation documentation defines it. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.htmlThe 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 constructingvpcEndpointIds
on the CfnRestApi.Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: