tftarget

command module
v0.0.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 2 Imported by: 0

README

tftarget

Go Reference release tagpr

A Terraform ( plan | apply | destroy ) target tool

Features

You can interactivity select resource to ( plan | apply | destroy ) with target option.

tftarget plan

tftarget-plan

tftarget apply

tftarget-apply

tftarget destroy

tftarget-destroy

Requirements

The tftarget invokes the Terraform command, so Terraform must be installed on the local environment.

Getting Started

We have prepared a sandbox environment where Terraform can be run in a Docker environment, so please clone the repository and try it out.

$ git clone https://github.com/orangekame3/tftarget.git

First, build localstack

$ make localstack

Then, change directory, following command.

$ cd sandbox

Now that localstack has started, you should be able to run Terraform.
Please run the following command to confirm that Terraform is functioning properly.

$ terraform init
$ terraform plan

Once you have reached this point, the preparation is complete.

Install

Go
$ go install github.com/orangekame3/tftarget@latest
Homebrew
$ brew install orangekame3/tap/tftarget
Download

Download the latest compiled binaries and put it anywhere in your executable path.

https://github.com/orangekame3/tftarget/releases

Usage

$ tftarget --help
tftarget is a CLI library for Terraform plan/apply with target option.
You can interactivity select resource to plan/appply with target option.

Usage:
  tftarget [command]

Available Commands:
  apply       Terraform apply, interactively select resource to apply with target option
  completion  Generate the autocompletion script for the specified shell
  destroy     Terraform destroy, interactively select resource to destroy with target option
  help        Help about any command
  plan        Terraform plan, interactively select resource to plan with target option

Flags:
  -h, --help      help for tftarget
  -v, --version   version for tftarget

Use "tftarget [command] --help" for more information about a command.
Plan
$ tftarget plan --h
Terraform plan, interactively select resource to plan with target option

Usage:
  tftarget plan [flags]

Flags:
  -f, --filter string   filter by action. You can select create, destroy, update, or replace
  -h, --help            help for plan
  -i, --items int       check box item size (default 25)
  -p, --parallel int    limit the number of concurrent operations (default 10)
  -s, --summary         summary of selected items (default true)
Simple Usage
$ tftarget plan

simple-usage

Executing a tftarget plan is equivalent to executing a terraform plan. The 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.

By selecting this checkbox and executing, the terraform plan can be executed for the selected resource with the target option.

simple-usage-2

Apply
$ tftarget apply --h
Terraform apply, interactively select resource to apply with target option

Usage:
  tftarget apply [flags]

Flags:
  -f, --filter string   filter by action. You can select create, destroy, update, or replace
  -h, --help            help for plan
  -i, --items int       check box item size (default 25)
  -p, --parallel int    limit the number of concurrent operations (default 10)
  -s, --summary         summary of selected items (default true)
Destroy
$ tftarget destroy --h
Terraform destroy, interactively select resource to destroy with target option

Usage:
  tftarget destroy [flags]

Flags:
  -f, --filter string   filter by action. You can select create, destroy, update, or replace
  -h, --help            help for plan
  -i, --items int       check box item size (default 25)
  -p, --parallel int    limit the number of concurrent operations (default 10)
  -s, --summary         summary of selected items (default true)

License

MIT

Documentation

Overview

Copyright © 2023 orangekame3 miya.org.0309@gmai.com

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL