runway.cfngin.blueprints.variables.types module

CFNgin blueprint variable types.

class runway.cfngin.blueprints.variables.types.TroposphereType(defined_type, many=False, optional=False, validate=True)[source]

Bases: object

Represents a Troposphere type.

Troposphere will convert the value provided to the variable to the specified Troposphere type.

Both resource and parameter classes (which are just used to configure other resources) are acceptable as configuration values.

Complete resource definitions must be dictionaries, with the keys identifying the resource titles, and the values being used as the constructor parameters.

Parameter classes can be defined as dictionary or a list of dictionaries. In either case, the keys and values will be used directly as constructor parameters.

Instantiate class.

Parameters
  • defined_type (Any) – Troposphere type

  • many (bool) – Whether or not multiple resources can be constructed. If the defined type is a resource, multiple resources can be passed as a dictionary of dictionaries. If it is a parameter class, multiple resources are passed as a list.

  • optional (bool) – Whether an undefined/null configured value is acceptable. In that case a value of None will be passed to the template, even if many is enabled.

  • validate (bool) – Whether to validate the generated object on creation. Should be left enabled unless the object will be augmented with mandatory parameters in the template code, such that it must be validated at a later point.

property resource_name

Name of the type or resource.

create(value)[source]

Create the troposphere type from the value.

Parameters

value (Union[Dict[str, Any], List[Dict[str, Any]]]) – A dictionary or list of dictionaries (see class documentation for details) to use as parameters to create the Troposphere type instance. Each dictionary will be passed to the from_dict method of the type.

Returns

Returns the value converted to the troposphere type.

Return type

Any

class runway.cfngin.blueprints.variables.types.CFNType(parameter_type)[source]

Bases: object

Represents a CloudFormation Parameter Type.

CFNType can be used as the type for a Blueprint variable. Unlike other variables, a variable with type: CFNType, will be submitted to CloudFormation as a Parameter.

Instantiate class.

Parameters

parameter_type (str) – An AWS specific parameter type (http://goo.gl/PthovJ)