Search code examples
javaamazon-web-servicesamazon-elastic-beanstalkwarebextensions

Where to add .ebextensions in a WAR?


Scenario:

  • AWS Elastic Beanstalk
  • Java application
  • .ebextensions currently placed in src/main/resources/.ebextensions

Commands are not being executed.

Where is the .ebextensions supposed to go in a Java application?


Solution

  • .ebextensions should be placed in the root of WAR.

    The WAR structure looks like the following:

    web_app.war
              |
              |_.ebextensions
              |   |_ 01run.config
              |   |_ 02do.config
              |
              |_META-INF
              |
              |_WEB-INF
                   |_ classes
                   |_ lib
                   |_ web.xml
    

    Refer to the official AWS docs for further information.