Skip to main content
Made with pop, a Python implementation of Plugin Oriented Programming Made with Python

Description

The existing cloud infrastructure gets managed either directly via cloud provider console or via software tools like Terraform. The goal of project ‘Idem CodeGen’ is to onboard customers to use Idem for Infrastructure as Code (IaC) management solution by discovering their existing infrastructure and to facilitate the process of migration for customers who currently use Terraform for IaC management by converting terraform files into SLS files. Manually converting each Terraform file into SLS file is not a feasible option for any Terraform customer as all files collectively may comprise of 1000+ resource objects distributed across 100+ files. Also, for customers those use web console directly to manage the infrastructure, Idem can discover existing cloud infrastructure and automatically generates SLS code for all discovered resources. ‘Idem CodeGen’ leverages this capability to organise the SLS code by automatically generating hierarchical, maintainable and reusable SLS files.

Steps to run idem-codegen for terraform to idem IaC transformation

Run following commands:

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

Sample 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"
    }
}

Steps to run idem-codegen for infrastructure discovery and IaC generation

Run following commands:

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

Sample 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"
    }
}

Steps to generate resource_ids from terraform state file

Run the following command:

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

Note-: ‘–type’ parameter is only required with ‘generate’ subcommand.

Sample config file:

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

Note-: Resource ids of security group rule have to be changed manually.

Steps to generate drift between terraform and idem folders

Run the following command:

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

Note-: ‘–type’ parameter is only required with ‘generate’ subcommand.

Sample config file:

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

Run help command to understand more about configuration parameters:

idem_codegen --help

Metadata

Release files for idem-codegen 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for idem-codegen 3.2.0
File Size Uploaded Provenance Actions
idem-codegen-3.2.0.tar.gz 56.4 kB Without provenance Details for idem-codegen-3.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for idem-codegen 3.2.0
File Interpreter ABI Platform Actions
idem_codegen-3.2.0-py3-none-any.whl Python 3 none any Details for idem_codegen-3.2.0-py3-none-any.whl

Total release size: 136.8 kB

Release files / idem-codegen-3.2.0.tar.gz

Download URL idem-codegen-3.2.0.tar.gz
Size 56.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f78f6083e9b87e1c89896f58de27c3919240f20105b65a9d92378c1d9b53fe75
BLAKE2b-256 checksum
How to use checksums
0b3eeb89b6805cac06a4774c4cdceb4f662fd3379256f05766ddec1c8f1c9be1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.65.0 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.16

Release files / idem_codegen-3.2.0-py3-none-any.whl

Download URL idem_codegen-3.2.0-py3-none-any.whl
Size 80.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa9f476b45687a842e2a910a7da4a266a8219361faa05ac292622279c6f05aa5
BLAKE2b-256 checksum
How to use checksums
2e1afd6ac3f68b8f89794edb8a2a16f22d91de7350b5dae18c072046a00eec2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.9.6 readme-renderer/37.3 requests/2.28.2 requests-toolbelt/0.10.1 urllib3/1.26.14 tqdm/4.65.0 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.16

Security for idem-codegen 3.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page