Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
derekmckinnon committed Jun 25, 2023
1 parent 0792003 commit c9ea587
Showing 1 changed file with 59 additions and 1 deletion.
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,62 @@
# AWS AppConfig Configuration Provider for .NET

TODO
An opinionated [.NET Configuration Provider](https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration-providers)
for AWS AppConfig that wraps [Amazon.Extensions.Configuration.SystemsManager](https://www.nuget.org/packages/Amazon.Extensions.Configuration.SystemsManager/).

## Usage

First, download the provider from NuGet:

```shell
dotnet add package CatConsult.AppConfigConfigurationProvider
```

Then add the provider using the `AddAppConfig` extension method:

```csharp
builder.Configuration.AddAppConfig();
```

By default, the provider will look for a configuration section named `AppConfig`.
This can be overriden by specifying a different section name:

```csharp
builder.Configuration.AddAppConfig("MyCustomName");
```

## Configuration

The provider requires some minimal configuration in order for it to know which AppConfig profiles to load:

```json
{
"AppConfig": {
"Profiles": [
"abc1234:def5678:ghi9123",
"q2w3e25:po92j45:bt9s090:300"
]
}
}
```

As you can see in the example above, the AppConfig metadata are encoded as a formatted string:

```
ApplicationId:EnvironmentId:ProfileId[:ReloadAfter]
```

`ReloadAfter` is an optional 4th parameter that configures the reload/refresh period.
It is an integer that represents time in seconds.
If not specified, it defaults to the provider's default setting, which is 30 seconds.

The default `ReloadAfter` setting can be overridden as well:

```json
{
"AppConfig": {
"Defaults": {
"ReloadAfter": 90
}
}
}
```

0 comments on commit c9ea587

Please sign in to comment.