Reputation: 1704
I have the following config file:
packages:
yum:
at: []
01_remove_old_cron_jobs:
command: "sudo cp enable_mod_pagespeed.conf /etc/httpd/conf.d"
02_remove_old_cron_jobs:
command: "sudo rpm -U -iv --replacepkgs mod-pagespeed.rpm"
03_remove_old_cron_jobs:
command: "sudo touch /var/cache/mod_pagespeed/cache.flush"
Labeled 01.config
. When I deploy this to my server, I get an error such as:
Error processing file (Skipping): '.ebextensions/01.config' - Contains invalid key: '02_remove_old_cron_jobs'. For information about valid keys, see http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions.html
However, the documentation contains no information about valid keys, and this key looks similar to my other keys.
Upvotes: 3
Views: 4333
Reputation: 13
you config file is not formatted correctly:
packages:
yum:
at: []
commands: <----- MISSING HERE -------------------------------------------X
01_remove_old_cron_jobs:
command: "sudo cp enable_mod_pagespeed.conf /etc/httpd/conf.d"
02_remove_old_cron_jobs:
command: "sudo rpm -U -iv --replacepkgs mod-pagespeed.rpm"
03_remove_old_cron_jobs:
command: "sudo touch /var/cache/mod_pagespeed/cache.flush"
Upvotes: 1
Reputation: 7708
The configuration files keys are specified in this page: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html
Configuration files support the following keys that affect the Linux server your application runs on.
Keys:
- Packages
- Groups
- Users
- Sources
- Files
- Commands
- Services
- Container Commands
Keys are processed in the order that they are listed above.
So, in your case, you have to write your commands inside a commands
key. Your file will look like that:
commands:
01_remove_old_cron_jobs:
command: "sudo cp enable_mod_pagespeed.conf /etc/httpd/conf.d"
02_remove_old_cron_jobs:
command: "sudo rpm -U -iv --replacepkgs mod-pagespeed.rpm"
03_remove_old_cron_jobs:
command: "sudo touch /var/cache/mod_pagespeed/cache.flush"
The complete syntax for commands you can find here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#linux-commands
Upvotes: 2