Skip to content

Commit 5b31272

Browse files
authored
Improve docs generation (elastic#1313)
* Add generic data source template * Update code level descriptions from the existing templates * Remove redundant templates * make docs-generate * Make links in docs a little nicer * make docs-generate
1 parent 697a7f4 commit 5b31272

File tree

275 files changed

+1164
-2652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+1164
-2652
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ docker-clean: ## Try to remove provisioned nodes and assigned network
225225

226226
.PHONY: docs-generate
227227
docs-generate: tools ## Generate documentation for the provider
228-
@ go tool github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name elasticstack
228+
@ go tool github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name terraform-provider-elasticstack
229229

230230

231231
.PHONY: gen

docs/data-sources/elasticsearch_enrich_policy.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
12
---
2-
subcategory: "Enrich"
3+
# generated by https://github.com/hashicorp/terraform-plugin-docs
34
page_title: "elasticstack_elasticsearch_enrich_policy Data Source - terraform-provider-elasticstack"
5+
subcategory: "Enrich"
46
description: |-
5-
Returns information about an enrich policy. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html
7+
Returns information about an enrich policy. See the enrich policy API documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html for more details.
68
---
79

8-
# Data Source: elasticstack_elasticsearch_enrich_policy
10+
# elasticstack_elasticsearch_enrich_policy (Data Source)
911

10-
Returns information about an enrich policy. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html
12+
Returns information about an enrich policy. See the [enrich policy API documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html) for more details.
1113

1214
## Example Usage
1315

docs/data-sources/elasticsearch_index_template.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
12
---
3+
# generated by https://github.com/hashicorp/terraform-plugin-docs
4+
page_title: "elasticstack_elasticsearch_index_template Data Source - terraform-provider-elasticstack"
25
subcategory: "Index"
3-
layout: ""
4-
page_title: "Elasticstack: elasticstack_elasticsearch_index_template Data Source"
56
description: |-
6-
Retrieves index template.
7+
Retrieves information about an existing index template definition. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-template.html
78
---
89

9-
# Data Source: elasticstack_elasticsearch_index_template
10+
# elasticstack_elasticsearch_index_template (Data Source)
1011

11-
Use this data source to retrieve information about existing Elasticsearch index templates. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-template.html
12+
Retrieves information about an existing index template definition. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-template.html
1213

1314
## Example Usage
1415

docs/data-sources/elasticsearch_indices.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
12
---
3+
# generated by https://github.com/hashicorp/terraform-plugin-docs
4+
page_title: "elasticstack_elasticsearch_indices Data Source - terraform-provider-elasticstack"
25
subcategory: "Index"
3-
layout: ""
4-
page_title: "Elasticstack: elasticstack_elasticsearch_indices Data Source"
56
description: |-
6-
Retrieves indices.
7+
Retrieves information about existing Elasticsearch indices. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html
78
---
89

9-
# Data Source: elasticstack_elasticsearch_indices
10+
# elasticstack_elasticsearch_indices (Data Source)
1011

11-
Use this data source to retrieve and get information about existing Elasticsearch indices. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html
12+
Retrieves information about existing Elasticsearch indices. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html
1213

1314
## Example Usage
1415

docs/data-sources/elasticsearch_info.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
12
---
2-
subcategory: "Cluster"
3-
layout: ""
4-
page_title: "Elasticstack: elasticstack_elasticsearch_info Data Source"
3+
# generated by https://github.com/hashicorp/terraform-plugin-docs
4+
page_title: "elasticstack_elasticsearch_info Data Source - terraform-provider-elasticstack"
5+
subcategory: "Elasticsearch"
56
description: |-
6-
Gets information about the Elasticsearch cluster.
7+
Gets information about the Elastic cluster.
78
---
89

9-
# Data Source: elasticstack_elasticsearch_info
10+
# elasticstack_elasticsearch_info (Data Source)
1011

11-
This data source provides the information about the configured Elasticsearch cluster
12+
Gets information about the Elastic cluster.
1213

1314
## Example Usage
1415

docs/data-sources/elasticsearch_ingest_processor_append.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1+
12
---
3+
# generated by https://github.com/hashicorp/terraform-plugin-docs
4+
page_title: "elasticstack_elasticsearch_ingest_processor_append Data Source - terraform-provider-elasticstack"
25
subcategory: "Ingest"
3-
layout: ""
4-
page_title: "Elasticstack: elasticstack_elasticsearch_ingest_processor_append Data Source"
56
description: |-
6-
Helper data source to create a processor which appends one or more values to an existing array if the field already exists and it is an array.
7+
Helper data source which can be used to create the configuration for an append processor. This processor appends one or more values to an existing array if the field already exists and it is an array. Converts a scalar to an array and appends one or more values to it if the field exists and it is a scalar. Creates an array containing the provided values if the field doesn’t exist. See the append processor documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html for more details.
78
---
89

9-
# Data Source: elasticstack_elasticsearch_ingest_processor_append
10-
11-
Helper data source to which can be used to create a processor to append one or more values to an existing array if the field already exists and it is an array.
12-
Converts a scalar to an array and appends one or more values to it if the field exists and it is a scalar. Creates an array containing the provided values if the field doesn’t exist.
10+
# elasticstack_elasticsearch_ingest_processor_append (Data Source)
1311

14-
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html
12+
Helper data source which can be used to create the configuration for an append processor. This processor appends one or more values to an existing array if the field already exists and it is an array. Converts a scalar to an array and appends one or more values to it if the field exists and it is a scalar. Creates an array containing the provided values if the field doesn’t exist. See the [append processor documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html) for more details.
1513

1614
## Example Usage
1715

@@ -56,4 +54,3 @@ resource "elasticstack_elasticsearch_ingest_pipeline" "my_ingest_pipeline" {
5654

5755
- `id` (String) Internal identifier of the resource
5856
- `json` (String) JSON representation of this data source.
59-

docs/data-sources/elasticsearch_ingest_processor_bytes.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1+
12
---
3+
# generated by https://github.com/hashicorp/terraform-plugin-docs
4+
page_title: "elasticstack_elasticsearch_ingest_processor_bytes Data Source - terraform-provider-elasticstack"
25
subcategory: "Ingest"
3-
layout: ""
4-
page_title: "Elasticstack: elasticstack_elasticsearch_ingest_processor_bytes Data Source"
56
description: |-
6-
Helper data source to create a processor which converts a human readable byte value (e.g. 1kb) to its value in bytes (e.g. 1024).
7+
Helper data source which can be used to create the configuration for a bytes processor. The processor converts a human readable byte value (e.g. 1kb) to its value in bytes (e.g. 1024). See the bytes processor documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/bytes-processor.html for more details.
8+
If the field is an array of strings, all members of the array will be converted.
9+
Supported human readable units are "b", "kb", "mb", "gb", "tb", "pb" case insensitive. An error will occur if the field is not a supported format or resultant value exceeds 2^63.
710
---
811

9-
# Data Source: elasticstack_elasticsearch_ingest_processor_bytes
12+
# elasticstack_elasticsearch_ingest_processor_bytes (Data Source)
1013

11-
Helper data source to which can be used to create a processor to convert a human readable byte value (e.g. 1kb) to its value in bytes (e.g. 1024). If the field is an array of strings, all members of the array will be converted.
14+
Helper data source which can be used to create the configuration for a bytes processor. The processor converts a human readable byte value (e.g. 1kb) to its value in bytes (e.g. 1024). See the [bytes processor documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/bytes-processor.html) for more details.
1215

13-
Supported human readable units are "b", "kb", "mb", "gb", "tb", "pb" case insensitive. An error will occur if the field is not a supported format or resultant value exceeds 2^63.
16+
If the field is an array of strings, all members of the array will be converted.
1417

15-
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/bytes-processor.html
18+
Supported human readable units are "b", "kb", "mb", "gb", "tb", "pb" case insensitive. An error will occur if the field is not a supported format or resultant value exceeds 2^63.
1619

1720
## Example Usage
1821

@@ -55,4 +58,3 @@ resource "elasticstack_elasticsearch_ingest_pipeline" "my_ingest_pipeline" {
5558

5659
- `id` (String) Internal identifier of the resource
5760
- `json` (String) JSON representation of this data source.
58-

docs/data-sources/elasticsearch_ingest_processor_circle.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1+
12
---
3+
# generated by https://github.com/hashicorp/terraform-plugin-docs
4+
page_title: "elasticstack_elasticsearch_ingest_processor_circle Data Source - terraform-provider-elasticstack"
25
subcategory: "Ingest"
3-
layout: ""
4-
page_title: "Elasticstack: elasticstack_elasticsearch_ingest_processor_circle Data Source"
56
description: |-
6-
Helper data source to create a processor which converts circle definitions of shapes to regular polygons which approximate them.
7+
Helper data source which can be used to create the configuration for an circle processor. This processor converts circle definitions of shapes to regular polygons which approximate them. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-circle-processor.html
78
---
89

9-
# Data Source: elasticstack_elasticsearch_ingest_processor_circle
10-
11-
Helper data source to which can be used to create a processor to convert circle definitions of shapes to regular polygons which approximate them.
10+
# elasticstack_elasticsearch_ingest_processor_circle (Data Source)
1211

13-
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-circle-processor.html
12+
Helper data source which can be used to create the configuration for an circle processor. This processor converts circle definitions of shapes to regular polygons which approximate them. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest-circle-processor.html
1413

1514
## Example Usage
1615

@@ -57,4 +56,3 @@ resource "elasticstack_elasticsearch_ingest_pipeline" "my_ingest_pipeline" {
5756

5857
- `id` (String) Internal identifier of the resource
5958
- `json` (String) JSON representation of this data source.
60-

docs/data-sources/elasticsearch_ingest_processor_community_id.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1+
12
---
3+
# generated by https://github.com/hashicorp/terraform-plugin-docs
4+
page_title: "elasticstack_elasticsearch_ingest_processor_community_id Data Source - terraform-provider-elasticstack"
25
subcategory: "Ingest"
3-
layout: ""
4-
page_title: "Elasticstack: elasticstack_elasticsearch_ingest_processor_community_id Data Source"
56
description: |-
6-
Helper data source to create a processor which computes the Community ID for network flow data as defined in the Community ID Specification.
7+
Helper data source which can be used to create the configuration for a community ID processor. This processor computes the Community ID for network flow data as defined in the Community ID Specification. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/community-id-processor.html
8+
You can use a community ID to correlate network events related to a single flow.
9+
The community ID processor reads network flow data from related Elastic Common Schema (ECS) https://www.elastic.co/guide/en/ecs/1.12 fields by default. If you use the ECS, no configuration is required.
710
---
811

9-
# Data Source: elasticstack_elasticsearch_ingest_processor_community_id
12+
# elasticstack_elasticsearch_ingest_processor_community_id (Data Source)
1013

11-
Helper data source to which can be used to create a processor to compute the Community ID for network flow data as defined in the [Community ID Specification](https://github.com/corelight/community-id-spec).
14+
Helper data source which can be used to create the configuration for a community ID processor. This processor computes the Community ID for network flow data as defined in the Community ID Specification. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/community-id-processor.html
1215
You can use a community ID to correlate network events related to a single flow.
1316

1417
The community ID processor reads network flow data from related [Elastic Common Schema (ECS)](https://www.elastic.co/guide/en/ecs/1.12) fields by default. If you use the ECS, no configuration is required.
1518

16-
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/community-id-processor.html
17-
1819
## Example Usage
1920

2021
```terraform
@@ -59,4 +60,3 @@ resource "elasticstack_elasticsearch_ingest_pipeline" "my_ingest_pipeline" {
5960

6061
- `id` (String) Internal identifier of the resource
6162
- `json` (String) JSON representation of this data source.
62-

docs/data-sources/elasticsearch_ingest_processor_convert.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
1+
12
---
3+
# generated by https://github.com/hashicorp/terraform-plugin-docs
4+
page_title: "elasticstack_elasticsearch_ingest_processor_convert Data Source - terraform-provider-elasticstack"
25
subcategory: "Ingest"
3-
layout: ""
4-
page_title: "Elasticstack: elasticstack_elasticsearch_ingest_processor_convert Data Source"
56
description: |-
6-
Helper data source to create a processor which converts a field in the currently ingested document to a different type, such as converting a string to an integer.
7+
Helper data source which can be used to create the configuration for a convert processor. This processor converts a field in the currently ingested document to a different type, such as converting a string to an integer. See the convert processor documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/convert-processor.html for more details.
8+
The supported types include:
9+
integerlongfloatdoublestringbooleanipauto
10+
Specifying boolean will set the field to true if its string value is equal to true (ignoring case), to false if its string value is equal to false (ignoring case), or it will throw an exception otherwise.
11+
Specifying ip will set the target field to the value of field if it contains a valid IPv4 or IPv6 address that can be indexed into an IP field type.
12+
Specifying auto will attempt to convert the string-valued field into the closest non-string, non-IP type. For example, a field whose value is "true" will be converted to its respective boolean type: true. Do note that float takes precedence of double in auto. A value of "242.15" will "automatically" be converted to 242.15 of type float. If a provided field cannot be appropriately converted, the processor will still process successfully and leave the field value as-is. In such a case, target_field will be updated with the unconverted field value.
713
---
814

9-
# Data Source: elasticstack_elasticsearch_ingest_processor_convert
15+
# elasticstack_elasticsearch_ingest_processor_convert (Data Source)
1016

11-
Helper data source to which can be used to convert a field in the currently ingested document to a different type, such as converting a string to an integer. If the field value is an array, all members will be converted.
17+
Helper data source which can be used to create the configuration for a convert processor. This processor converts a field in the currently ingested document to a different type, such as converting a string to an integer. See the [convert processor documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/convert-processor.html) for more details.
1218

13-
The supported types include: `integer`, `long`, `float`, `double`, `string`, `boolean`, `ip`, and `auto`.
19+
The supported types include:
20+
- `integer`
21+
- `long`
22+
- `float`
23+
- `double`
24+
- `string`
25+
- `boolean`
26+
- `ip`
27+
- `auto`
1428

15-
Specifying `boolean` will set the field to true if its string value is equal to true (ignore case), to false if its string value is equal to false (ignore case), or it will throw an exception otherwise.
29+
Specifying `boolean` will set the field to true if its string value is equal to true (ignoring case), to false if its string value is equal to false (ignoring case), or it will throw an exception otherwise.
1630

1731
Specifying `ip` will set the target field to the value of `field` if it contains a valid IPv4 or IPv6 address that can be indexed into an IP field type.
1832

1933
Specifying `auto` will attempt to convert the string-valued `field` into the closest non-string, non-IP type. For example, a field whose value is "true" will be converted to its respective boolean type: true. Do note that float takes precedence of double in auto. A value of "242.15" will "automatically" be converted to 242.15 of type `float`. If a provided field cannot be appropriately converted, the processor will still process successfully and leave the field value as-is. In such a case, `target_field` will be updated with the unconverted field value.
2034

21-
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/convert-processor.html
22-
2335
## Example Usage
2436

2537
```terraform
@@ -64,4 +76,3 @@ resource "elasticstack_elasticsearch_ingest_pipeline" "my_ingest_pipeline" {
6476

6577
- `id` (String) Internal identifier of the resource
6678
- `json` (String) JSON representation of this data source.
67-

0 commit comments

Comments
 (0)