I created a config file with this content:
container_commands: 01-command: command: pecl install mongo ignoreErrors: true
And it worked. But I think that every time I deploy a new version to my environment it executes the command again, and re-installs the extension.
My question is: how can I create a sh file to test if the pecl extension is already installed? and add that file in the key "test" as mentioned here http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-commands