Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Fix issue when setting `override` in `elasticstack_kibana_data_view` resource ([#550](https://github.com/elastic/terraform-provider-elasticstack/pull/550))
- Fixup typos in `elasticstack_elasticsearch_transform` and `elasticstack_kibana_security_role` docs ([#551](https://github.com/elastic/terraform-provider-elasticstack/pull/551))
- Fix issue when setting `field_attrs` in `elasticstack_kibana_data_view` resource ([#552](https://github.com/elastic/terraform-provider-elasticstack/pull/552))
- Add an example resource and import command to the `elasticstack_kibana_data_view` docs ([#560](https://github.com/elastic/terraform-provider-elasticstack/pull/560))

## [0.11.0] - 2023-12-12

Expand Down
36 changes: 30 additions & 6 deletions docs/resources/kibana_data_view.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "elasticstack_kibana_data_view Resource - terraform-provider-elasticstack"
subcategory: ""
subcategory: "Kibana"
layout: ""
page_title: "Elasticstack: elasticstack_kibana_data_view Resource"
description: |-
Manages Kibana data views
Manages Kibana data views.
---

# elasticstack_kibana_data_view (Resource)
# Resource: elasticstack_kibana_data_view

Manages Kibana data views
Creates and manages Kibana [data views](https://www.elastic.co/guide/en/kibana/current/data-views-api.html)

## Example Usage

```terraform
provider "elasticstack" {
elasticsearch {}
kibana {}
}

resource "elasticstack_kibana_data_view" "my_data_view" {
data_view = {
name = "logs-*"
title = "logs-*"
time_field_name = "@timestamp"
namespaces = ["backend"]
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -80,3 +96,11 @@ Required:

- `script_source` (String) Script of the runtime field.
- `type` (String) Mapping type of the runtime field. For more information, check [Field data types](https://www.elastic.co/guide/en/elasticsearch/reference/8.11/mapping-types.html).

## Import

Import is supported using the following syntax:

```shell
terraform import elasticstack_kibana_data_view.my_data_view <space id>/<data view id>
```
1 change: 1 addition & 0 deletions examples/resources/elasticstack_kibana_data_view/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import elasticstack_kibana_data_view.my_data_view <space id>/<data view id>
13 changes: 13 additions & 0 deletions examples/resources/elasticstack_kibana_data_view/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
provider "elasticstack" {
elasticsearch {}
kibana {}
}

resource "elasticstack_kibana_data_view" "my_data_view" {
data_view = {
name = "logs-*"
title = "logs-*"
time_field_name = "@timestamp"
namespaces = ["backend"]
}
}
23 changes: 23 additions & 0 deletions templates/resources/kibana_data_view.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
subcategory: "Kibana"
layout: ""
page_title: "Elasticstack: elasticstack_kibana_data_view Resource"
description: |-
Manages Kibana data views.
---

# Resource: elasticstack_kibana_data_view

Creates and manages Kibana [data views](https://www.elastic.co/guide/en/kibana/current/data-views-api.html)

## Example Usage

{{ tffile "examples/resources/elasticstack_kibana_data_view/resource.tf" }}

{{ .SchemaMarkdown | trimspace }}

## Import

Import is supported using the following syntax:

{{ codefile "shell" "examples/resources/elasticstack_kibana_data_view/import.sh" }}