{"id":26823829,"url":"https://github.com/woodprogrammer/tf_importer","last_synced_at":"2025-10-17T02:32:43.271Z","repository":{"id":75430038,"uuid":"414751098","full_name":"WoodProgrammer/tf_importer","owner":"WoodProgrammer","description":"Generate terraform import commands ","archived":false,"fork":false,"pushed_at":"2021-10-26T12:49:39.000Z","size":11,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-28T11:50:16.439Z","etag":null,"topics":["aws","devops","iac","terraform"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WoodProgrammer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-10-07T20:39:27.000Z","updated_at":"2022-01-17T13:34:03.000Z","dependencies_parsed_at":"2023-03-11T02:30:17.532Z","dependency_job_id":null,"html_url":"https://github.com/WoodProgrammer/tf_importer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WoodProgrammer/tf_importer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoodProgrammer%2Ftf_importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoodProgrammer%2Ftf_importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoodProgrammer%2Ftf_importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoodProgrammer%2Ftf_importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WoodProgrammer","download_url":"https://codeload.github.com/WoodProgrammer/tf_importer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoodProgrammer%2Ftf_importer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265575530,"owners_count":23790784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","devops","iac","terraform"],"created_at":"2025-03-30T09:16:54.291Z","updated_at":"2025-10-17T02:32:38.225Z","avatar_url":"https://github.com/WoodProgrammer.png","language":"Python","readme":"# tf_importer\n\nThis tool helps to generate terraform import commands for the huge terraform stack. If you want to import terraform resources to make your configuration and terraform states under the same state you can use this tool for the huge terraform stacks.\n\nThe tools like \u003ca href=\"https://former2.com/\"\u003eformer2\u003c/a\u003e allows us to generate entire AWS stack but while you are importing this, that can take too much time.\ntf_import helps to generate import commands for the huge amount of stacks.\n\n\n# How it works \nThe most important configuration file is \u003cb\u003eresource_mapping.yaml\u003c/b\u003e file, this file contains the configuration map and provider specific keys based on your provider.\n\n```yaml\n## resource_map.yaml\nresources:\n  buckets:\n    to_import: aws_s3_bucket\n    import_key: bucket\n    prefix: \"\"\n    suffix: \"\"\n\n  sns_topics:\n    to_import: aws_sns_topic\n    import_key: name\n    prefix: \"arn:aws:sns:us-west-2:0123456789012:\"\n    suffix: \"\"\n\n  staging_helm_releases:\n    to_import: helm_release\n    import_key: name\n    prefix: \"\u003cnamespace\u003e/\"\n    suffix: \"\"\n  \n```\nUnder the resources map, you only have to define which resources you need to import;\n\n* to_import : Resource name of the provider\n* import_key: The identifier key in the resource definition\n\n* prefix: The prefix to refer real resource. Because some of the resources like AWS SNS requires a direct arn name so that you have to set a arn prefix in front of the resource name.You can check the example usage.\n\n* suffix: The suffix to refer real resource.\n\nAfter you defined your resource map you only have to run this command like that;\n\n\n```sh\n$ python3 main.py --file resource_mapping.yaml --directory ./infra\n\nterraform import aws_s3_bucket.b my-tf-test-bucket\nterraform import aws_sns_topic.user_updates arn:aws:sns:us-west-2:0123456789012:user-updates-topic\nterraform import aws_rds_cluster.default aurora-cluster-demo\nterraform import aws_rds_cluster.default_new aurora-cluster-demo\nterraform import aws_rds_cluster.default_hede aurora-cluster-demo\n```\n\n## TODO\n\n- Dynamic and block based import generation\n- Manual Resource Check\n- Config Drift Check\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoodprogrammer%2Ftf_importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoodprogrammer%2Ftf_importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoodprogrammer%2Ftf_importer/lists"}