-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add vpcEndpointIds as an option on RestApi #6038
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-apigatewayRelated to Amazon API GatewayRelated to Amazon API Gatewayeffort/mediumMedium work item – several days of effortMedium work item – several days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.in-progressThis issue is being actively worked on.This issue is being actively worked on.
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-apigatewayRelated to Amazon API GatewayRelated to Amazon API Gatewayeffort/mediumMedium work item – several days of effortMedium work item – several days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.in-progressThis issue is being actively worked on.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
endpointTypesproperty that currently exists on RestApi construct. We can change it toendpointConfigurationand combine bothtypesandvpcEndpointIdsjust 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
vpcEndpointsand then extract the IDs from them when we are constructingvpcEndpointIdson the CfnRestApi.Other
This is a 🚀 Feature Request