I read a lot of other answers but with no success, my goal is to load different properties reading environment name.
I have this structure
.ebextensions/properties/test_properties
.ebextensions/properties/prod_properties
and I would move and rename one of these file in .ebextensions to be load after changing extension in ".config"
I have this 00_environment.config in .ebextensions with
option_settings:
aws:elasticbeanstalk:application:environment:
MYENV: '`{ "Ref" : "AWSEBEnvironmentName" }`' # get the current environment name
files:
".ebextensions/move.sh":
mode: "000755"
owner: root
group: root
container_commands:
01_mycommand:
command: .ebextensions/move.sh
test: '[[ $MYENV = "env-test" ]]'
Move.sh (into folder .ebextensions)
mv properties/test_properties test_properties.config
Logs in eb-activity.log
[2020-01-02T11:40:52.984Z] INFO [10053] - [Application update awscodestar--15zqrpf3jh1dc@114/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_2_mysoft_test/Command 01_mycommand] : Activity execution failed, because: /bin/sh: .ebextensions/move.sh: Permission denied
(ElasticBeanstalk::ExternalInvocationError)