Skip to content

feat(apigatewayv2,tfacc): default metadata fields on CreateApi; enable apigatewayv2#377

Merged
vieiralucas merged 1 commit intomainfrom
worktree-tfacc-cognito-rds
Apr 14, 2026
Merged

feat(apigatewayv2,tfacc): default metadata fields on CreateApi; enable apigatewayv2#377
vieiralucas merged 1 commit intomainfrom
worktree-tfacc-cognito-rds

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 14, 2026

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:

  • `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`.

Deferred from this batch

  • Cognito: `TestAccCognitoIDPUserPool_basic` needs ~5 schema blocks populated on `DescribeUserPool` (`email_configuration`, `verification_message_template`, `sign_in_policy`, `user_pool_tier`, etc).
  • RDS: `TestAccRDSInstance_basic` needs `DescribeOrderableDBInstanceOptions` which is not yet implemented in fakecloud-rds.

Both will get their own batches once the underlying gaps are closed.

Test plan

  • New e2e test `apigatewayv2_create_api_returns_default_metadata_fields` covers all four fields — passes
  • `cargo clippy -p fakecloud-apigatewayv2 -p fakecloud-tfacc -p fakecloud-e2e --all-targets -- -D warnings` clean
  • Upstream locally: `TestAccAPIGatewayV2API_basicHTTP` passes (~9s)
  • CI `tfacc apigatewayv2` green
  • All other tfacc jobs still green
  • Cubic clean

Summary by cubic

Return the four missing default metadata fields for API Gateway v2 so GetApi matches real AWS, and enable apigatewayv2 in the tfacc harness. This removes drift for aws_apigatewayv2_api and runs the basic HTTP acceptance test.

  • Bug Fixes

    • Default apiKeySelectionExpression to $request.header.x-api-key.
    • Default routeSelectionExpression to $request.method $request.path.
    • Default disableExecuteApiEndpoint to false.
    • Default ipAddressType to ipv4.
  • New Features

    • Enable apigatewayv2 in fakecloud-tfacc with ^TestAccAPIGatewayV2API_basicHTTP$.
    • Add e2e test apigatewayv2_create_api_returns_default_metadata_fields.

Written for commit 665f22e. Summary will update on new commits.

…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.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@vieiralucas vieiralucas merged commit 901d53e into main Apr 14, 2026
34 checks passed
@vieiralucas vieiralucas deleted the worktree-tfacc-cognito-rds branch April 14, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant