The location and behavior of files used to set AWS Elastic Beanstalk environment properties (e.g. static directory mappings or environment variables) seems to have changed s
You can set any option setting using ebextensions. This will work whether you deploy your code using the api, web console, or CLI.
Create a folder in your project root with the name .ebextensions
and in that folder, place a file .config
(the dots are important). Then put in your contents:
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: SOME_PUBLIC_CONFIG
value: "true"
You then need deploy your new application version. Using the CLI you would need to check this into git (if using git), then use eb deploy
.
As far as the differences between this and the .elasticbeanstalk/optionsettings files:
The CLI 3.X no longer uses optionsettings files as they often overrode the settings in the ebextensions. The optionsettings files had a higher precedence then the ebextensions, so if you ever set anything in the optionsettings file, it would no longer work if changed in ebextensions. Ebextensions are a service-wide feature which means they always work no matter what client you are using. Optionsettings files were a CLI specific feature, which made life really confusing for those using multiple clients. As such, 3.x doesnt use optionsettings files.