Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -5,6 +5,7 @@
- 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))
- Prevent a provider panic in `elasticstack_kibana_data_view` when a `field_format` does not include a `pattern`. ([#619](https://github.com/elastic/terraform-provider-elasticstack/pull/619/files))
- Fixed a bug where the `id` attribute for `elasticstack_kibana_slo` resources was ignored by renaming the attribute to `slo_id`. ([#622](https://github.com/elastic/terraform-provider-elasticstack/pull/622))

### Added

Expand Down
1 change: 0 additions & 1 deletion internal/kibana/slo.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ func getSloFromResourceData(d *schema.ResourceData) (models.Slo, diag.Diagnostic
// Explicitly set SLO object id if provided, otherwise we'll use the autogenerated ID from the Kibana API response
if sloID := getOrNilString("slo_id", d); sloID != nil && *sloID != "" {
slo.SloID = *sloID
fmt.Println("Setting slo.SloID to", *sloID)
}

if tags, ok := d.GetOk("tags"); ok {
Expand Down
2 changes: 2 additions & 0 deletions internal/kibana/slo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func TestAccResourceSlo(t *testing.T) {
Config: getSLOConfig(sloName, "apm_latency_indicator", false, []string{}, ""),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("elasticstack_kibana_slo.test_slo", "name", sloName),
resource.TestCheckResourceAttr("elasticstack_kibana_slo.test_slo", "slo_id", "fully-sick-slo"),
resource.TestCheckResourceAttr("elasticstack_kibana_slo.test_slo", "description", "fully sick SLO"),
resource.TestCheckResourceAttr("elasticstack_kibana_slo.test_slo", "apm_latency_indicator.0.environment", "production"),
resource.TestCheckResourceAttr("elasticstack_kibana_slo.test_slo", "apm_latency_indicator.0.service", "my-service"),
Expand Down Expand Up @@ -292,6 +293,7 @@ func getSLOConfig(name string, indicatorType string, settingsEnabled bool, tags

resource "elasticstack_kibana_slo" "test_slo" {
name = "%s"
slo_id = "fully-sick-slo"
description = "fully sick SLO"

%s
Expand Down