aws-vapor¶
DSL¶
Template Root¶
Elements¶
-
class
aws_vapor.dsl.
Element
(name: str)[source]¶ This is an abstract base class of a template section.
-
class
aws_vapor.dsl.
Metadatum
(name: str)[source]¶ The Metadatum class is a subclass of
Element
, each instance of which represents details about the template.
-
class
aws_vapor.dsl.
Parameter
(name: str)[source]¶ The Parameter class is a subclass of
Element
, each instance of which passes values into your template when you create a stack.-
allowed_pattern
(pattern: str) → aws_vapor.dsl.Parameter[source]¶ Set ‘AllowedPattern’ to pattern and return self.
-
allowed_values
(list_of_values: List[Any]) → aws_vapor.dsl.Parameter[source]¶ Set ‘AllowedValues’ to list_of_values and return self.
-
constraint_description
(desc: str) → aws_vapor.dsl.Parameter[source]¶ Set ‘ConstraintDescription’ to desc and return self.
-
description
(desc: str) → aws_vapor.dsl.Parameter[source]¶ Set ‘Description’ to desc and return self.
-
-
class
aws_vapor.dsl.
Mapping
(name: str)[source]¶ The Mapping class is a subclass of
Element
, each instance of which matches a key to a corresponding set of named values.-
add_category
(category: str) → aws_vapor.dsl.Mapping[source]¶ Create a new top level section of ‘Mappings’ and return self.
Create a new top level section of ‘Mappings’ if doesn’t contain category, then set a current selection to category.
Parameters: category – A name of a top level section. Returns: self.
-
-
class
aws_vapor.dsl.
Condition
(name: str)[source]¶ The Condition class is a subclass of
Element
, each instance of which includes statements that define when a resource is created or when a property is defined.
-
class
aws_vapor.dsl.
Resource
(name: str)[source]¶ The Resource class is a subclass of
Element
, each instance of which declares the AWS resources that you want to include in the stack, such as an Amazon EC2 instance or an Amazon S3 bucket.-
add_property
(prop: Dict[str, Any]) → aws_vapor.dsl.Resource[source]¶ Add a new key-value pair to ‘Properties’ and return self.
-
condition
(condition: aws_vapor.dsl.Condition) → aws_vapor.dsl.Resource[source]¶ Set ‘Condition’ to condition and return self.
-
depends_on
(resource: aws_vapor.dsl.Resource) → aws_vapor.dsl.Resource[source]¶ Set ‘DependsOn’ to a name of resource and return self.
-
metadata
(metadata: Any) → aws_vapor.dsl.Resource[source]¶ Set ‘Metadata’ to metadata and return self.
-
Utilities¶
-
class
aws_vapor.dsl.
Intrinsics
[source]¶ -
-
classmethod
find_in_map
(map_name_or_mapping: Union[str, Mapping], top_level_key: str, second_level_key: str) → Dict[str, Any][source]¶
-
classmethod
-
class
aws_vapor.dsl.
UserData
[source]¶
-
class
aws_vapor.dsl.
CfnInitMetadata
[source]¶ -
-
class
Config
(name: str)[source]¶ -
commands
(key: str, command: str, env: Dict[str, Any] = None, cwd: str = None, test: str = None, ignore_errors: bool = None, wait_after_completion: int = None) → aws_vapor.dsl.CfnInitMetadata.Config[source]¶
-
files
(key: str, content: Union[str, Dict[str, Any]] = None, source: str = None, local_file_path: str = None, encoding: str = None, group: str = None, owner: str = None, mode: str = None, authentication: str = None, context: str = None, local_file_params: str = None) → aws_vapor.dsl.CfnInitMetadata.Config[source]¶
-
packages
(package_manager: str, key: str, versions: List[str] = None) → aws_vapor.dsl.CfnInitMetadata.Config[source]¶
-
-
class
Utility Functions¶
-
aws_vapor.utils.
combine_user_data
(files: List[Tuple[str, str]]) → str[source]¶ Make a multipart/* message from a file content.
Parameters: files – Paths to a file, a content of which will be used as ‘UserData’. Returns: A multipart/* message attached a file content to.
-
aws_vapor.utils.
get_property_from_config_file
(section: str, key: str, default_value: str = None) → str[source]¶ Get a property value from a config file.
Parameters: - section – A name of a section.
- key – A name of a property.
- default_value – A value will be returned when a property is not defined.
Returns: A property value corresponding to the key, which is property name, in the section, or default_value if the section is not defined or the key is not defined.
-
aws_vapor.utils.
inject_params
(lines: str, params: dict) → List[str][source]¶ Replace placeholders with parameters.
Parameters: - lines – A file content including placeholders ({{ … }}).
- params – A mapping a name of placeholders to a value.
Returns: A file content replaced placeholders with parameters.
-
aws_vapor.utils.
load_from_config_file
(config_directories: List[str] = None) → dict[source]¶ Load properties from a config file.
Parameters: config_directories – A path to config directory having ‘config’. If not specified, locating ‘config’ on GLOBAL_CONFIG_DIRECTORY and LOCAL_CONFIG_DIRECTORY. Returns: A mapping of properties loaded from a config file. example:
{ 'section': { 'key1': 'value1', 'key2': 'value2' } }