跳转到主要内容

未提供项目描述

项目描述

Made with pop, a Python implementation of Plugin Oriented Programming Made with Python

描述

现有的云基础设施可以通过云提供商控制台或通过如Terraform等软件工具进行管理。项目“Idem CodeGen”的目的是通过发现现有基础设施,引导客户使用Idem作为基础设施即代码(IaC)管理解决方案,并通过将Terraform文件转换为SLS文件,简化当前使用Terraform进行IaC管理的客户迁移过程。手动将每个Terraform文件转换为SLS文件对于任何Terraform客户来说都不是可行的选项,因为所有文件加起来可能包含1000多个分布在100多个文件中的资源对象。此外,对于直接使用Web控制台管理基础设施的客户,Idem可以发现现有的云基础设施,并自动为所有发现的资源生成SLS代码。‘Idem CodeGen’利用这一功能,通过自动生成层次结构化、可维护和可重用的SLS文件来组织SLS代码。

运行idem-codegen将Terraform转换为idem IaC转换的步骤

运行以下命令

pip install -e .
idem_codegen tf_idem -c [path_to_config_file]

示例配置文件

{
    "idem_codegen": {
        "tf_state_bucket_name": "",
        "tf_state_key": "",
        "idem_describe": False,
        "get_tf_state_from_s3": False,
        "output_directory_path": "[path_to_output_directory]",
        "idem_describe_path": "[path_to_idem_describe_response_file]",
        "tf_state_file_path": "[path_to_tfstate_json_file]",
        "terraform_directory_path": "[path_to_terraform_directory]",
        "group_style": "default"
    }
}

运行idem-codegen进行基础设施发现和IaC生成的步骤

运行以下命令

pip install -e .
idem_codegen discovery -c [path_to_config_file]

示例配置文件

{
    "idem_codegen": {
        "idem_describe": False,
        "output_directory_path": "[path_to_output_directory]",
        "idem_describe_path": "[path_to_idem_describe_response_file]",
        "group_style": "default"
    }
}

从Terraform状态文件生成resource_ids的步骤

运行以下命令

idem_codegen generate --type=resource_ids -c [path_to_config_file]

注意:'–type' 参数仅在 'generate' 子命令中需要。

示例配置文件

{
    "idem_codegen": {
        "output_directory_path": "[path_to_output_directory]",
        "tf_state_file_path": "[path_to_tfstate_json_file]",
    }
}

注意:安全组规则的资源 ID 需要手动更改。

生成 terraform 和 idem 文件夹之间差异的步骤

运行以下命令

idem_codegen generate --type=terraform_drift -c [path_to_config_file]

注意:'–type' 参数仅在 'generate' 子命令中需要。

示例配置文件

{
    "idem_codegen": {
        "output_directory_path": "[path_to_output_directory]",
        "terraform_directory_path": "[path_to_terraform_input_files]",
        "hide_output_if_no_drifts" "True | False"
    }
}

运行 help 命令以了解更多配置参数

idem_codegen --help

项目详情


下载文件

下载适用于您的平台文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分发

idem-codegen-3.2.0.tar.gz (56.4 kB 查看哈希值)

上传时间

构建分发

idem_codegen-3.2.0-py3-none-any.whl (80.4 kB 查看哈希值)

上传时间 Python 3