'Terraform ad-hoc output

Is it possible to ask Terraform to provide an ad-hoc output? Looking at documentation in:

I need to add to the script an output definition like:

output "instance_ips" {
  value = aws_instance.web.*.public_ip
}

Then run terraform apply, finally terraform output instance_ips.

I frequently want to inspect a value, eg. when setting up dependent resources. I would like to be able to run something like:

terraform output -adhoc 'aws_instance.web.*.public_ip'


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source