Skip to content

AWS Systems Manager Parameter Store configuration provider implementation for Microsoft.Extensions.Configuration.

License

Notifications You must be signed in to change notification settings

hossambarakat/AwsParameterStore.Microsoft.Extensions.Configuration

Repository files navigation

AwsParameterStore.Microsoft.Extensions.Configuration

Build Status

AWS Systems Manager Parameter Store configuration provider implementation for Microsoft.Extensions.Configuration.

Getting Started

You should install AwsParameterStore.Microsoft.Extensions.Configuration with NuGet:

Install-Package AwsParameterStore.Microsoft.Extensions.Configuration

Or via the .NET Core command line interface:

dotnet add package AwsParameterStore.Microsoft.Extensions.Configuration

The provider is added to the ConfigurationBuilder using the AddAwsParameterStore extension. The default method accepts one parameter path which is the prefix of the parameter store hierarchy.

    configrationBuilder.AddAwsParameterStore("/prefix");

Hierarchical Parameters Names Mapping

Parameter Store supports parameter hierarchy. The Hierarchical values use "/" as a separator such as "/DeploymentConfig/Prod/FleetHealth". ASP.NET Core configuration normally uses colon as separator so before adding the values to the configuration we swap the forward slash "/" with colon.

Credentials

By default, AWS Access Key ID and AWS Secret Access Key are discovered from environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY respectively.

Required Permissions

An AWS IAM account with ssm:GetParametersByPath permission.

Reloading secrets

Secrets are cached until IConfigurationRoot.Reload() is called. Expired, disabled, and updated secrets in the key vault are not respected by the application until Reload is executed.

    Configuration.Reload();

Additional resources

About

AWS Systems Manager Parameter Store configuration provider implementation for Microsoft.Extensions.Configuration.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published