Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

[DEPRECATED] Provides a mechanism for .NET Core applications to retrieve the values of its ElasticBeanstalk's Environment Properties.

License

Notifications You must be signed in to change notification settings

RockLib/Deprecated.RockLib.ElasticBeanstalk

Repository files navigation

AWS now supports retrieving the values of Environment Properties for .NET Core applications. Environment Variables with .NET Core and Elastic Beanstalk

[DEPRECATED] RockLib.ElasticBeanstalk Build status

PM> Install-Package RockLib.ElasticBeanstalk

Elastic Beanstalk does not provide a mechanism for .NET Core applications to retrieve the values of its Environment Properties. The RockLib.ElasticBeanstalk package implements a workaround that maps Environment Properties to the current process's environment variables.

Call the EnvironmentProperties.MapToEnvironmentVariables method at the very beginning of your application. In ASP.NET Core applications, it is important to do this before creating the IWebHost, since the default configuration reads environment variables.

using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using RockLib.ElasticBeanstalk

class Program
{
    static void Main(string[] args)
    {
        EnvironmentProperties.MapToEnvironmentVariables();
        
        BuildWebHost(args).Run();
    }

    public static IWebHost BuildWebHost(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .UseStartup<Startup>()
            .Build();
}

About

[DEPRECATED] Provides a mechanism for .NET Core applications to retrieve the values of its ElasticBeanstalk's Environment Properties.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Languages