Skip to main content

No project description provided

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idem-codegen-3.1.4.tar.gz (56.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idem_codegen-3.1.4-py3-none-any.whl (80.2 kB view details)

Uploaded Python 3

File details

Details for the file idem-codegen-3.1.4.tar.gz.

File metadata

  • Download URL: idem-codegen-3.1.4.tar.gz
  • Upload date:
  • Size: 56.2 kB
  • Tags: Source
  • Uploaded using 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.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.16

File hashes

Hashes for idem-codegen-3.1.4.tar.gz
Algorithm Hash digest
SHA256 d49f3a5f905d83fa8ebf33d398dc32ea0e28661fe95a494fbe6f2b0146cd63ca
MD5 4264e889f8a9fd135aa90e792e8bbf8c
BLAKE2b-256 6a552162c1b9232760b5abc0f650b42b006b8658f5271af33596ad91a9f61aca

See more details on using hashes here.

File details

Details for the file idem_codegen-3.1.4-py3-none-any.whl.

File metadata

  • Download URL: idem_codegen-3.1.4-py3-none-any.whl
  • Upload date:
  • Size: 80.2 kB
  • Tags: Python 3
  • Uploaded using 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.64.1 importlib-metadata/6.0.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.16

File hashes

Hashes for idem_codegen-3.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 705ea6fc6f629cdcf63c4336f69dca27b035170fab3e963ee9bd82f15abe4a14
MD5 7d84cd4fcb153841725a3221ccfb4d39
BLAKE2b-256 679d0c9c7e3bb185a79c14ed8282ab112d2b0dcb02b654d7e17aaa47c528922c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page