1. HashiCorp Terraform Documentation
state list command: "The terraform state list command is used to list resources within a Terraform state." This supports the first step of identifying the resource.
Source: HashiCorp
Terraform CLI Documentation
Command: state list.
2. HashiCorp Terraform Documentation
state show command: "The terraform state show command is used to show the attributes of a single resource in the Terraform state... This command can be useful for inspecting the current state of a resource." This confirms it is the correct tool for viewing the resource's attributes like an IP address.
Source: HashiCorp
Terraform CLI Documentation
Command: state show.
3. HashiCorp Terraform Documentation
Output Values: "The terraform output command is used to extract the value of an output variable from the state file." This implies an output must first be defined in the configuration.
Source: HashiCorp
Terraform Language Documentation
Configuration Language
Output Values.
4. HashiCorp Terraform Documentation
terraformremotestate Data Source: "The terraformremotestate data source allows you to use the root-level outputs of another Terraform configuration as input data." This shows its purpose is for sharing data between configurations
not simple inspection.
Source: HashiCorp
Terraform Language Documentation
Data Sources
terraformremotestate.