sceptre.cli package


This module implements Sceptre’s CLI, and should not be directly imported.


sceptre.cli.create module

sceptre.cli.delete module

sceptre.cli.describe module

sceptre.cli.execute module

sceptre.cli.helpers module

class sceptre.cli.helpers.CfnYamlLoader(stream)[source]

Bases: yaml.loader.SafeLoader

yaml_multi_constructors = {'!': <function _tag_constructor>}
class sceptre.cli.helpers.ColouredFormatter(fmt=None, datefmt=None, style='%', validate=True)[source]

Bases: logging.Formatter

ColouredFormatter add colours to all stack statuses that appear in log messages.


Colours and returns all stack statuses in record.

Parameters:record (str) – The log item to format.
stack_status_colourer = <sceptre.stack_status_colourer.StackStatusColourer object>
class sceptre.cli.helpers.CustomJsonEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

CustomJsonEncoder is a JSONEncoder which encodes all items as JSON by calling their __str__() method.


Returns stringified version of item.

Parameters:item (object) – An arbitrary object to stringify.
Returns:The stringified object.
Return type:str

Catches and simplifies expected errors thrown by sceptre.

catch_exceptions should be used as a decorator.

Parameters:func – The function which may throw exceptions which should be simplified.
Returns:The decorated function.
sceptre.cli.helpers.confirmation(command, ignore, command_path, change_set=None)[source]
sceptre.cli.helpers.setup_logging(debug, no_colour)[source]

Sets up logging.

By default, the python logging module is configured to push logs to stdout as long as their level is at least INFO. The log format is set to “[%(asctime)s] - %(name)s - %(message)s” and the date format is set to “%Y-%m-%d %H:%M:%S”.

After this function has run, modules should:

import logging

logging.getLogger(__name__).info("my log message")
Parameters:debug (bool) – A flag indication whether to turn on debug logging.
No_colour:A flag to indicating whether to turn off coloured output.
Returns:A logger.
Return type:logging.Logger

Simplies the response from the AWS describe change set API.

Parameters:response (dict) – The original api response.
Returns:A more concise description of the change set.
Return type:dict
sceptre.cli.helpers.write(var, output_format='json', no_colour=True)[source]

Writes var to stdout. If output_format is set to “json” or “yaml”, write var as a JSON or YAML string.

  • var (object) – The object to print
  • output_format (str) – The format to print the output as. Allowed values: “text”, “json”, “yaml”
  • no_colour (bool) – Whether to colour stack statuses

sceptre.cli.launch module

sceptre.cli.list module module

sceptre.cli.policy module

sceptre.cli.status module

sceptre.cli.template module

sceptre.cli.update module