Kaushik Das
Kaushik Das

Reputation: 83

How can stage variable be added in Integration Path override api gateway

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 enter image description here

instead of bucket/{key} want to use stageVariable.variable/{key}. I have tried using ${stageVariable.variable}/{key},'${stageVariable.variable}'/{key} Nothing is working.

Upvotes: 0

Views: 1017

Answers (1)

Ervin Szilagyi
Ervin Szilagyi

Reputation: 16775

Assuming you have a sage variable named bucketname:

enter image description here

You can reference this variable in the integration request as follows:

enter image description here

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

Upvotes: 1

Related Questions