Setting NODE_ENV variable in elasticbeanstalk

后端 未结 2 1019
醉话见心
醉话见心 2021-02-19 19:43

I\'ve created a file called .elasticbeanstalk/environment.config with the following in it:

option_settings:
  - option_name: NODE_ENV
    value:         


        
2条回答
  •  梦毁少年i
    2021-02-19 20:28

    Other ways to set environment variables in elastic beanstalk are -

    1. Create a config file in .ebextensions directory like environmentalvar.config and define variables in option_settings and include this file into application bundle. (Aws Documentation)

      example -

      option_settings:
           aws:elasticbeanstalk:application:environment:
             NODE_ENV: production
      
    2. By using elastic beanstalk command line tool. Command for set variable-

      eb setenv VAR_NAME=VAR_VALUE

提交回复
热议问题