[英]Is there a way to read environment variables from CodeCommit inside Serverless?
I have a serverless.yml file where I need to expose some variables for Lambda. 我有一个serverless.yml文件,需要在其中显示Lambda的一些变量。 These are environment variables declared within CodeCommit on AWS. 这些是在AWS的CodeCommit中声明的环境变量。
functions:
graphql:
handler: handler.test
environment:
DB_HOST: ${environment.DB_HOST}
I'm not sure how exactly to get the DB_HOST from the set environment variables. 我不确定如何从设置的环境变量中获取DB_HOST。 It's stored as Plaintext. 它存储为纯文本。
Thanks. 谢谢。
You are close. 你近了 Try ${env:DB_HOST}
. 尝试${env:DB_HOST}
。
Relevant documentation: Referencing Environment Variables . 相关文档: 参考环境变量 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.