Node.js 节点64位&;的Amazon Elastic Beanstalk.config;环境

Node.js 节点64位&;的Amazon Elastic Beanstalk.config;环境,node.js,amazon-web-services,amazon-elastic-beanstalk,Node.js,Amazon Web Services,Amazon Elastic Beanstalk,下面是我的EB配置文件的摘录。ebextensions/app.config: option_settings: - option_name: AWS_SECRET_KEY value: xxxxxxxxxx - option_name: AWS_ACCESS_KEY_ID value: xxxxxxxxxx - option_name: APP_ENV value: development - namespace: aws:elasticbeanstal

下面是我的EB配置文件
的摘录。ebextensions/app.config

option_settings:
  - option_name: AWS_SECRET_KEY
    value: xxxxxxxxxx
  - option_name: AWS_ACCESS_KEY_ID
    value: xxxxxxxxxx
  - option_name: APP_ENV
    value: development
  - namespace: aws:elasticbeanstalk:container:nodejs
    option_name: ProxyServer
    value: nginx
  - namespace: aws:elasticbeanstalk:container:nodejs
    option_name: GzipCompression
    value: true
  - namespace: aws:elasticbeanstalk:container:nodejs
    option_name: NodeVersion
    value: 0.8.10
  - namespace: aws:elasticbeanstalk:container:nodejs
    option_name: NodeCommand
    value: npm start

commands:
  test_command: 
    command: echo $APPLICATION_ENV > /home/ec2-user/test.txt
    cwd: /home/ec2-user
    ignoreErrors: true
然后我做正常的事情:

$ git commit -am "wrote config file"
$ eb init
...
$ eb start
...
would you like to use the most recent commit [y/n] 
$ y
然后在部署完成并处于绿色状态后,查看生成的
eb
文件
.elasticbeansalk/optionsettings.myapp env
找到:

[aws:elasticbeanstalk:application:environment]
PARAM1=
PARAM2=
PARAM3=
PARAM4=
PARAM5=

[aws:elasticbeanstalk:container:nodejs]
GzipCompression=false
NodeCommand=
NodeVersion=0.8.24
ProxyServer=nginx
未设置我的环境变量,未设置
NodeCommand
指令,并且已忽略
NodeVersion
。埃布,你有什么好处?它怎么能忽略某些指令而不忽略其他指令?你知道我做错了什么吗


编辑

根据,保存环境变量的JSON保存在这里:

/opt/elasticbeanstalk/deploy/configuration/containerconfiguration

这意味着我可以为变量解析这个域,但这很令人沮丧,因为它应该由配置文件处理(否则为什么要有配置文件?)。我的配置文件肯定还有问题,否则EB在这方面似乎完全崩溃了…

我也遇到了这个问题。我相信有两种方法可以解决这个问题

  • 运行“eb update”这将更新您的环境,并有望获取变量

  • 创建一个新的env并将代码部署到该环境中。一切正常后,将dns指向新环境并删除旧环境


  • 此外,我在某个地方(我相信是aws论坛)读到,如果在elastic beanstalk gui界面中更新env,那么这些值将优先于您在源代码中输入的任何内容。

    我遇到了同样的问题:(您找到解决方案了吗?