Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vpcEndpointIds as an option on RestApi #6038

Closed
2 tasks done
bulka777 opened this issue Jan 31, 2020 · 1 comment · Fixed by #6078
Closed
2 tasks done

Add vpcEndpointIds as an option on RestApi #6038

bulka777 opened this issue Jan 31, 2020 · 1 comment · Fixed by #6078
Assignees
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.

Comments

@bulka777
Copy link
Contributor

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

@bulka777 bulka777 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 31, 2020
bulka777 pushed a commit to bulka777/aws-cdk that referenced this issue Feb 3, 2020
fixes aws#6038
BREAKING CHANGE: the interface now accepts endpointconfiguration property instead of endpoint type as defined by cfn
@SomayaB SomayaB added in-progress This issue is being actively worked on. @aws-cdk/aws-apigateway Related to Amazon API Gateway labels Feb 3, 2020
@SomayaB
Copy link
Contributor

SomayaB commented Feb 3, 2020

Hi @bulka777, thanks for opening a PR, much appreciated! 👍

@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Feb 3, 2020
@nija-at nija-at added the effort/medium Medium work item – several days of effort label Feb 5, 2020
@mergify mergify bot closed this as completed in #6078 Feb 19, 2020
mergify bot added a commit that referenced this issue Feb 19, 2020
…Ids (#6078)

* feat(apigateway): expose endpointconfiguration to include vpcEndpointIds
fixes #6038
BREAKING CHANGE: the interface now accepts endpointconfiguration property instead of endpoint type as defined by cfn

* feature(apigateway): support private vpc endpoints

* feature(apigateway): support private vpc endpoints

* fix(apigateway): documentation changes for the endpoint configuration

proposed changes

Co-Authored-By: Niranjan Jayakar <16217941+nija-at@users.noreply.github.com>

* fix(apigateway): apply recommended changes

* fix(apigateway): adding requested changes and integration test

* fix(apigateway): incorrect vpc endpoint in integration test

Co-authored-by: Niranjan Jayakar <16217941+nija-at@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants