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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example: setting up a private integration with a alb/nlb using new aws-apigatewayv2 module #329

Closed
2 tasks
mscheer93 opened this issue Aug 31, 2020 · 1 comment
Assignees
Labels
feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@mscheer93
Copy link

mscheer93 commented Aug 31, 2020

馃殌 Feature Request

General Information

  • 馃憢 I may be able to implement this feature request
  • 鈿狅笍 This feature might incur a breaking change

Description

Since the migration of HTTP API into the new aws-apigatewayv2 module, it is unclear to me how to use the module to set up a private integration via VPCLink with an alb/nlb using the new aws-apigatewayv2 module when adding routes to the api.
The example shown in Issue 8066 doesn't fit the new library.

import * as apiv2 from '@aws-cdk/aws-apigatewayv2';
import * as apigw from '@aws-cdk/aws-apigateway';


const api = new apiv2.HttpApi(this, "testingApi", {
      apiName: "testingApi",
})

// declare API routes integrations
const link = new apigw.VpcLink(this, 'link', {
  targets: [nlb]
});
const integration = new apigw.HttpIntegration("",{
  httpMethod: apiv2.HttpMethod.ANY,
  options: {
    connectionType: apigw.ConnectionType.VPC_LINK,
    vpcLink: link
  },
  proxy: false
})

api.addRoutes({
  integration: integration,
  methods: [apiv2.HttpMethod.GET, apiv2.HttpMethod.DELETE, apiv2.HttpMethod.POST, apiv2.HttpMethod.OPTIONS, apiv2.HttpMethod.PUT],
  path: "/somePath"
})

// -> throws ...Type 'HttpIntegration' is not assignable to type 'IHttpRouteIntegration'... error

The addRoutes() call requires type 'IHttpRouteIntegration', but I can't figure out how to use the HTTP Proxy Integration to set up a private integration for an alb/nlb linked to routes.

Proposed Solution

A simple code example with just one stack containing the new HTTP API and a linked alb/nlb via private integration using the
aws-apigatewayv2 would be perfect :)

Environment

  • CDK CLI Version: 1.61.0
  • OS: all
  • Language: TypeScript

Other information

@mscheer93 mscheer93 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 31, 2020
@nija-at
Copy link
Contributor

nija-at commented Sep 2, 2020

We don't have support for vpc link in the aws-apigatewayv2 module.

I've opened an issue to track this - aws/aws-cdk#10119. Examples will be available once this feature has been implemented.

@nija-at nija-at closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants