mysterious-belgium-44686
06/05/2021, 9:23 PM$default
as a stage name, which will let you route via /
- I'd like to do that.
You can create a $default stage that is served from the base of your API's URL—for example, https://{api_id}.execute-api.{region}.<http://amazonaws.com/|amazonaws.com/>. You use this URL to invoke an API stage.
I set that in my pulumi code:
stage = aws.apigateway.Stage(
f"{self.rest_api._name}-prod-stage",
deployment=deployment.id,
rest_api=self.rest_api.id,
stage_name="$default",
opts=pulumi.ResourceOptions(parent=self),
)
but I get this error:
aws:apigateway:Stage (api-gateway-prod-stage):
error: 1 error occurred:
* Error creating API Gateway Stage: BadRequestException: Stage name only allows a-zA-Z0-9_
From the error + docs it looks like Pulumi doesn't seem to support this?
Each API Gateway deployment is associated with a so-called stage. A stage is simply a version of your API, such as stage, prod, v1, or v2. For simple APIs, you will likely just have one. You can always define a custom stage name, but if you leave it off, a default of stage will be chosen.
echoing-zebra-28421
06/05/2021, 9:26 PMmysterious-belgium-44686
06/05/2021, 9:27 PM$default
- in the AWS API Gateway docs they indicate that $default
is a special stage name that will let you route via /
billowy-army-68599
06/05/2021, 10:28 PM$default
only applies to apiGateway v2, and you're using the v1 resourcemysterious-belgium-44686
06/05/2021, 10:28 PMbillowy-army-68599
06/05/2021, 10:28 PM$stage
at all:
https://docs.aws.amazon.com/apigateway/api-reference/resource/stage/v2
docs do: https://docs.aws.amazon.com/apigatewayv2/latest/api-reference/apis-apiid-stages-stagename.htmlmysterious-belgium-44686
06/05/2021, 10:29 PM