Difference between revisions of "Terraform show"

From wikieduonline
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 24: Line 24:
 
* [[Terraform show output example aws_instance]]
 
* [[Terraform show output example aws_instance]]
  
RDS
+
[[aws_db_instance|RDS]]
 
  terraform show | grep [[.rds.amazonaws.com]]
 
  terraform show | grep [[.rds.amazonaws.com]]
 
  terraform show | grep -w [[endpoint]]
 
  terraform show | grep -w [[endpoint]]
Line 51: Line 51:
  
 
  [[Error: failed to read the give file as a state or plan file]]
 
  [[Error: failed to read the give file as a state or plan file]]
 +
 +
 +
[[Error: Invalid or missing required argument]]
  
  
Line 63: Line 66:
 
* <code>[[terraform state show]]</code>
 
* <code>[[terraform state show]]</code>
 
* <code>[[terraform state show aws_instance.MYexample]]</code>
 
* <code>[[terraform state show aws_instance.MYexample]]</code>
* <code>[[terraform apply]]</code>
+
* <code>[[terraform apply -replace]]</code>
* <code>terraform apply -replace</code>
 
  
 
* <code>[[terraform destroy]]</code>
 
* <code>[[terraform destroy]]</code>
* <code>[[Error: Module not installed]]</code>
 
 
* <code>[[terraform output]]</code>
 
* <code>[[terraform output]]</code>
 
* <code>[[terraform plan -refresh-only]]</code>
 
* <code>[[terraform plan -refresh-only]]</code>
 
* <code>[[terragrunt show]]</code>
 
* <code>[[terragrunt show]]</code>
 
* [[terraform workspace show]]
 
* [[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 ==

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]

RDS

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]

Errors[edit]

See also[edit]

Advertising: