You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The difference of terraform state show and terraform show is that the former only shows one resource, while the latter shows every resources in the state file.
One use case when we want to only show one resource is when we have an existing state file, which was originally generated from provider, e.g. v1.1.0. Later, if we initialized another terraform working directory with an old provider version, .e.g v1.0.0, whose main purpose is to import new resources to the state file (as v1.1.0 is backward compatible with v1.0.0, so it is not a problem to import with an older version). By following the official import guide, after importing the resource, we will need to leverage the terraform state show/terraform show to construct the corresponding HCL, at this point, terraform show might raise error if there are resources (properties) in the state file that only exist in v1.1.0. While what we actually want to show is only the imported resources (for v1.0.0).
The difference of
terraform state show
andterraform show
is that the former only shows one resource, while the latter shows every resources in the state file.One use case when we want to only show one resource is when we have an existing state file, which was originally generated from provider, e.g. v1.1.0. Later, if we initialized another terraform working directory with an old provider version, .e.g v1.0.0, whose main purpose is to import new resources to the state file (as v1.1.0 is backward compatible with v1.0.0, so it is not a problem to import with an older version). By following the official import guide, after importing the resource, we will need to leverage the
terraform state show
/terraform show
to construct the corresponding HCL, at this point,terraform show
might raise error if there are resources (properties) in the state file that only exist in v1.1.0. While what we actually want to show is only the imported resources (for v1.0.0).I've also found #27 said that:
If that is the case, can we extend the
terraform show
with some option to make it able to only show one resource?The text was updated successfully, but these errors were encountered: