Difference between revisions of "Terraform show"
Jump to navigation
Jump to search
(→Errors) |
|||
(84 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{lowercase}} | ||
+ | <code>terraform show</code> command provides human-readable output from a [[Terraform state files|state]] or [[plan file]]. | ||
* https://www.terraform.io/docs/cli/commands/show.html | * https://www.terraform.io/docs/cli/commands/show.html | ||
− | [[terraform show -- | + | * <code>[[terraform show]]</code> |
+ | * <code>[[terraform show -no-color]]</code> | ||
+ | * <code>[[terraform show -json]]</code> | ||
+ | * <code>[[terraform show --help]]</code> | ||
+ | |||
+ | {{terraform flow}} | ||
+ | |||
+ | == Examples == | ||
+ | * <code>[[terraform show (output example)]]</code> (output example) | ||
+ | * <code>terraform show | egrep -w "^[[resource]] |^[[data]] " | grep -v "#"</code> | ||
+ | * <code>[[terraform show (grep resource) | terraform show | grep -w resource]]</code> | ||
+ | * <code>[[terraform]] show | grep #</code> | ||
+ | * <code>terraform show | grep -w data | grep -v "#"</code> | ||
+ | * <code>terraform show | egrep -w "instance_state|public_ip"</code> | ||
+ | * <code>terraform show | grep -w [[public_ip]]</code> | ||
+ | * <code>terraform show | grep -w [[Name]]</code> | ||
+ | * <code>terraform show | grep [[instance_type]]</code> | ||
+ | * <code>terraform show | grep [[instance_state]]</code> | ||
+ | * [[terraform]] show | grep -w [[endpoint]] | ||
+ | * [[Terraform show output example aws_instance]] | ||
+ | |||
+ | [[aws_db_instance|RDS]] | ||
+ | terraform show | grep [[.rds.amazonaws.com]] | ||
+ | terraform show | grep -w [[endpoint]] | ||
terraform show | terraform show | ||
− | No state. | + | [[No state]]. |
− | |||
− | |||
terraform show | terraform show | ||
− | + | (no output) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | [[terragrunt show]] | |
− | |||
− | |||
− | + | == Examples with errors == | |
− | + | terraform show | |
− | + | ╷ | |
+ | │ [[Error: Module not installed]] | ||
+ | │ | ||
+ | │ on /path_to_file/main.tf line 3: | ||
+ | │ 3: module "[[compute]]" { | ||
+ | │ | ||
+ | │ This module is not yet installed. Run "[[terraform init]]" to install all modules required by this configuration. | ||
+ | ╵ | ||
− | + | │ [[Error: Backend initialization required, please run "terraform init"]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | [[Error: failed to read the give file as a state or plan file]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | |||
+ | [[Error: Invalid or missing required argument]] | ||
+ | |||
+ | |||
+ | * <code>[[terraform show my_wrong_name]]</code> | ||
== Changelog == | == Changelog == | ||
− | * terraform show: | + | * <code>terraform show</code>: the [[JSON]] plan output now indicates which state values are sensitive. (#28889) |
== Related terms == | == Related terms == | ||
* <code>[[terraform state list]]</code> | * <code>[[terraform state list]]</code> | ||
+ | * <code>[[terraform state pull]]</code> | ||
+ | * <code>[[terraform state show]]</code> | ||
+ | * <code>[[terraform state show aws_instance.MYexample]]</code> | ||
+ | * <code>[[terraform apply -replace]]</code> | ||
+ | |||
+ | * <code>[[terraform destroy]]</code> | ||
+ | * <code>[[terraform output]]</code> | ||
+ | * <code>[[terraform plan -refresh-only]]</code> | ||
+ | * <code>[[terragrunt show]]</code> | ||
+ | * [[terraform workspace show]] | ||
+ | * [[helm show all]] | ||
+ | |||
+ | == Errors == | ||
+ | * <code>[[Error: Module not installed]]</code> | ||
+ | * [[Error: Failed to read the given file as a state or plan file]] | ||
== See also == | == See also == | ||
− | * {{terraform | + | * {{terraform show}} |
− | * {{terraform}} | + | * {{terraform state}} |
− | |||
[[Category:Terraform]] | [[Category:Terraform]] |
Latest revision as of 09:20, 23 July 2024
terraform show
command provides human-readable output from a state or plan file.
terraform init
->terraform plan
->terraform apply
->terraform show
Examples[edit]
terraform show (output example)
(output example)terraform show | egrep -w "^resource |^data " | grep -v "#"
terraform show | grep -w resource
terraform show | grep #
terraform show | grep -w data | grep -v "#"
terraform show | egrep -w "instance_state|public_ip"
terraform show | grep -w public_ip
terraform show | grep -w Name
terraform show | grep instance_type
terraform show | grep instance_state
- terraform show | grep -w endpoint
- Terraform show output example aws_instance
terraform show | grep .rds.amazonaws.com terraform show | grep -w endpoint
terraform show No state.
terraform show (no output)
terragrunt show
Examples with errors[edit]
terraform show ╷ │ Error: Module not installed │ │ on /path_to_file/main.tf line 3: │ 3: module "compute" { │ │ This module is not yet installed. Run "terraform init" to install all modules required by this configuration. ╵
│ Error: Backend initialization required, please run "terraform init"
Error: failed to read the give file as a state or plan file
Error: Invalid or missing required argument
Changelog[edit]
terraform show
: the JSON plan output now indicates which state values are sensitive. (#28889)
Related terms[edit]
terraform state list
terraform state pull
terraform state show
terraform state show aws_instance.MYexample
terraform apply -replace
terraform destroy
terraform output
terraform plan -refresh-only
terragrunt show
- terraform workspace show
- helm show all
Errors[edit]
See also[edit]
terraform show
,terraform show (output example)
,terraform state show module.my compute
terraform show --help
,terraform show (grep resource)
,terraform show my wrong name
,terraform show (grep aws instance)
- Terraform state:
terraform [ state | replace-provider | mv ]
,backend.tf
, Remote state backends to manage Terraform state, State locking,terraform force-unlock
Advertising: