AWS Elastic Beanstalk environment variables in ASP.NET Core 1.0

后端 未结 9 2021
误落风尘
误落风尘 2020-12-01 02:59

How do I get environment variables from elastic beanstalk into an asp.net core mvc application? I have added a .ebextensions folder with app.config file in it with the follo

9条回答
  •  佛祖请我去吃肉
    2020-12-01 03:34

    This can definitely be done in an .ebextensions folder. Simply create a new file in your .ebextensions folder (I used a name of "options.config"), mark it as "copy if newer" or "copy always" and make sure you use the option_settings header with a aws:elasticbeanstalk:application:environment namespace:

    option_settings:
      aws:elasticbeanstalk:application:environment:
        MyEnvVar: SomeValue
    

    EDIT: I forgot to include a link to the docs! https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-softwaresettings.html

提交回复
热议问题