Generate config files from AWS Secrets
Project description
sprinkles
Sprinkles makes it easy to share configuration files between local dev environments without leaking private information. No more passwords in Slack PMs, no more API keys in VCS.
Installation
pip install sprinkles-config
Please note that sprinkles has only been tested for Python versions >= 3.6.
Usage
Sprinkles reads secrets from AWS secrets manager, and binds them to a template you provide. The templating is based on Jinja2¹, making it flexible enough to work with any text-based configuration format you may be using. Anything from .env files, to Java properties, to yaml.
It has a simple param based CLI API, but can also be executed against a config file to encourage reuse. The config format is TOML-based².
NOTE: Sprinkles will use the AWS profile/credentials configured in the calling shell context, using the standard environment variables³.
CLI
- Output config to stdout
third.party.api.endpoint=https://example.com/api/v1
third.party.api.key={{THIRD_PARTY_API_KEY}}
sprinkles --template application.properties.j2 --secret-arn arn:aws:secretsmanager:<region>:<account-id-number>:secret:<secret-name>
- Output to file
sprinkles --template application.properties.j2 --secret-arn arn:aws:secretsmanager:<region>:<account-id-number>:secret:<secret-name> --output application.properties
Config file option
Sprinkles also makes it possible to have a set of defaults (tracked in VCS).
Add a .sprinklesrc file in your project root. Simply run sprinkles
in the
project root to initialize the config.
.sprinklesrc
[secret]
arn = "arn:aws:secretsmanager:<region>:<account-id-number>:secret:<secret-name>"
[files]
[files.docker-env]
template = "sprinkles-templates/.env.sprinkles"
target = ".env"
[files.application-properties]
template = "sprinkles-templates/application.properties.sprinkles"
target = "src/main/com/example/resources/application-dev.properties"
References
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sprinkles_config-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42201f7a5d526d112b386d0314a6746a79c01d62629bf812cfd4670c9509832e |
|
MD5 | 9ccebe6fe445085c02547e486c11ab56 |
|
BLAKE2b-256 | db2e12b6a1e81b615ad674e2baa514971061eeb70f704e9599815bc9b378f720 |