fix(aws-apigatewayv2): deployments, validation, tags, pagination and quick-create - #1374
Merged
Merged
Conversation
…s, stage and CORS rules, integration templates
NitinKumar004
marked this pull request as ready for review
September 27, 2026 13:23
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
API Gateway v2 had CRUD only. This PR adds deployments, input validation, tagging, pagination and quick create for HTTP and WebSocket APIs. All of it lives in the provider (
providers/aws/apigatewayv2), and the wire handler only maps it to restJson1.Deployments
/v2/apis/{apiId}/deployments.deploymentStatusisDEPLOYED. An API with no routes returnsUnable to deploy API because no routes exist in this API.stageName, the stage moves to the new deployment, andlastDeploymentStatusMessagerecords the move.autoDeploygets a new automatic deployment (autoDeployed: true, the real description text) when it is created or switched on. It also gets one whenever a route or integration changes.deploymentIdmust name an existing deployment. A deployment that a stage still points at cannot be deleted.Validation (BadRequestException / ConflictException)
$defaultorMETHOD /path, and a duplicate key returns ConflictException.authorizationScopesand validatesauthorizationTypefor the API's protocol.routeSelectionExpression. HTTP APIs accept only the method and path expression, in the bare or the braced${request.method} ${request.path}form that CDK sends. The API key expression accepts both forms too.requestTemplates,templateSelectionExpressionandpassthroughBehavior, so WebSocket MOCK integrations plan clean.^[a-zA-Z0-9_-]+$or be$default.apiEndpointnow useswss://.Tags
/v2/tags/{resource-arn}. Before this, the request fell through to S3.tags.aws:prefix reserved) are enforced.Pagination
maxResults(a string in the query, any positive integer) andnextTokenon GetApis, GetRoutes, GetIntegrations, GetStages and GetDeployments.Quick create
targetbuilds a managed integration: AWS_PROXY with payload 2.0 for a Lambda ARN, or HTTP_PROXY with ANY and 1.0 for a URL. It also builds a route forrouteKey(default$default) and a managed$defaultstage with autoDeploy.credentialsArngoes on the integration.target,routeKeyandcredentialsArnupdate the managed resources.Persist covers the new state: deployments with their frozen routes and integrations, stage tags and the managed flags.
The execute-api host still answers 403 Missing Authentication Token for a v2 id. The v2 data plane is A7b, and the §3.4 pin test in
server/aws/apigatewaystill passes.Testing
go build ./..., then scopedgo vetandgo test -raceon the touched packages plusserver/aws/apigateway. The server/aws dispatch-ordering and persist completeness tests pass.golangci-lint --new-from-rev=origin/developmentreports 0 issues.docs/coverageis regenerated.cloudemu servecovered quick create with a Lambda target, a route, an integration and an autoDeploy stage, a manual deployment, tag and untag on API and stage ARNs, and--page-sizeand--max-itemspaging. It also ran every error case above and the execute-api host.aws_apigatewayv2_api(quick create and full with CORS),_integration,_route,_stage(auto_deploy and a named stage) and_deploymentwith triggers and create_before_destroy. The run went apply, clean plan, update, clean plan, destroy.