I would like to extract the data given from terraform state show. According to documentation we should use terraform show -json . https://www.terraform.io/docs/cli/commands/state/show.html
The output of terraform state show is intended for human consumption, not programmatic consumption. To extract state data for use in other software, use terraform show -json and decode the result using the documented structure.
Not sure how to use terrafrom state show in conjuction with terrafrom show
$ terraform state show 'packet_device.worker'
# packet_device.worker:
resource "packet_device" "worker" {
billing_cycle = "hourly"
created = "2015-12-17T00:06:56Z"
facility = "ewr1"
hostname = "prod-xyz01"
id = "6015bg2b-b8c4-4925-aad2-f0671d5d3b13"
locked = false
}