$ 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.
$ 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>
$ 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')
# Create YourApp's config
config = YourApp()
# Export to JSON
config.export_parameters('example.json')
config = YourApp()
# Print a specific parameter
print(config.APP_URL)
# Print a dictionary of your parameters
print(config.parameters)