0
votes

This is Driving me nuts. I had a working .ebextensions config file in my Project which was working fine. Recently my single instance failed and a new one got initiated. My configuration failed to run so i tried to troubleshoot what went wrong. I didn't find anything suspicious so i just created a new .config with a very simple command but it still fails!!

I validated my config file with an online yaml validator.

I Connected to the instance through remote desktop and saw that .ebextensions folder is actually created within the wwwroot and then it disappears meaning that it got successfully picked up by elastic beanstalk.

I also granted all permissions to everyone on the test folder just to make sure this is not the reason.

Whichever i tried the old configuration or this test command it just does not work and elastic beanstalk just ignores it!

Any info of what might be wrong is appreciated.

commands:
  01_Dowork:
    command: mkdir kakarot
    cwd: c:\\testdir
    waitForCompletion: 0

EbExtensions Permissions Ok

2

2 Answers

0
votes

I think everything under 01_DoWork needs to be indented (command, cwd, waitForCompletion). Also, make sure you're using spaces and not tabs.

Check the properties on your config file in VS. It should be (I think) both 'Content' and 'Copy if Newer'. Also, make sure that it gets packaged into the msdeploy package. It's a .zip file in/below your obj directory.

The command will error-out of it's already succeeded, so you would want to either ignore errors or add this. I found this syntax on another SO post but don't know who to credit for it :-/. The errorlevel will cause your command to not run if the directory already exists.

    test: test ! -d c:\\testdir\\kakarot
0
votes

If you're creating a package.zip (that inside has a deploy manifest json file plus the actual site.zip content) for a Windows deployment, it appears the .ebextensions directory needs to be inside package.zip, alongside the manifest json, not inside the site.zip, contrary to the current documentation.