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

About

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

Resources

Code of conduct

Contributing

Stars

2 stars

Watchers

4 watching

Forks

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

Code of conduct

Contributing

Stars

2 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages