English 中文(简体)
如何在使用偏远地区时列出资源?
原标题:How to list resources when using remote state?
  • 时间:2020-03-31 09:58:16
  •  标签:
  • terraform

我正在使用0.12.9的梯田,而国家则在3桶中拯救。 我愿通过<地形图>国家名单列出所有资源。 根据该文件, rel=“nofollow noreferer”>。 https://www.terraform.io/docs/commands/state/list.html, 它说-state=path - Path to the state file. Defaults to "terraform.tfstate. 使用边远国家时就无人知。 如果国家档案放在边远的3桶上,我如何通过?

最佳回答

您需要将tfstate bucket条道路在terraform.tf上conf。 档案:

terraform {
  backend "s3" {
    bucket = "bucket_name"
    key    = "my/key/location/terraform.tfstate"
    region = "bucket region"
  }
}

页: 1 雷区分布于,以便梯度从遥远的桶中排出。

问题回答
  1. terraform init
  2. terraform workspace list # show all workspaces
  3. terraform workspace select {env} # select the workspace which you want list resources
  4. terraform state list # list all resources. Could return nothing if there is no resource in the workspace
  5. terraform state show {resource} # show the attributes of a single resource




相关问题
Terra Custom Read

我在做的是按习俗分类的提供者,对标签有选择性的投入,但我发现的挑战是,扼杀使用ValueString()从主要价值中取回。 f,不确定......

Retrieve IDs in Terraform before script execution

I m a freshman and I don t know if I have a general thinking error but how do I get around the issue that when I want to roll out a script that there are some IDs missing that I would only get with ...

The plugin.(*GRPCProvider)

I am trying to deploy a Terraform stack from a Linux EC2 and getting the following error: The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled. and │ The plugin.(*GRPCProvider)....

热门标签