Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maartenvanvliet/ext_config_provider
Flexible Config Provider for e.g. AWS Parameter Store/Secrets Manager
https://github.com/maartenvanvliet/ext_config_provider
Last synced: 28 days ago
JSON representation
Flexible Config Provider for e.g. AWS Parameter Store/Secrets Manager
- Host: GitHub
- URL: https://github.com/maartenvanvliet/ext_config_provider
- Owner: maartenvanvliet
- License: mit
- Created: 2019-10-12T11:06:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T04:57:25.000Z (almost 2 years ago)
- Last Synced: 2024-04-24T20:13:53.227Z (8 months ago)
- Language: Elixir
- Size: 60.5 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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).