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
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
File details
Details for the file sprinkles-config-0.1.3.tar.gz
.
File metadata
- Download URL: sprinkles-config-0.1.3.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.6.11 Darwin/19.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ae4ea4241fe21a4b6d3841e9971e83bf94c670fadfe09de05cbdcabff88734e |
|
MD5 | 679c4576dbf79fb8d060983901271704 |
|
BLAKE2b-256 | d79d05b2299c444bb1ab074bd478ae14721314fcbdc22be1d64b88c9f6098f39 |
File details
Details for the file sprinkles_config-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: sprinkles_config-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.10 CPython/3.6.11 Darwin/19.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e79ded0ded3ed7dff338a986fd61f4a2fd9f5e45c93f253574487d8c772b2d49 |
|
MD5 | 162e3a7624b04f0732c30d47a03ea9a0 |
|
BLAKE2b-256 | 13e0e729985f3ed0f1bbdeeb9b44b7314926effda1c2f39933fd1d48b19e1c73 |