Hi,
I’m using serverless-dotenv-plugin
to manage the environment variables globally in monorepo. It’s working good in lambdas, but when I want to refer environment in the serverless.yml it’s not working.
httpApi:
id: ${API_GATEWAY_ID}
I also tried
httpApi:
id: ${env:API_GATEWAY_ID}
both seems not working
API_GATEWAY_ID is defined in .env file
Another problem I wrote all the routes in the external file and included in in serverless.yml
functions:
- ${file(./src/route.yml)}
and in the route.yml I’m trying to refer env variable, but thats also throwing error
tenantUpdate:
handler: src/handler.update
events:
- httpApi:
path: /tenants/{id}
method: patch
authorizer:
type: request
id:
Ref: ${TOKEN_AUTHORIZER_ID}
Getting error
The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [${TOKEN_AUTHORIZER_ID}] in the Resources block of the template
Please advice me