Linux command
terraform-show 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show the current state
terraform show
Show a saved plan file
terraform show [plan.tfplan]
Output state as JSON
terraform show -json
Output a plan file as JSON
terraform show -json [plan.tfplan]
Show state without color
terraform show -no-color
说明
terraform show reads and displays Terraform state or plan files in a human-readable format. When called without a file argument, it renders the latest state snapshot, showing all managed resources and their current attribute values. When given a plan file (created by terraform plan -out), it displays the proposed changes including resources to be created, modified, or destroyed. The -json flag produces structured JSON output suitable for processing by external tools, CI/CD pipelines, or policy engines. The JSON format includes the full resource state, planned changes, and provider configuration.
参数
- -json
- Output the state or plan in machine-readable JSON format. Sensitive values are shown in plain text.
- -no-color
- Disable terminal color codes in the output.
FAQ
What is the terraform-show command used for?
terraform show reads and displays Terraform state or plan files in a human-readable format. When called without a file argument, it renders the latest state snapshot, showing all managed resources and their current attribute values. When given a plan file (created by terraform plan -out), it displays the proposed changes including resources to be created, modified, or destroyed. The -json flag produces structured JSON output suitable for processing by external tools, CI/CD pipelines, or policy engines. The JSON format includes the full resource state, planned changes, and provider configuration.
How do I run a basic terraform-show example?
Run `terraform show` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -json do in terraform-show?
Output the state or plan in machine-readable JSON format. Sensitive values are shown in plain text.