s3vaultlib package

Submodules

s3vaultlib.cli module

s3vaultlib.cli.check_args()[source]

Check the args from the command line

Returns:args object
s3vaultlib.cli.configure_logging(level)[source]

Configure the logging level of the tool

Parameters:level – level to set
Returns:
s3vaultlib.cli.main()[source]

Command line tool to use some functionality of the S3Vault

Returns:
s3vaultlib.cli.validate_args(parser)[source]
Returns:

s3vaultlib.commands module

s3vaultlib.commands.is_ec2(args)[source]
s3vaultlib.commands.command_ansiblepath()[source]
s3vaultlib.commands.command_configedit(args, conn_manager)[source]
s3vaultlib.commands.command_configset(args, conn_manager)[source]
s3vaultlib.commands.command_createcloudformation(args)[source]
s3vaultlib.commands.command_createconfig(args)[source]
s3vaultlib.commands.command_createtoken(args, conn_manager)[source]
s3vaultlib.commands.command_get(args, conn_manager)[source]
s3vaultlib.commands.command_push(args, conn_manager)[source]
s3vaultlib.commands.command_template(args, conn_manager)[source]

s3vaultlib.s3vaultlib module

class s3vaultlib.s3vaultlib.S3Vault(bucket, path, connection_factory=None, is_ec2=False)[source]

Bases: object

Implements a Vault by using S3 as backend and KMS as way to protect the data

create_config_property(configfile, encryption_key_arn='', key_alias='', role_name='')[source]

Create a configuration file in the S3Vault

Parameters:
  • configfile – configuration file name
  • encryption_key_arn – KMS Arn to use
  • key_alias – KMS Alias to use
  • role_name – Role to use to resolve the KMS Key
Returns:

s3fsobject

Return type:

S3FsObject

get_file(name)[source]

Get a file from S3Vault

Parameters:name – filename
Returns:file content
Return type:basestring
get_file_metadata(name)[source]

Get a file from S3Vault

Parameters:name – filename
Returns:file content
Return type:dict
get_property(configfile, key)[source]

Get a configuration property from a config file from the S3Vault

Parameters:
  • configfile – configuration file
  • key – key to query
Returns:

value of the key

put_file(src, dest, encryption_key_arn='', key_alias='', role_name='')[source]

Upload a file to the S3Vault

Parameters:
  • src – source file name
  • dest – destination file name
  • encryption_key_arn – KMS Key arn to use
  • key_alias – KMS Key alias to use
  • role_name – Role from which resolve the key
Returns:

metadata of the uploaded object

Return type:

dict

render_template(template_file, **kwargs)[source]

Renders a template file using the information available in the S3Vault

Parameters:
  • template_file – file name to use as template
  • kwargs – additional variables to use in the rendering
Returns:

rendered content

Return type:

basestring

set_property(configfile, key, value, encryption_key_arn='', key_alias='', role_name='')[source]

Set a property in a configuration file in the S3Vault

Parameters:
  • configfile – configfile name
  • key – key
  • value – value
  • encryption_key_arn – KMS Key to use
  • key_alias – KMS alias to use
  • role_name – Role to use to resolve the KMS Key
Returns:

metadata of the config file created/updated

Return type:

basestring

exception s3vaultlib.s3vaultlib.S3VaultException[source]

Bases: exceptions.Exception

exception s3vaultlib.s3vaultlib.S3VaultObjectNotFoundException[source]

Bases: exceptions.Exception

Module contents

Top-level package for S3Vault Library.