Skip to content

Commit 267e280

Browse files
committed
better example, remove beta flags
1 parent 7bb78b9 commit 267e280

File tree

3 files changed

+13
-26
lines changed

3 files changed

+13
-26
lines changed

content/terraform/v1.14.x (alpha)/data/cli-nav-data.json

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,7 @@
6464
},
6565
{
6666
"title": "query command reference",
67-
"href": "/cli/commands/query",
68-
"badge": {
69-
"text": "BETA",
70-
"type": "outlined",
71-
"color": "neutral"
72-
}
67+
"href": "/cli/commands/query"
7368
}
7469
]
7570
},
@@ -290,15 +285,7 @@
290285
"title": "<code>providers schema</code>",
291286
"href": "/cli/commands/providers/schema"
292287
},
293-
{
294-
"title": "<code>query</code>",
295-
"href": "/cli/commands/query",
296-
"badge": {
297-
"text": "BETA",
298-
"type": "outlined",
299-
"color": "neutral"
300-
}
301-
},
288+
{ "title": "<code>query</code>", "href": "/cli/commands/query" },
302289
{ "title": "<code>refresh</code>", "href": "/cli/commands/refresh" },
303290
{ "title": "<code>show</code>", "href": "/cli/commands/show" },
304291
{ "title": "<code>state</code>", "href": "/cli/commands/state" },

content/terraform/v1.14.x (alpha)/data/language-nav-data.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,7 @@
195195
{ "title": "Overview", "path": "import"},
196196
{
197197
"title": "Import resources in bulk",
198-
"path": "import/bulk",
199-
"badge": {
200-
"text": "BETA",
201-
"type": "outlined",
202-
"color": "neutral"
203-
}
198+
"path": "import/bulk"
204199
},
205200
{ "title": "Import a single resource", "path": "import/single-resource" },
206201
{

content/terraform/v1.14.x (alpha)/docs/language/import/bulk.mdx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ description: Learn how to query existing infrastructure for unmanaged resources
77

88
You can configure queries that instruct Terraform to search your existing infrastructure for unmanaged resources. Terraform can also generate configuration for importing the resources it finds so that you can import them to your Terraform workspace in bulk. For information about importing single resources or small batches of resources, refer to [Import single resources](/terraform/language/import/single-resource) for instructions.
99

10-
@include 'beta.mdx'
11-
1210
## Introduction
1311

1412
For organizations with large sets of infrastructure resources, manually identifying and importing them is tedious and labor intensive, even when using third-party tools or custom scripts. To alleviate this burden, you can write HCL-based queries and run them with the Terraform CLI to retrieve unmanaged resources so that you can import them in bulk.
@@ -54,15 +52,22 @@ Add the following arguments to your `list` block:
5452

5553
The `list` block also supports several Terraform **meta-arguments**, which are arguments built into Terraform configuration language that configure how Terraform creates and manages infrastructure objects. For example, you can use the `count` meta-argument to create multiple instances of the resource list returned by the query. Refer to [Meta-arguments](/terraform/language/meta-arguments) for more information.
5654

57-
The following example queries AWS for `aws_instance` resources tagged with `prod` and returns complete resource information for the first 50 results:
55+
In the following example, Terraform applies provder arguments to query for `aws_instance` resources in the `us-east-2` region. The query also filters results prefixed with `prod-` and `stage-` and that are in a `running` state. The `limit` argument, which is not a provider-specific argument, instructs Terraform to return the first 50 results:
5856

5957
```hcl
6058
list "aws_instance" "prod" {
6159
provider = aws
62-
include_resource = true
6360
limit = 50
6461
config {
65-
filter = "prod"
62+
region = "us-east-2"
63+
filter {
64+
name = "tag:Name"
65+
values = ["prod-*", "staging-*"]
66+
}
67+
filter {
68+
name = "instance-state-name"
69+
values = ["running"]
70+
}
6671
}
6772
}
6873
```

0 commit comments

Comments
 (0)