2014-04-18 66 views
7

我想在彈性豆莖上運行一個自定義的.config文件。我遵循this link的指示。我創建了一個名爲myapp.config文件,並把它下面:在Elastic Beanstalk上運行.config文件?

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

當我運行它,我得到以下錯誤:

"commands" in configuration file .ebextensions/myapp.config in application version myapp-0.0.33-SNAPSHOT must be a map. Update "commands" in the configuration file.

這種錯誤實在是難以理解。我究竟做錯了什麼?

我的容器是apache tomcat 7.

回答

14

得到了答案。顯然空白是重要的。我改變:

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" 

,現在它的工作原理。

+2

空間在YAML中很重要。 – PachinSV

0

配置文件格式可以是yamljson。您的原始配置是yaml風格但不符合。這就是爲什麼修復空白(這使它符合yaml)固定您的配置。如果你正在yaml中編寫你的配置文件,你可以通過yaml解析器運行它來檢查它是否符合規範。

相關問題