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
@@ -1,6 +1,7 @@
## [Unreleased]

- Fix secret handling `elasticstack_fleet_integration_policy` resource. ([#821](https://github.com/elastic/terraform-provider-elasticstack/pull/821))
- Fix merge values for `elasticstack_kibana_synthetics_monitor` monitor locations ([#823](https://github.com/elastic/terraform-provider-elasticstack/pull/823)

## [0.11.8] - 2024-10-02

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/kibana_synthetics_monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,4 @@ terraform import elasticstack_kibana_synthetics_monitor.my_monitor <space id>/<m
**NOTE:** Not all monitor fields are supported during the import due-to API limitation.
Full field support could be implemented after this [kibana issue](https://github.com/elastic/kibana/issues/189906) is resolved.

Currently not supported fields during the import: `params`, `retest_on_failure`, `http.proxy_header`, `http.username`, `http.password`, `http.check`, `http.response`, `tcp.check_send`, `tcp.check_receive` and monitor type `browser`
Currently not supported fields during the import: `params`, `retest_on_failure`, `locations`, `http.proxy_header`, `http.username`, `http.password`, `http.check`, `http.response`, `tcp.check_send`, `tcp.check_receive` and monitor type `browser`
8 changes: 3 additions & 5 deletions internal/kibana/synthetics/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,10 @@ func (v *tfModelV0) toModelV0(ctx context.Context, api *kbapi.SyntheticsMonitor)
return nil, dg
}
}
var locLabels []string

var privateLocLabels []string
for _, l := range api.Locations {
if l.IsServiceManaged {
locLabels = append(locLabels, l.Id)
} else {
if !l.IsServiceManaged {
privateLocLabels = append(privateLocLabels, l.Label)
}
}
Expand Down Expand Up @@ -565,7 +563,7 @@ func (v *tfModelV0) toModelV0(ctx context.Context, api *kbapi.SyntheticsMonitor)
Name: types.StringValue(api.Name),
SpaceID: types.StringValue(api.Namespace),
Schedule: types.Int64Value(schedule),
Locations: StringSliceValue(locLabels),
Locations: v.Locations,
PrivateLocations: StringSliceValue(privateLocLabels),
Enabled: types.BoolPointerValue(api.Enabled),
Tags: StringSliceValue(api.Tags),
Expand Down
7 changes: 6 additions & 1 deletion internal/kibana/synthetics/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func TestToModelV0(t *testing.T) {
APMServiceName: "test-service-http",
Timeout: json.Number("30"),
Locations: []kbapi.MonitorLocationConfig{
{Label: "North America - US East", Id: "us_east", IsServiceManaged: true},
{Label: "North America - US East", Id: "us-east4-a", IsServiceManaged: true},
{Label: "test private location", IsServiceManaged: false},
},
Origin: "origin",
Expand Down Expand Up @@ -678,13 +678,17 @@ func TestToModelV0MergeAttributes(t *testing.T) {
{
name: "TCP monitor",
state: tfModelV0{
Locations: []types.String{types.StringValue("us_east")},
TCP: &tfTCPMonitorFieldsV0{
CheckSend: types.StringValue("hello"),
CheckReceive: types.StringValue("world"),
},
},
input: kbapi.SyntheticsMonitor{
Type: kbapi.Tcp,
Locations: []kbapi.MonitorLocationConfig{
{Label: "North America - US East", Id: "us-east4-a", IsServiceManaged: true},
},
},
expected: tfModelV0{
ID: types.StringValue("/"),
Expand All @@ -693,6 +697,7 @@ func TestToModelV0MergeAttributes(t *testing.T) {
Schedule: types.Int64Value(0),
APMServiceName: types.StringValue(""),
TimeoutSeconds: types.Int64Value(0),
Locations: []types.String{types.StringValue("us_east")},
TCP: &tfTCPMonitorFieldsV0{
Host: types.StringValue(""),
SslVerificationMode: types.StringValue(""),
Expand Down
2 changes: 1 addition & 1 deletion templates/resources/kibana_synthetics_monitor.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Import is supported using the following syntax:
**NOTE:** Not all monitor fields are supported during the import due-to API limitation.
Full field support could be implemented after this [kibana issue](https://github.com/elastic/kibana/issues/189906) is resolved.

Currently not supported fields during the import: `params`, `retest_on_failure`, `http.proxy_header`, `http.username`, `http.password`, `http.check`, `http.response`, `tcp.check_send`, `tcp.check_receive` and monitor type `browser`
Currently not supported fields during the import: `params`, `retest_on_failure`, `locations`, `http.proxy_header`, `http.username`, `http.password`, `http.check`, `http.response`, `tcp.check_send`, `tcp.check_receive` and monitor type `browser`
Loading