orchestration

Implement a Orchestration Framework.

troposphere_mate.core.orchestration.resolve_pipeline(plan)[source]
Parameters:plan (List[Tuple[str, str]]) – [(can_id, tag), …]
Return type:List[Tuple[List[str], str]]]
class troposphere_mate.core.orchestration.CanLabel(logic_id, can_class, filename)[source]

A wrapper around a troposphere_mate.Canned. It defines the metadata about the Canned

中文文档

Canned 之外的进一层包装. logic_id 是当 Canned 封装的 Template 会 被作为 Nested Stack 时起作用的. 因为 troposphere 实现的 Template 可能在其他 Template 中作为 AWS::CloudFormation::Stack Resource 使用. 作为 Nested Stack 是不知道 Master Stack 中的 Resource Logic Id 的. filename 则是指定了实体文件的文件名. 因为 Template 本身只关注模板数据, 不关注模板文件.

CanLabel 实现了 Y 轴上的编排.

class troposphere_mate.core.orchestration.ConfigData(env_tag, data)[source]

中文文档

一串的 CanLabel (本质上是一串原子的 Nested Stack, 要么该 Stack 中的资源被全部 创建, 要么全部不被创建) 构成了一个架构的设计. 而这个架构的设计可能被部署到不同的环境中, 在不同的环境中, 配置数据可能不同, 实际被部署的 Nested Stack 的数量也可能不同.

ConfigData 提供了在不同环境下 (用 env_tag 做区分) 的配置数据.

ConfigData 实现了 X 轴上的编排.

class troposphere_mate.core.orchestration.TemplateFile(template, filepath)[source]

中文文档

包含了 troposphere_mate.Template 的实例 以及实际的文件路径 (绝对路径)

class troposphere_mate.core.orchestration.ExecutionJob(master_can, master_template_path, template_file_list)[source]

中文文档

每个 ExecutionJob 对应一次 aws cloudformation deploy 命令的执行. 本质上一个 ExecutionJob 包含了一串最终的 Template 文件实体. 所以我们需要知道 Master Template 的路径, 以及所有的 Template 的数据以及路径.

class troposphere_mate.core.orchestration.Orchestration(master_canlabel_id, canlabel_list, config_data_list, notes)[source]

中文文档

Orchestration 的本质是对 CanLabel 和 ConfigData 进行编排. 使用: CanLabel.logic_idConfigData.env_tag 指定了编排中的某个最小单元, 通过指定云架构部署的顺序, 最终实现编排.