Difference between revisions of "Terraform state list"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 28: Line 28:
 
* <code>[[terraform state show module.eks.aws_eks_cluster]].this[0]</code>
 
* <code>[[terraform state show module.eks.aws_eks_cluster]].this[0]</code>
 
* <code>[[terraform state mv]]</code>
 
* <code>[[terraform state mv]]</code>
 +
[[terraform state rm]]
  
 
== See also ==
 
== See also ==

Revision as of 17:42, 20 March 2023

terraform state list list resources within a Terraform state

terraform state list
terraform state list | grep aws_eks_cluster

terraform state list
module.alb.my_aws_lb.this[0]
module.compute.my_aws_instance.this[0]
module.compute.my_aws_instance.this[1]


terraform state list | grep aws_eks_cluster
data.aws_eks_cluster.cluster
data.aws_eks_cluster_auth.cluster
module.eks.aws_eks_cluster.this[0]
terraform state list
No state file was found! 

State management commands require a state file. Run this command
in a directory where Terraform has been run or use the -state flag
to point the command to a specific state location.

Related commands

terraform state rm

See also

Advertising: