I am trying to use s3 with api gateway. I have a stage variable that stored bucket name for each stage. But not able to use it in path override or path parameters
instead of bucket/{key} want to use stageVariable.variable/{key}. I have tried using ${stageVariable.variable}/{key},'${stageVariable.variable}'/{key} Nothing is working.
CodePudding user response:
Assuming you have a sage variable named bucketname
:
You can reference this variable in the integration request as follows:
Please note, we reference a stage variable as ${stageVariables.name}
, where the name is my case was bucketname
. You can also find some examples in the AWS documentation: https://docs.aws.amazon.com/apigateway/latest/developerguide/stage-variables.html