Closed x-dean closed 3 weeks ago
│ Error: Unable to create data view
│
│ with module.rbac.module.kibana_data_views["prometheus"].elasticstack_kibana_data_view.data_views,
│ on ../../../../../tf/modules/rbac/ec_kibana_data_views/main.tf line 1, in resource "elasticstack_kibana_data_view" "data_views":
│ 1: resource "elasticstack_kibana_data_view" "data_views" {
│
│ Failed with: {"statusCode":400,"error":"Bad Request","message":"Duplicate data view: prom"}
From the output it looks like the data view existed outside of Terraform before being applied. In that case you'll first want to import the data view into TF state and then start managing the existing data view. The TF docs have some more details about the import process.
@tobio
That is the issue, the data view did not exist before, it is created during terraform apply and then it is not stored in state. On the next terraform apply it fails because terraform created it before and did not store in state.
Describe the bug kibana_data_view gets created but not stored in state.
Screenshots
Versions (please complete the following information):