简体   繁体   中英

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. These are environment variables declared within CodeCommit on AWS.

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. It's stored as Plaintext.

Thanks.

You are close. Try ${env:DB_HOST} .

Relevant documentation: Referencing Environment Variables .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM