-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(apigatewayv2): vpc link and private integrations #10531
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this PR. First round of comments.
Hi @nija-at , I have modified the previous implementation to a more specific one by also adding the usage with Some open things that I need help on:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on the first iteration of this PR. Most of this code is conformant to the CDK style and how we model this!
I've not gone through the code in detail but some high level comments around code and class organization that will need to be first addressed.
packages/@aws-cdk/aws-apigatewayv2/lib/http/integrations/http-private.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-apigatewayv2/lib/http/integrations/http-private.ts
Outdated
Show resolved
Hide resolved
There is still an open question on a way to verify the integration tests stack (which currently just tests the deployment) |
We do this in several places already. Here's one example - https://github.com/aws/aws-cdk/blob/master/packages/@aws-cdk/aws-lambda-destinations/lib/lambda.ts#L38-L57
I'm not sure I'm following this. Could you explain a bit better? It's fine if you want this to be done later but I would like to understand what's preventing this better. If it was simple, it could be a nice customer experience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments below. The main one is about splitting off into its own package.
Also, take a look at this one - #10531 (comment)
...igatewayv2/lib/http/integrations/private-integration/application-loadbalancer-integration.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-apigatewayv2/lib/http/integrations/private-integration/http-private.ts
Outdated
Show resolved
Hide resolved
...igatewayv2/lib/http/integrations/private-integration/application-loadbalancer-integration.ts
Outdated
Show resolved
Hide resolved
You can run the integ test using Credentials can be configured using any means that you do for the AWS CLI. |
Yeah I was able to test the deployment successfully. I was specifically talking about the verification steps we mention at the top of the integ-tests file. I was looking for a way to verify these stacks basically. |
We currently don't have a way to run those tests in the CDK. These should contain steps on verification beyond deployment. As an example, in your case, it should deploy a stack that creates an ALB that returns '200' status code, which is then integrated to an Hope that makes it clear. |
Hi @nija-at , I have implemented the integrations by taking into account your suggestions and separated out the packages as well. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! IMPRESSIVE.
Thanks for all the work here. I'm sure you had a few hoops to jump through.
Mostly adjustments to README and naming conventions, besides one or two other comments. This has been great!
packages/@aws-cdk/aws-apigatewayv2-integrations/lib/alb-integration.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-apigatewayv2-integrations/lib/http-private.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-apigatewayv2-integrations/lib/http-private.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-apigatewayv2-integrations/lib/alb-integration.ts
Outdated
Show resolved
Hide resolved
if (!this.props.vpc) { | ||
throw new Error('One of vpcLink or vpc should be provided for private integration'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also error when both are provided and they don't point to the same vpc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that validation required? We are currently ignoring the passed vpc if the vpcLink is supplied. Basically vpcLink trumps the vpc.
Also, the vpcLink in v2 can point to multiple VPCs in theory (since it takes subnets and securityGroups). In this case it might not make sense to compare the VPCs.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accepting a property and not using it is usually confusing. "Why was my vpc not used?" would be a complaint I expect to hear.
How about just failing if both are presented? It'll make the requirement that only one should be passed clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be required anymore since we are not accepting vpc as a prop (it is passed around internally by integrations)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come?
In the case of HttpAlbIntegration
, we accept an ALB and a VPCLink. If the ALB is in a different vpc from the vpc link, it's useful to error, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that way.
But in that case the intent was explicit to use the passed vpcLink right? We are not explicitly taking the vpc as a prop. We are inferring.
Also, as mentioned before, the vpcLink in v2 is not bound to just one vpc in theory. It revolves around subnets and securityGroups. We have just provided a convenience to pass a vpc to create the vpcLink. So comparing the vpc of vpcLink and ALB listener might not be ideal.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Ok, let's leave it as is for now. See how this pans out.
packages/@aws-cdk/aws-apigatewayv2-integrations/lib/http-private.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-apigatewayv2-integrations/lib/http/service-discovery-integration.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-apigatewayv2-integrations/lib/alb-integration.ts
Outdated
Show resolved
Hide resolved
I've taken the liberty to pare down the file names to make it more terse and moved the The code looks great otherwise. |
Thanks for these changes. They look good to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the good stuff 🙌
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
heads up: I believe this also requires aws/jsii#2172 as the usage of may need to temporarily revert this. |
@ayush987goyal perfect. we're going to temporarily revert this and merge this back in when the next release of |
…" (#11070) This reverts commit 0537598. This change requires aws/jsii#2172 to be merged and a jsii upgrade as the usage of `@internal` for `HttpPrivateIntegration` and `VpcLinkConfigurationOptions` is causing downstream compilation failures currently. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This reverts commit 65be3a0. Original PR: #10531 Co-authored-by: Ayush Goyal <[email protected]> This commit was previously reverted due to a bug in jsii - aws/jsii#1947 and aws/jsii#1830. This has been fixed in jsii version 1.14.0.
This reverts commit 65be3a0. Original PR: #10531 Co-authored-by: Ayush Goyal <[email protected]> relates #10119 This commit was previously reverted due to a bug in jsii - aws/jsii#1947 and aws/jsii#1830. This has been fixed in jsii version 1.14.0. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
VpcLink and HttpProxyPrivateIntegration.
References in AWS docs:
VpcLink
Integration-1
Integration-2
closes #10119
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license