-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
APIGW: add support for new endpoint configuration #12826
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
base: master
Are you sure you want to change the base?
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 19m 46s ⏱️ - 1h 22m 34s Results for commit 446e081. ± Comparison against base commit dbad558. This pull request removes 3766 and adds 5 tests. Note that renamed tests count towards both.
This pull request removes 710 skipped tests and adds 1 skipped test. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 35m 44s ⏱️ Results for commit 446e081. ♻️ This comment has been updated with latest results. |
…c, add additional tests, update snapshots in test_apigateway_api.py
test_create_execute_api_vpc_endpoint
95ec3ea
to
e5b7fd4
Compare
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, this is a great PR! 🚀 you really went the extra mile for the validation, this is looking really good. The test cases are very, very thorough and bring us a lot of confidence in previously untested areas. Congrats for the work, I'm really happy about it!
I just have minor comments regarding simplifying the code a little bit, and making use of the generated APIs for hardcoded string values. But once this is addressed, this is good to go! Once again, great work 🚀
if patch_op["op"] not in ("add", "remove", "move", "test", "replace", "copy"): | ||
raise CommonServiceException( | ||
code="ValidationException", | ||
message=f"1 validation error detected: Value '{patch_op['op']}' at 'updateRestApiInput.patchOperations.1.member.op' failed to satisfy constraint: Member must satisfy enum value set: [add, remove, move, test, replace, copy]", | ||
) |
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.
nit: I believe this validation is for all types, and could be move outside of the if patch_op_path
check, and be done very early, almost after the for patch_op in patch_operations:
line. What do you think?
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.
Ah yes, of course! Perfect, I moved this check just after the for patch_op in patch_operations:
line. I even considered putting it into a separate loop, to save doing unnecessary patch operations, if it happens that one of the operations is invalid and we end up raising the exception anyways. What do you think?
localstack-core/localstack/services/apigateway/legacy/provider.py
Outdated
Show resolved
Hide resolved
localstack-core/localstack/services/apigateway/legacy/provider.py
Outdated
Show resolved
Hide resolved
… test, and regenerate snapshots
Motivation
AWS recently introduced the
ipAddressType
field for API Gateway Rest APIs, defaulting to"ipv4"
.LocalStack needs to mimic this behavior to maintain parity.
Related docs:
Changes
endpointConfiguration.ipAddressType
inCreateRestApi
.replace
operation fortypes
andipAddressTypes
inUpdateRestApi
.TODO
What's left to do:
"$..endpointConfiguration.ipAddressType"
was added in thetest_create_execute_api_vpc_endpoint
, because regenerating its snapshot wasn't working.