feat(apigatewayv2,tfacc): default metadata fields on CreateApi; enable apigatewayv2#377
Merged
vieiralucas merged 1 commit intomainfrom Apr 14, 2026
Merged
Conversation
…e apigatewayv2 Real AWS API Gateway v2 always returns four metadata fields on GetApi that fakecloud was omitting: - apiKeySelectionExpression (default '$request.header.x-api-key') - routeSelectionExpression (default '$request.method $request.path') - disableExecuteApiEndpoint (default false) - ipAddressType (default 'ipv4') Terraform's aws_apigatewayv2_api provider asserts on each of these on every refresh, so omitting them surfaced as 'expected X got ""' drift in TestAccAPIGatewayV2API_basicHTTP. Added the four fields to the HttpApi state struct with the correct real-AWS defaults; serde camelCase rename takes care of the wire shape. New e2e test apigatewayv2_create_api_returns_default_metadata_fields covers all four. Adds apigatewayv2 to the tfacc allow-list. Cognito and RDS both deferred — Cognito needs ~5 schema fields populated (email_configuration, verification_message_template, sign_in_policy, user_pool_tier, etc) and RDS needs DescribeOrderableDBInstanceOptions which is not yet implemented.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Batch 9 — adds API Gateway v2 to the upstream Terraform acceptance harness with one fakecloud bug fix.
API Gateway v2 metadata defaults
Real AWS API Gateway v2 always returns four metadata fields on `GetApi` that fakecloud was omitting:
Terraform's `aws_apigatewayv2_api` provider asserts on each of these on every refresh, so omitting them surfaced as `expected X got ""` drift in `TestAccAPIGatewayV2API_basicHTTP`.
Deferred from this batch
Both will get their own batches once the underlying gaps are closed.
Test plan
Summary by cubic
Return the four missing default metadata fields for API Gateway v2 so
GetApimatches real AWS, and enableapigatewayv2in thetfaccharness. This removes drift foraws_apigatewayv2_apiand runs the basic HTTP acceptance test.Bug Fixes
apiKeySelectionExpressionto$request.header.x-api-key.routeSelectionExpressionto$request.method $request.path.disableExecuteApiEndpointtofalse.ipAddressTypetoipv4.New Features
apigatewayv2infakecloud-tfaccwith^TestAccAPIGatewayV2API_basicHTTP$.apigatewayv2_create_api_returns_default_metadata_fields.Written for commit 665f22e. Summary will update on new commits.