sceptre.resolvers package

exception sceptre.resolvers.RecursiveGet[source]

Bases: exceptions.Exception

class sceptre.resolvers.ResolvableProperty(name)[source]

Bases: object

This is a descriptor class used to store an attribute that may contain Resolver objects. When retrieving the dictionary or list, any Resolver objects contains are a value or within a list are resolved to a primitive type. Supports nested dictionary and lists.

Parameters:name (str) – Attribute suffix used to store the property in the instance.
class ResolveLater(instance, name, key, resolution_function)[source]

Bases: object

Represents a value that could not yet be resolved but can be resolved in the future.

class sceptre.resolvers.Resolver(argument=None, stack=None)[source]

Bases: object

Resolver is an abstract base class that should be inherited by all Resolvers.

Parameters:
  • argument (str) – The argument of the resolver.
  • stack (sceptre.stack.Stack) – The associated stack of the resolver.
resolve()[source]

An abstract method which must be overwritten by all inheriting classes. This method is called to retrieve the final desired value. Implementation of this method in subclasses must return a suitable object or primitive type.

setup()[source]

This method is called at during stack initialisation. Implementation of this method in subclasses can be used to do any initial setup of the object.

Submodules

sceptre.resolvers.environment_variable module

class sceptre.resolvers.environment_variable.EnvironmentVariable(*args, **kwargs)[source]

Bases: sceptre.resolvers.Resolver

Resolver for shell environment variables.

Parameters:argument (str) – Name of the environment variable to return.
resolve()[source]

Retrieves the value of a named environment variable.

Returns:Value of the environment variable.
Return type:str

sceptre.resolvers.file_contents module

class sceptre.resolvers.file_contents.FileContents(*args, **kwargs)[source]

Bases: sceptre.resolvers.Resolver

Resolver for the contents of a file.

Parameters:argument (str) – Absolute path to file.
resolve()[source]

Retrieves the contents of a file at a given absolute file path.

Returns:Contents of file.
Return type:str

sceptre.resolvers.stack_output module

class sceptre.resolvers.stack_output.StackOutput(*args, **kwargs)[source]

Bases: sceptre.resolvers.stack_output.StackOutputBase

Resolver for retrieving the value of a Stack output within the current Sceptre StackGroup. Adds the target Stack to the dependencies of the Stack using the Resolver.

Parameters:argument (str in the format "<stack name>::<output key>") – The Stack name and output name to get.
resolve()[source]

Retrieves the value of an output of an internal Stack.

Returns:The value of the Stack output.
Return type:str
setup()[source]

Adds dependency to a Stack.

class sceptre.resolvers.stack_output.StackOutputBase(*args, **kwargs)[source]

Bases: sceptre.resolvers.Resolver

A abstract base class which provides methods for getting Stack outputs.

class sceptre.resolvers.stack_output.StackOutputExternal(*args, **kwargs)[source]

Bases: sceptre.resolvers.stack_output.StackOutputBase

Resolver for retrieving the value of an output of any Stack within the current Sceptre stack_group’s account and region.

Parameters:argument (str in the format "<full stack name>::<output key>") – The Stack name and output name to get.
resolve()[source]

Retrieves the value of CloudFormation output of the external Stack

Returns:The value of the Stack output.
Return type:str