Skip to content

Add vpcEndpointIds as an option on RestApi #6038

@bulka777

Description

@bulka777

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

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-apigatewayRelated to Amazon API Gatewayeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.in-progressThis issue is being actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions