Giter Site home page Giter Site logo

sprinkles's Introduction

PyPI version

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

  1. 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>
  1. 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

  1. Jinja2: https://jinja.palletsprojects.com/en/2.11.x/
  2. TOML: https://github.com/toml-lang/toml
  3. AWS Configuration: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html

sprinkles's People

Contributors

okal avatar

Stargazers

Roman avatar

Watchers

 avatar James Cloos avatar Schambach avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.