README.md

# Aws Config Provider
[![Hex pm](http://img.shields.io/hexpm/v/ext_config_provider.svg?style=flat)](https://hex.pm/packages/ext_config_provider) [![Hex Docs](https://img.shields.io/badge/hex-docs-9768d1.svg)](https://hexdocs.pm/ext_config_provider) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
-----

Flexible Config Provider for e.g. AWS Parameter Store/Secrets Manager

Fetch your configuration at the start of the application from AWS Parameter Store
or the Secrets Manager. The format of your secrets can be json/toml or any other format. There's also flexibility in how the secrets are applied to your config.

## Installation

The package can be installed by adding `ext_config_provider` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:ext_config_provider, "~> 1.0.1"}
  ]
end
```

The AWS Parameter Store/Secrets Manager are packaged config providers. They need ExAws to be configured and have the right IAM permissions to work.

## Adding a config provider

```elixir
  def project do
    [
      app: :example,
      ...
      releases: [
        example: [
          config_providers: [{ExtConfigProvider, [path: "parameter_name"]}]
        ]
      ]
    ]
  end
```

The config provider can take several options. See `ExtConfigProvider.init/1`

A macro can also be used to build a config provider

```elixir
  defmodule Example.ConfigProvider do
    use ExtConfigProvider,
      parser: ExtConfigProvider.Parser.String,
      transformer: ExtConfigProvider.Transformer.Value,
      merge_strategy: ExtConfigProvider.MergeStrategy.Path,
      config_path: [:app, :secret]
  end
```
You can add this config provider in the usual fashion:

```elixir
  releases: [
    example: [
      config_providers: [{Example.ConfigProvider, [path: "parameter_name"]}]
    ]
  ]
```

Inspired by https://github.com/christopherlai/secrets_manager_provider

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/ext_config_provider](https://hexdocs.pm/ext_config_provider).

OSZAR »