wkhatch
wkhatch

Reputation: 2741

aws elastic beanstalk; how to move a file within my app root using .ebextensions

I'm trying to move a file located within my app directory:

{MyAppRoot}/.aws_scripts/eb_config.js

to

{MyAppRoot}/config.js.

I need this mv or cp to happen before the app is actually restarted, as this files presence is required immediately by the main app module. I've tried using .ebextensions various mechanisms like commands, container_commands, etc but all fail, with either no stat, or permission denied. I'm unable to get further details from eb_activity.log or any of the other log files. I came across this similar question on the aws forums but I'm not able to achieve any success.

What's the proper way to accomplish this? Thanks.

Upvotes: 1

Views: 1357

Answers (1)

Gustaf
Gustaf

Reputation: 1349

In commandsyour project specific files are not set up yet.

In container_commands they files are in a temporary staging location, but current path is that staging directory. The following should work:

container_commands:
    cp .aws_scripts/eb_config.js config.js.

Upvotes: 5

Related Questions