Skip to content

minor: Unify and adjust API Gateway stage name#27

Merged
HarshCasper merged 2 commits intomainfrom
api-stage-prod
Apr 10, 2025
Merged

minor: Unify and adjust API Gateway stage name#27
HarshCasper merged 2 commits intomainfrom
api-stage-prod

Conversation

@whummer
Copy link
Copy Markdown
Contributor

@whummer whummer commented Apr 9, 2025

When preparing for a customer demo today, we've noticed that the API Gateway URL does not work for the seed script.

$ bin/seed.sh
...
[2025-04-09 11:48:47] Creating Comic Book Quiz...
[2025-04-09 11:48:47] ERROR: Failed to create quiz: {"message": "The API id 'egjlwwwc4s' does not correspond to a deployed API Gateway API"}
...

Got some help from @bentsku today 🙌 who found out that the stage reference needs to be adjusted in the API Gateway URL, to be compatible with AWS (and the latest provider implementation in LS).

@whummer whummer requested review from HarshCasper and bentsku April 9, 2025 22:28
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2025

@HarshCasper HarshCasper merged commit 08006d1 into main Apr 10, 2025
3 checks passed
@bentsku
Copy link
Copy Markdown
Contributor

bentsku commented Apr 10, 2025

Quick context as to why it failed: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.RestApi.html#deploy

To unblock the demo, we ran a awslocal apigateway get-stages --rest-api-id <id> to see the existing deployed stages and saw the prod one.

I've just looked at the docs: when deploying with CDK, it will auto deploy your REST API, apparently with the prod stage name.

We could also set some parameters over the RestApi construct with deploy=True and deployOptions and https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.StageOptions.html, so we could specify the stageName.

Anyway, just wanted to understand myself why it suddenly deployed on the prod stage, and give context back 😄

@HarshCasper HarshCasper deleted the api-stage-prod branch April 22, 2025 12:35
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.

3 participants