Where should AWS EB environment configuration files go?

后端 未结 1 516
走了就别回头了
走了就别回头了 2021-01-06 05:49

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

相关标签:
1条回答
  • 2021-01-06 06:06

    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.

    0 讨论(0)
提交回复
热议问题