aws / aws/aws-cdk

ApiGateway: Docs do not describe what to depend on to wait for an API Gateway deployment to complete

Open
#24,285 9 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-apigateway documentation effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

I've done some testing, and it seems like one of the following 3 does what's needed, although this is difficult to absolutely confirm.
In the below, api is a SpecRestApi - https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-apigateway.SpecRestApi.html

someResource.node.addDependency(api)
someResource.node.addDependency(api.deploymentStage)
someResource.node.addDependency(api.latestDeployment)

Would it be possible to confirm what dependency should be taken to make sure that the resource will only be created after all API Gateway updates have been completed (like adding a new api path, or changing an integration configuration, or pointing to a new lambda).

Whatever the right approach is, could this be called out in the docs as this is something that consumers of this library will often want to do! For example - to run some validation tests which should not begin until the updates to the api are completed.

### Links

https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-apigateway.SpecRestApi.html

Contributor guide

Open the contributing guide

Research direction

Start with the SpecRestApi documentation and compare the dependency behavior of api, api.deploymentStage, and api.latestDeployment for API Gateway updates. Confirm which dependency guarantees completion, then document that guidance and an example for validation resources; the existing API Gateway documentation link is the main entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.