Set AWS Websocket Stage

How can I set the stage name that AWS deploys my Websocket API gateway to? This is in contrast to the normal sls stage (dev. test, prod).

So, for a given development API such as Project-WebsocketGW-dev, I want to deploy it to API stages that are for a given purpose as opposed to dev/test/prod.

Here is a snippet from the AWS docs that show the stageName that I’m referring to:

wss://{api-id} .execute-api.{region}{stageName}


It probably depends how you’re creating everything. Are you creating an AWS::ApiGatewayV2::Stage? If so you can use a Ref to get the value for the stage name. AWS::ApiGatewayV2::Stage - AWS CloudFormation

I was hoping to avoid using cloudformation. That’s the whole point of serverless, right?

Cant this be done without resorting to cloudformation?