fix(aws-apigateway): deployment snapshots, stage variables, method and deploy validation - #1372
Merged
Merged
Conversation
…d deploy validation
NitinKumar004
marked this pull request as ready for review
September 27, 2026 11:57
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
Work item A1 for REST API Gateway (v1). A deployed stage now behaves like it does on AWS.
Deployment snapshots
CreateDeploymentdeep-copies the resource, method and integration tree. A stage serves its deployment's copy. Edits to the live API stay invisible until you redeploy.UpdateStage /deploymentIdre-points a stage at an older deployment's tree, so rollback works.DeleteDeploymentdrops the captured tree.variables. Before this change the stage was replaced outright.CreateDeploymentnow acceptsstageDescriptionandvariables.GetDeployment?embed=apisummaryreturns the capturedapiSummary(path, method, authorizationType, apiKeyRequired).deploymentTreesin the snapshot). Older snapshots have no trees, so each deployment falls back to a copy of the restored live tree.Stage variables
${stageVariables.x}in a Lambda integration URI is resolved per stage on invoke.stageVariables.Validation, with the messages AWS returns
CreateDeployment: an API with no methods gives 400 "The REST API doesn't contain any methods". A method with no integration gives 400 "No integration defined for method". A bad stage name is also rejected.PutMethod: the verb must be GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS or ANY. Anything else gives 400 "Invalid HTTP method specified". A second PutMethod gives 409 "Method already exists for this resource".PutIntegration:httpMethod("Enumeration value for HttpMethod must be non-empty");arn:aws:apigateway:URI with a path or action;CreateStage: stage names allow onlya-zA-Z0-9_-(at most 128). A duplicate gives 409 "Stage already exists". An unknown deployment gives 404 "Invalid Deployment identifier specified".Wire fixes found in e2e
httpMethodin the body (the model's locationName). The handler readintegrationHttpMethod, so the aws CLI and Terraform integration methods were silently dropped.apiStatus: AVAILABLE. AWS provider 6.x waits on that field after CreateRestApi and failed without it.GetResourcesandGetResourcelist methods by name only ({"GET": {}}) unless?embed=methodsasks for the full Method objects.§3.4 pin test
TestExecuteAPIHostForV2APIServedByV1UntilV2DataPlanepins today's behaviour: an HTTP API id on an execute-api host gets 403{"message":"Missing Authentication Token"}from the v1 handler. A7b replaces it.Tests
cloudemu serve:Tracker
Closes A1 (plan B rows: PutMethod FOO accepted, CreateDeployment with zero methods, GetResources ignores embed, deployment immutability, stage variables,
${stageVariables}in the Lambda URI).Deferred
${stageVariables}in HTTP URIs at invoke time, is A3.