I am using serverless
to deploy an Appsync API and a few lambda functions. This plugin https://github.com/sid88in/serverless-appsync-plugin is used to deploy Appsync. The lambda and Appsync are defined in the same serverless.yml
file and they are deployed altogether.
My lambda needs to know the Appsync API endpoint which is created during sls deploy
. How can I reference the Appsync endpoint as environment variable to my lambda?
my serverless.yml
:
function:
myHandler:
handler: src/lambdas.myHandler
name: myHandler
environment:
ENDPOINT: # HERE, how can I get appsync endpoint url?
custom:
appSync:
name: ${self:provider.stackName}
...