Skip to content

Confectionary confetti to confine those confounded configurations confidently

Notifications You must be signed in to change notification settings

AmberEngine/confectionary-confetti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Confetti

Confectionary confetti to confine those confounded configurations confidently

Install in your application

$ pip install boto3
$ pip install git+ssh://[email protected]/AmberEngine/confectionary-confetti.git#egg=confectionary-confetti

You need to install boto3 if it is not already installed. boto3 is not a listed package dependency of confetti.

On AWS Lambda functions boto3 is already present. To include it would result in exceeding the allowed size for lambda code.

It is easier to instead have projects install both confetti and boto3 manually.

Choose a path for the namespacing of your application's parameters.

$ export CONFETTI_PATH=/Your/Path

Optionally you can override this in the constructor's keyword arguments.

    config = Confetti(confetti_path='/Your/Path')

The default path will be constructed as /<confetti_key>/<confetti_app>

Choose a key. Your key will be part of the namespacing of your application's parameters.

$ export CONFETTI_KEY=YourKey

Optionally you can override this in the constructor's keyword arguments.

    config = Confetti(confetti_key='YourKey')

The default value will be 'Development' in either case.

Choose an app name. Your app name will be part of the default namespacing of your application's parameters.

$ export CONFETTI_APP=YourApp

Optionally you can override this in the constructor's keyword arguments.

    config = Confetti(confetti_app='YourApp')

The default value will be the class name in either case.

A boto3 session will be created from your AWS config and credentials or role or you can override the session.

    session = boto3.session.Session()
    config = Confetti(session=session)

As an alternative to using the AWS Systems Manager console, you can store parameters by importing from a JSON file.

see also: AWS Systems Manager Parameter Store

[{
    "Name": "APP_URL",
    "Description": "The URL",
    "Value": "http://www.mrcoolice.com/app",
    "Type": "String"
}, {
    "Name": "APP_KEY",
    "Description": "All my passwords and PINs in one parameter",
    "Value": "abcde12345",
    "Type": "SecureString"
}, {
    "Name": "THINGS",
    "Description": "All the things",
    "Value": "thing1, thing2",
    "Type": "StringList"
}]
    # Create YourApp's config
    config = YourApp()

    # Import from JSON
    config.import_parameters('example.json')

Or export parameters to a JSON file so you can modify in bulk.

    # Create YourApp's config
    config = YourApp()

    # Export to JSON
    config.export_parameters('example.json')

Use your parameters in your application

    config = YourApp()

    # Print a specific parameter
    print(config.APP_URL)

    # Print a dictionary of your parameters
    print(config.parameters)

Your Friendly Neighborhood Repository Owner

Jim Garner

Jim Garner

About

Confectionary confetti to confine those confounded configurations confidently

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages