How do you view outputs and the current state?
BeginnerConceptWorkflow and CLI
Answer
terraform output prints root outputs (-json or -raw for scripting). terraform show renders the state or a saved plan; terraform show -json tfplan gives machine-readable JSON for policy tools. terraform state list lists addresses.
terraform output -raw db_endpoint
terraform show -json tfplan | jq '.resource_changes[].change.actions'
More on Workflow and CLI
What does `terraform init` do?BeginnerWhat does `terraform plan` do?BeginnerWhat does `terraform apply` do and what is `-auto-approve`?BeginnerWhat does `terraform destroy` do?BeginnerWhat do `terraform fmt` and `terraform validate` check?BeginnerWhy save a plan with `-out` and apply that file?Intermediate