I have API Gateway Resources that share a common API Gateway. I would like these resources to all fall under a single API Gateway Stage (regardless of the Serverless stage I’m deploying to).
I’ve tried configuring apiGateway.stage
along with restApiId
and restApiRootResourceId
(per these docs) but no stage with the configured name is created. Below is an example of my configs.
provider:
apiGateway:
restApiId: 1111
restApiRootResourceId: 2222
stage: foobar
...
functions:
func1:
name: func1-${opt:stage, 'dev'}
handler: bin/func1
events:
- http:
path: /${opt:stage, 'dev'}/f1
method: get
func2:
name: func2-${opt:stage, 'dev'}
handler: bin/func2
events:
- http:
path: /${opt:stage, 'dev'}/f2
method: post
I want my URLs to look like this under my custom API Gateway Stage:
https://asdfjkl.execute-api.my-region.amazonaws.com/foobar/dev/f1
https://asdfjkl.execute-api.my-region.amazonaws.com/foobar/dev/f2
https://asdfjkl.execute-api.my-region.amazonaws.com/foobar/prod/f1
https://asdfjkl.execute-api.my-region.amazonaws.com/foobar/prod/f2
Instead I see:
https://asdfjkl.execute-api.my-region.amazonaws.com/dev/dev/f1
https://asdfjkl.execute-api.my-region.amazonaws.com/dev/dev/f2
https://asdfjkl.execute-api.my-region.amazonaws.com/prod/prod/f1
https://asdfjkl.execute-api.my-region.amazonaws.com/prod/prod/f2
Am I missing something here? Thanks!!