{"id":13505882,"url":"https://github.com/future-architect/tftarget","last_synced_at":"2025-05-07T21:08:46.332Z","repository":{"id":148332407,"uuid":"619377631","full_name":"future-architect/tftarget","owner":"future-architect","description":"🎯tftarget is a CLI tool for Terraform ( plan | apply | destroy ) with target option. You can interactivity select resource to ( plan | apply | destroy )  with target option.","archived":false,"fork":false,"pushed_at":"2024-12-24T05:03:51.000Z","size":7704,"stargazers_count":263,"open_issues_count":13,"forks_count":12,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-07T21:08:40.513Z","etag":null,"topics":["go","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/future-architect.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-27T02:42:49.000Z","updated_at":"2025-04-23T18:10:50.000Z","dependencies_parsed_at":"2023-05-19T19:30:23.594Z","dependency_job_id":"558651a0-9f3c-46d6-aab6-21d4dcb85468","html_url":"https://github.com/future-architect/tftarget","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-architect%2Ftftarget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-architect%2Ftftarget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-architect%2Ftftarget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-architect%2Ftftarget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/future-architect","download_url":"https://codeload.github.com/future-architect/tftarget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252954409,"owners_count":21830905,"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":["go","terraform"],"created_at":"2024-08-01T00:01:16.181Z","updated_at":"2025-05-07T21:08:46.323Z","avatar_url":"https://github.com/future-architect.png","language":"Go","funding_links":[],"categories":["Go","Tools"],"sub_categories":["Community providers"],"readme":"# tftarget\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Go Reference](https://pkg.go.dev/badge/github.com/future-architect/tftarget.svg)](https://pkg.go.dev/github.com/future-architect/tftarget)\n[![release](https://github.com/future-architect/tftarget/actions/workflows/release.yml/badge.svg)](https://github.com/future-architect/tftarget/actions/workflows/release.yml)\n[![tagpr](https://github.com/future-architect/tftarget/actions/workflows/tagpr.yml/badge.svg)](https://github.com/future-architect/tftarget/actions/workflows/tagpr.yml)\n\n\nA Terraform ( plan | apply | destroy ) target tool\n\n![tftarget-logo](./capture/tftarget-logo.jpg)\n\n## Features\nYou can interactivity select resource to ( plan | apply | destroy ) with target option. \n\n[日本語の紹介記事はこちら](https://future-architect.github.io/articles/20230329a/)\n\n## tftarget plan\n![tftarget-plan](./capture/tftarget-plan.gif)\n\n## tftarget apply\n![tftarget-apply](./capture/tftarget-apply.gif)\n\n## tftarget destroy\n![tftarget-destroy](./capture/tftarget-destroy.gif)\n\n## Requirements\nThe tftarget invokes the Terraform command, so Terraform must be installed on the local environment.\n\n## Getting Started\nWe have prepared a sandbox environment where Terraform can be run in a Docker environment, so please clone the repository and try it out.\n\n```shell\n$ git clone https://github.com/future-architect/tftarget.git\n```\n\nFirst, build localstack\n```shell\n$ make localstack\n```\n\nThen, change directory, following command.\n\n```shell\n$ cd sandbox\n```\n\nNow that localstack has started, you should be able to run Terraform.  \nPlease run the following command to confirm that Terraform is functioning properly.\n\n```shell\n$ terraform init\n$ terraform plan\n```\n\nOnce you have reached this point, the preparation is complete.\n\n## Install\n\n### Go\n\n```shell\n$ go install github.com/future-architect/tftarget@latest\n```\n\n### Homebrew\n\n```shell\n$ brew install future-architect/tap/tftarget\n```\n\n### Download\n\nDownload the latest compiled binaries and put it anywhere in your executable path.\n\nhttps://github.com/future-architect/tftarget/releases\n\n## Usage\n\n```shell\n$ tftarget --help\ntftarget is a CLI library for Terraform ( plan | appply | destroy ) with target option.\nYou can interactivity select resource to ( plan | appply | destroy ) with target option.\n\nUsage:\n  tftarget [command]\n\nAvailable Commands:\n  apply       Terraform apply, interactively select resource to apply with target option\n  completion  Generate the autocompletion script for the specified shell\n  destroy     Terraform destroy, interactively select resource to destroy with target option\n  help        Help about any command\n  plan        Terraform plan, interactively select resource to plan with target option\n\nFlags:\n  -h, --help      help for tftarget\n  -v, --version   version for tftarget\n\nUse \"tftarget [command] --help\" for more information about a command.\n```\n\n### Simple Usage\n\n#### Plan\n\n```shell\n$ tftarget plan\n```\n\n![simple-usage-1](./capture/simple-usage-1.png)\n\nExecuting a `tftarget plan` is equivalent to executing a `terraform plan`.\nThe difference from a normal `terraform plan` is that instead of s detailed plan results, the output is a checkbox with only the resource name and action name displayed.\n\n\nBy selecting this checkbox and executing, the terraform plan can be executed for the selected resource with the target option.\n\n![simple-usage-2](./capture/simple-usage-2.png)\n\nFinally, selected result is output as a summary.\n\n![simple-usage-3](./capture/simple-usage-3.png)\n\n#### Apply\n\n`tftarget apply` is the same flow until the `tftarget plan` and resource are selected.\nThe difference is that after selecting a resource, you will be prompted to enter `yes`, which will execute `terraform apply`.\n\n![simple-usage-4](./capture/simple-usage-4.png)\n\nAs with the `tftarget plan`, the selected resource is output as a summary.\n\n![simple-usage-5](./capture/simple-usage-5.png)\n\n#### Destroy\n\nThe use of `tftarget destroy` is exactly the same as that of `tftarget apply`, so we omit the explanation here.\n\n### Advanced Option\n\nplan, apply, and destroy each have Flags options as shown below.\n\n```shell\nFlags:\n  -f, --filter string   filter by action. You can select create, destroy, update, or replace\n  -i, --items int       check box item size (default 25)\n  -p, --parallel int    limit the number of concurrent operations (default 10)\n  -s, --summary         summary of selected items (default true)\n```\n\n#### --filter, -f\n\nThe filter option allows you to filter actions on the first resource selection screen. \nFor example, if you want to display only newly created resources as an option, do the following\n\n```shell\ntftarget apply -f create\n```\n\nThis option is not available for combined use.\nFor example, the following commands are treated as invalid\n\n```shell\ntftarget apply -f create destroy\n```\n\n#### --items, -i\n\nThis option allows you to change the number of checkbox choices. The default setting is 25.\nIf you wish to increase the number of checkboxes to 50, do the following.\n\n```shell\ntftarget apply -i 50\n```\n\n#### --parallel, -p\n--parallel is equivalent to the -parallelism=n option in terraform. The default is set to 10.\n\n```shell\ntftarget apply -p 30\n```\n\n#### --summary, -s\n--summary option is set to true by default. If it is set to false, the following output will be hidden.\n\n![simple-usage-5](./capture/simple-usage-5.png)\n\n```shell\ntftarget apply -s false\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-architect%2Ftftarget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuture-architect%2Ftftarget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-architect%2Ftftarget/lists"}