【问题标题】:Running a .config file on Elastic Beanstalk?在 Elastic Beanstalk 上运行 .config 文件?
【发布时间】:2014-06-02 15:02:15
【问题描述】:

我正在尝试在我的弹性 beantalk 上运行自定义 .config 文件。我正在按照this link 上的指示进行操作。我创建了一个名为myapp.config 的文件,并将以下内容放入其中:

container_commands:
        01_setup_apache:
        command: "cp .ebextensions/enable_mod_deflate.conf /etc/httpd/conf.d/enable_mod_deflate.conf"

当我运行它时,我收到以下错误:

应用程序版本 myapp-0.0.33-SNAPSHOT 中配置文件 .ebextensions/myapp.config 中的“命令”必须是映射。更新配置文件中的“命令”。

这个错误真的很神秘。我做错了什么?

我的容器是 apache tomcat 7。

【问题讨论】:

    标签: amazon-web-services yaml amazon-elastic-beanstalk


    【解决方案1】:

    配置文件格式可以是 yamljson。您的原始配置是 yaml 样式但不符合要求。这就是为什么fixing white space(这使它符合yaml)修复了你的配置。如果您使用 yaml 编写配置,则可以通过 yaml 解析器运行它以检查它是否兼容。

    【讨论】:

      【解决方案2】:

      得到了答案。显然空格很重要。我改变了:

      container_commands:
              01_setup_apache:
              command: "cp .ebextensions/enable_mod_deflate.conf 
      /etc/httpd/conf.d/enable_mod_deflate.conf"
      

      到:

      container_commands:
              01_setup_apache:
                  command: "cp .ebextensions/enable_mod_deflate.conf /etc/httpd/conf.d/enable_mod_deflate.conf"
      

      现在它可以工作了。

      【讨论】:

      • 空格在 YAML 中很重要。
      猜你喜欢
      • 2017-04-11
      • 2017-09-24
      • 2013-08-15
      • 1970-01-01
      • 2019-03-14
      • 2014-12-26
      • 2015-06-18
      • 2012-07-05
      • 2015-01-07
      相关资源
      最近更新 更多