简体   繁体   English

有没有办法从Serverless内部的CodeCommit读取环境变量?

[英]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.

相关问题 AWS Codecommit忽略环境变量 - AWS Codecommit Ignores environment variables 在无服务器 lambda function 中使用来自其他堆栈的资源作为环境变量 - Use resources from other stack as environment variables in serverless lambda function Runway X 无服务器框架:使用 CICD 的跑道通过无服务器仪表板的环境变量进行部署 - Runway X Serverless Framework: Using runway for CICD to deploy with environment variables from serverless dashboard 有没有办法在 CodeCommit 存储库中搜索代码? - Is there any way to search for code inside CodeCommit repositories? 有没有办法从现有的 aws 环境生成 serverless.yml? - Is there a way to generate serverless.yml from existent aws environment? 有没有办法从AWS Codecommit强制删除分支 - Is there a way to force delete branch from aws codecommit 如何读取docker容器内的系统环境变量 - How to read system environment variables inside docker container 有没有简单的方法可以将存储库片段从CodeCommit复制到S3? - Is there a simple way to copy a repository fragment from CodeCommit to S3? 从Procfile读取Amazon Elastic Beanstalk环境的变量 - Read variables of Amazon Elastic Beanstalk environment from the Procfile 从CodeBuild克隆CodeCommit - Clone CodeCommit from CodeBuild
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM