12

I'm trying to run a custom .config file on my elastic beanstalk. I'm following the directions on this link. I've created a file called myapp.config, and put the following in it:

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

When I run this, I get the following error:

"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.

This error is really cryptic. What am I doing wrong?

My container is apache tomcat 7.

2 Answers 2

24

Got the answer. Apparently whitespace is important. I changed:

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

to:

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

and now it works.

1
  • 2
    Spaces are important in YAML.
    – PachinSV
    Mar 24, 2015 at 5:00
1

The config file formats can be either yaml or json. Your original config was of yaml style but non-conformant. That is why fixing white space (which is making it yaml compliant) fixed your config. If you are writing your config in yaml, you can run it through a yaml parser to check if it is compliant.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.