How to replace AWS environmental variables with stage variables in API

Viewed 29

I have created two method findbyid and insertdata in my springboot application( findbyid method will fetch data from dynamodb while insertdata method will insert data into the database).And in spingboot application.property I have define spring.cloud.function.definiton=findbyid;insertdata but in AWS lambda in environmental variable I can only define one method at a time(either findbyid or insertdata but not at same time),I am stuck at that point, so for resolving this problem I have create API using AWS API gateway (in API gateway I have created two method get and post and both will going to execute by same lambda function) but in AWS environment variable suppose If I define findbyid method then only get API method will work and if I define insertdata then only post method will work but i want both get and post method should run with single lambda function without changing AWS environmental variable.So I have read in AWS documentation we can replace environment variable with Stage variable in API gateway.How we can do this stuff??? Here is the documentation link
docs.aws.amazon.com/apigateway/latest/developerguide/stage-variables.html

0 Answers
Related