-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Apigw/enable vpce routing #12937
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
Apigw/enable vpce routing #12937
Conversation
LocalStack Community integration with Pro 2 files 2 suites 18m 16s ⏱️ Results for commit 667a359. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 35m 10s ⏱️ Results for commit 667a359. ♻️ This comment has been updated with latest results. |
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 know this is still in draft, but I suppose it is only because it is a stacked PR 😄 so I'll already approve, this is a great PR, thanks for supporting this and having the patience to run the VPC Link tests 😄
"last_validated_date": "2025-07-30T17:57:02+00:00", | ||
"durations_in_seconds": { | ||
"setup": 12.89, | ||
"call": 1064.8, |
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.
painful 😭
# AWS | ||
# url: https://{public-dns-hostname}.execute-api.{region}.vpce.amazonaws.com/{stage} | ||
# x-apigw-api-id: {rest-api-id} | ||
# LocalStack Not a clue |
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.
why "Not a clue"? 😄 same in the comment above
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.
oops! Placeholder not removed 😝
@@ -144,6 +145,13 @@ def create_not_found_response(api_id: str) -> Response: | |||
) | |||
return not_found | |||
|
|||
def vpc_endpoint_handler( |
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 think this is a good way forward, as the shape of the URL is very different and doesn't have some of the parameters we're always expecting in a route, like api_id
. Thanks for implementing it this way 🚀 and minimal changes with upstream dependencies 👍
@@ -214,6 +225,26 @@ def register_routes(self) -> None: | |||
endpoint=self.handler, | |||
strict_slashes=True, | |||
), | |||
self.router.add( |
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 have so many routes 😅
url = event["url"] | ||
headers = event["headers"] | ||
|
||
result = requests.post(url, headers=headers) | ||
return {"content": result.content.decode("utf-8"), "code": result.status_code} |
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 making the test more modular! this is really nice
46f0568
to
01c6d71
Compare
💯 Thank you for the early review! 🚀 |
Motivation
depends on: #12927
This pr adds a route to apigw to allow invoking an ApiGateway API through it's vpc endpoint using the
x-apigw-api-id
headers, as describe in AWS docs.At the moment we are not validating the vpc endpoint exists, so any "valid" VPC endpoint like url targeted at
.vpce.execute-api
will attempt to execute the api provided with thex-apigw-api-id
. Note this is already the case for the other path style of VPC endpoint and as such falls outside the scope of the current PR.Changes
host
headers (already supported by default, but now tested)