sceptre.hooks package¶
- class sceptre.hooks.Hook(argument=None, stack=None)[source]¶
Bases:
object
Hook is an abstract base class that should be inherited by all hooks.
- Parameters
argument (str) – The argument of the hook.
stack (sceptre.stack.Stack) – The associated stack of the hook.
- class sceptre.hooks.HookProperty(name)[source]¶
Bases:
object
This is a descriptor class used to store an attribute that may contain Hook objects. Used to setup Hooks when added as a attribute. Supports nested dictionary and lists.
- Parameters
name (str) – Attribute suffix used to store the property in the instance.
- sceptre.hooks.add_stack_hooks(func)[source]¶
A function decorator to trigger the before and after hooks, relative to the decorated function’s name. :param func: a function that operates on a stack :type func: function
- sceptre.hooks.execute_hooks(hooks)[source]¶
Searches through dictionary or list for Resolver objects and replaces them with the resolved value. Supports nested dictionaries and lists. Does not detect Resolver objects used as keys in dictionaries.
Submodules¶
sceptre.hooks.asg_scaling_processes module¶
- class sceptre.hooks.asg_scaling_processes.ASGScalingProcesses(*args, **kwargs)[source]¶
Bases:
Hook
Resumes or suspends autoscaling group scaling processes. This is useful as scheduled actions must be suspended when updating stacks with autoscaling groups.
- run()[source]¶
Either suspends or resumes any scaling processes on all autoscaling groups within the current stack.
- Raises
InvalidHookArgumentSyntaxError, when syntax is not using “::”.
- Raises
InvalidHookArgumentTypeError, if argument is not a string.
- Raises
InvalidHookArgumentValueError, if not using resume or suspend.