Skip to content

Commit 3ae53fb

Browse files
committed
combine two PRs
1 parent 589d468 commit 3ae53fb

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- Add `slo_id` validation to `elasticstack_kibana_slo` ([#1221](https://github.com/elastic/terraform-provider-elasticstack/pull/1221))
44
- Add `ignore_missing_component_templates` to `elasticstack_elasticsearch_index_template` ([#1206](https://github.com/elastic/terraform-provider-elasticstack/pull/1206))
55
- Prevent provider panic when a script exists in state, but not in Elasticsearch ([#1218](https://github.com/elastic/terraform-provider-elasticstack/pull/1218))
6-
- Fix `namespace` usage in synthetic monitors. Separate Kibana `space_id` the monitor is saved in from the `namespace`, the data stream namespace for Fleet. ([#1247](https://github.com/elastic/terraform-provider-elasticstack/pull/1247))
6+
- Add `namespace` attribute to `elasticstack_kibana_synthetics_monitor` resource to support setting data stream namespace independently from `space_id` ([#1247](https://github.com/elastic/terraform-provider-elasticstack/pull/1247))
77

88
## [0.11.17] - 2025-07-21
99

docs/resources/kibana_synthetics_monitor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ resource "elasticstack_kibana_synthetics_monitor" "my_monitor" {
7272
- `http` (Attributes) HTTP Monitor specific fields (see [below for nested schema](#nestedatt--http))
7373
- `icmp` (Attributes) ICMP Monitor specific fields (see [below for nested schema](#nestedatt--icmp))
7474
- `locations` (List of String) Where to deploy the monitor. Monitors can be deployed in multiple locations so that you can detect differences in availability and response times across those locations.
75-
- `namespace` (String) Fleet namespace, the namespace of a datastream where test documents are stored. Note: if you change its value, kibana creates new datastream. A user needs permissions for new/old datastream in update case to be able to see full monitor history. The `namespace` field should be lowercase and not contain spaces. The namespace must not include any of the following characters: *, \, /, ?, ", <, >, |, whitespace, ,, #, :, or -. Default: `default`
75+
- `namespace` (String) The data stream namespace. Note: if you change its value, kibana creates new datastream. A user needs permissions for new/old datastream in update case to be able to see full monitor history. The `namespace` field should be lowercase and not contain spaces. The namespace must not include any of the following characters: *, \, /, ?, ", <, >, |, whitespace, ,, #, :, or -. Default: `default`
7676
- `params` (String) Monitor parameters. Raw JSON object, use `jsonencode` function to represent JSON
7777
- `private_locations` (List of String) These Private Locations refer to locations hosted and managed by you, whereas locations are hosted by Elastic. You can specify a Private Location using the location’s name.
7878
- `retest_on_failure` (Boolean) Enable or disable retesting when a monitor fails. By default, monitors are automatically retested if the monitor goes from "up" to "down". If the result of the retest is also "down", an error will be created, and if configured, an alert sent. Then the monitor will resume running according to the defined schedule. Using retest_on_failure can reduce noise related to transient problems. Default: `true`.

internal/kibana/synthetics/schema.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"regexp"
78
"strconv"
89

910
"github.com/disaster37/go-kibana-rest/v8/kbapi"
@@ -153,12 +154,18 @@ func monitorConfigSchema() schema.Schema {
153154
Computed: true,
154155
},
155156
"namespace": schema.StringAttribute{
156-
MarkdownDescription: "Fleet namespace, the namespace of a datastream where test documents are stored. Note: if you change its value, kibana creates new datastream. A user needs permissions for new/old datastream in update case to be able to see full monitor history. The `namespace` field should be lowercase and not contain spaces. The namespace must not include any of the following characters: *, \\, /, ?, \", <, >, |, whitespace, ,, #, :, or -. Default: `default`",
157+
MarkdownDescription: "The data stream namespace. Note: if you change its value, kibana creates new datastream. A user needs permissions for new/old datastream in update case to be able to see full monitor history. The `namespace` field should be lowercase and not contain spaces. The namespace must not include any of the following characters: *, \\, /, ?, \", <, >, |, whitespace, ,, #, :, or -. Default: `default`",
157158
Optional: true,
158159
PlanModifiers: []planmodifier.String{
159160
stringplanmodifier.UseStateForUnknown(),
160161
},
161162
Computed: true,
163+
Validators: []validator.String{
164+
stringvalidator.RegexMatches(
165+
regexp.MustCompile(`^[^*\\/?\"<>|\s,#:-]*$`),
166+
"namespace must not contain any of the following characters: *, \\, /, ?, \", <, >, |, whitespace, ,, #, :, or -",
167+
),
168+
},
162169
},
163170
"schedule": schema.Int64Attribute{
164171
Optional: true,

0 commit comments

Comments
 (0)