相关疑难解决方法(0)

如何从状态显示中的地形中提取数据

我想提取来自 的数据terraform state show。根据文档我们应该使用terraform show -json. https://www.terraform.io/docs/cli/commands/state/show.html

terraform state show 的输出旨在供人类消费,而不是程序消费。要提取状态数据以在其他软件中使用,请使用 terraform show -json 并使用记录的结构解码结果。

不知道如何terrafrom state show结合使用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
}
Run Code Online (Sandbox Code Playgroud)

terraform

6
推荐指数
1
解决办法
7958
查看次数

标签 统计

terraform ×1