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
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Fixed

- Prevent a provider panic when an `elasticstack_elasticsearch_template` or `elasticstack_elasticsearch_component_template` includes an empty `template` (`template {}`) block. ([#598](https://github.com/elastic/terraform-provider-elasticstack/pull/598))
- Prevent `elasticstack_kibana_space` to attempt the space recreation if `initials` and `color` are not provided. ([#606](https://github.com/elastic/terraform-provider-elasticstack/pull/606))

## [0.11.2] - 2024-03-13

Expand Down Expand Up @@ -115,6 +116,7 @@
- Add support for Kibana connections ([#226](https://github.com/elastic/terraform-provider-elasticstack/pull/226))
- **[Breaking Change] Add 'deletion_protection' field to index resource** to avoid unintentional deletion. ([#167](https://github.com/elastic/terraform-provider-elasticstack/pull/167))
- To delete index resource, you'll need to explicitly set `deletion_protection = false` as follows.

```terraform
resource "elasticstack_elasticsearch_index" "example" {
name = "example"
Expand All @@ -126,6 +128,7 @@
deletion_protection = false
}
```

- Add `elasticstack_kibana_space` for managing Kibana spaces ([#272](https://github.com/elastic/terraform-provider-elasticstack/pull/272))
- Add `elasticstack_elasticsearch_transform` for managing Elasticsearch transforms ([#284](https://github.com/elastic/terraform-provider-elasticstack/pull/284))
- Add `elasticstack_elasticsearch_watch` for managing Elasticsearch Watches ([#155](https://github.com/elastic/terraform-provider-elasticstack/pull/155))
Expand All @@ -147,6 +150,7 @@
- Fix error when logging API requests in debug mode ([#259](https://github.com/elastic/terraform-provider-elasticstack/pull/259))
- **[Breaking Change] Change `pipeline_metadata` type from schema.TypeMap to schema.TypeString**. This is to fix an error caused by updates to Logstash Pipelines outside of TF ([#278](https://github.com/elastic/terraform-provider-elasticstack/issues/278))
- To use the updated `pipeline_metadata` field, you'll need to encapsulate any Terraform configuration with **jsonencode{}** as follows:

```terraform
resource "elasticstack_elasticsearch_logstash_pipeline" "example" {
name = "example"
Expand All @@ -161,14 +165,15 @@
})
}
```

- If migrating existing resources in state from a previous version of the provider, then you will need to remove the reference to the resources in state before reapplying / reimporting:
- Run `terraform state rm` against your logstash pipelines (https://developer.hashicorp.com/terraform/cli/commands/state/rm)
- Run `terraform state rm` against your logstash pipelines (<https://developer.hashicorp.com/terraform/cli/commands/state/rm>)
- Ensure any definitions of the `pipeline_metadata` field in your resource definitions have been encapsulated with `jsonencode()` as mentioned above.
- EITHER
- run `terraform plan`
- run `terraform apply`
- OR
- reimport the resources into state using `terraform import` (https://developer.hashicorp.com/terraform/cli/import)
- reimport the resources into state using `terraform import` (<https://developer.hashicorp.com/terraform/cli/import>)
- Fix order of `indices` field in SLM ([#326](https://github.com/elastic/terraform-provider-elasticstack/pull/326))

## [0.5.0] - 2022-12-07
Expand Down
2 changes: 2 additions & 0 deletions internal/kibana/space.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ func ResourceSpace() *schema.Resource {
"initials": {
Description: "The initials shown in the space avatar. By default, the initials are automatically generated from the space name. Initials must be 1 or 2 characters.",
Type: schema.TypeString,
Computed: true, // If not provided, a value is autogenerated
Optional: true,
ValidateFunc: validation.StringLenBetween(1, 2),
},
"color": {
Description: "The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.",
Type: schema.TypeString,
Computed: true, // If not provided, a value is autogenerated
Optional: true,
},
}
Expand Down
11 changes: 11 additions & 0 deletions internal/kibana/space_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ func TestAccResourceSpace(t *testing.T) {
resource.TestCheckResourceAttr("elasticstack_kibana_space.test_space", "description", "Updated space description"),
resource.TestCheckTypeSetElemAttr("elasticstack_kibana_space.test_space", "disabled_features.*", "ingestManager"),
resource.TestCheckTypeSetElemAttr("elasticstack_kibana_space.test_space", "disabled_features.*", "enterpriseSearch"),
resource.TestCheckResourceAttr("elasticstack_kibana_space.test_space", "color", "#FFFFFF"),
),
},
{
Config: testAccResourceSpaceCreate(spaceId),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("elasticstack_kibana_space.test_space", "space_id", spaceId),
resource.TestCheckResourceAttr("elasticstack_kibana_space.test_space", "name", fmt.Sprintf("Name %s", spaceId)),
resource.TestCheckResourceAttr("elasticstack_kibana_space.test_space", "description", "Test Space"),
resource.TestCheckResourceAttr("elasticstack_kibana_space.test_space", "color", "#FFFFFF"),
),
},
},
Expand Down Expand Up @@ -66,6 +76,7 @@ resource "elasticstack_kibana_space" "test_space" {
name = "%s"
description = "Updated space description"
disabled_features = ["ingestManager", "enterpriseSearch"]
color = "#FFFFFF"
}
`, id, fmt.Sprintf("Updated %s", id))
}
Expand Down