From b571cc44e3b715220de4ac7857195d9d0e303843 Mon Sep 17 00:00:00 2001 From: jeremyh Date: Mon, 22 Apr 2024 12:53:58 -0400 Subject: [PATCH] update regex for custom properties. update docs. --- docs/resources/create_api_check_v2.md | 2 +- docs/resources/create_browser_check_v2.md | 2 +- docs/resources/create_location_v2.md | 1 - synthetics/resource_api_check_v2.go | 5 +++-- synthetics/resource_browser_check_v2.go | 5 +++-- synthetics/resource_http_check_v2.go | 4 ++-- synthetics/resource_port_check_v2.go | 4 ++-- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/resources/create_api_check_v2.md b/docs/resources/create_api_check_v2.md index 48f9365..63a7af4 100644 --- a/docs/resources/create_api_check_v2.md +++ b/docs/resources/create_api_check_v2.md @@ -168,7 +168,7 @@ Required: Optional: - `custom_properties` (Block Set) (see [below for nested schema](#nestedblock--test--custom_properties)) -- `requests` (Block List) (see [below for nested schema](#nestedblock--test--requests)) +- `requests` (Block List) Unique elements of a given request. See official [API documentation](https://dev.splunk.com/observability/reference/api/synthetics_api_tests/latest#endpoint-createapitest) as the source of truth for descriptions and options for these values. (see [below for nested schema](#nestedblock--test--requests)) - `scheduling_strategy` (String) diff --git a/docs/resources/create_browser_check_v2.md b/docs/resources/create_browser_check_v2.md index 56b98d0..6b05936 100644 --- a/docs/resources/create_browser_check_v2.md +++ b/docs/resources/create_browser_check_v2.md @@ -254,7 +254,7 @@ Optional: Required: -- `steps` (Block List, Min: 1) (see [below for nested schema](#nestedblock--test--transactions--steps)) +- `steps` (Block List, Min: 1) Unique steps for the transaction. See official [API documentation](https://dev.splunk.com/observability/reference/api/synthetics_browser/latest#endpoint-createbrowsertest) as the source of truth for descriptions and options for these values. (see [below for nested schema](#nestedblock--test--transactions--steps)) Optional: diff --git a/docs/resources/create_location_v2.md b/docs/resources/create_location_v2.md index 995a12c..5f85608 100644 --- a/docs/resources/create_location_v2.md +++ b/docs/resources/create_location_v2.md @@ -17,7 +17,6 @@ resource "synthetics_create_location_v2" "location_v2_foo" { location { id = "private-aws-awesome-east" label = "awesome aws east location" - country = "IE" } } ``` diff --git a/synthetics/resource_api_check_v2.go b/synthetics/resource_api_check_v2.go index 1961240..29f5fd2 100644 --- a/synthetics/resource_api_check_v2.go +++ b/synthetics/resource_api_check_v2.go @@ -66,6 +66,7 @@ func resourceApiCheckV2() *schema.Resource { "requests": { Type: schema.TypeList, Optional: true, + Description: "Unique elements of a given request. See official [API documentation](https://dev.splunk.com/observability/reference/api/synthetics_api_tests/latest#endpoint-createapitest) as the source of truth for descriptions and options for these values.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "configuration": { @@ -202,12 +203,12 @@ func resourceApiCheckV2() *schema.Resource { "key": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z]\w{1,128}$`), "custom_properties key must start with a letter and only consist of alphanumeric and underscore characters with no whitespace"), + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z](\w|-|_){1,128}$`), "custom_properties key must start with a letter and only consist of alphanumeric and underscore characters with no whitespace"), }, "value": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.StringMatch(regexp.MustCompile(`^\w{1,256}$`), "custom_properties value can only consist of alphanumeric and underscore characters with no whitespace"), + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9](\w|_){1,128}$`), "custom_properties value can only consist of alphanumeric and underscore characters with no whitespace"), }, }, }, diff --git a/synthetics/resource_browser_check_v2.go b/synthetics/resource_browser_check_v2.go index b51cba1..16663ec 100644 --- a/synthetics/resource_browser_check_v2.go +++ b/synthetics/resource_browser_check_v2.go @@ -193,6 +193,7 @@ func resourceBrowserCheckV2() *schema.Resource { "steps": { Type: schema.TypeList, Required: true, + Description: "Unique steps for the transaction. See official [API documentation](https://dev.splunk.com/observability/reference/api/synthetics_browser/latest#endpoint-createbrowsertest) as the source of truth for descriptions and options for these values.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { @@ -271,12 +272,12 @@ func resourceBrowserCheckV2() *schema.Resource { "key": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z]\w{1,128}$`), "custom_properties key must start with a letter and only consist of alphanumeric and underscore characters with no whitespace"), + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z](\w|-|_){1,128}$`), "custom_properties key must start with a letter and only consist of alphanumeric and underscore characters with no whitespace"), }, "value": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.StringMatch(regexp.MustCompile(`^\w{1,256}$`), "custom_properties value can only consist of alphanumeric and underscore characters with no whitespace"), + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9](\w|_){1,128}$`), "custom_properties value can only consist of alphanumeric and underscore characters with no whitespace"), }, }, }, diff --git a/synthetics/resource_http_check_v2.go b/synthetics/resource_http_check_v2.go index 91da00e..52e6247 100644 --- a/synthetics/resource_http_check_v2.go +++ b/synthetics/resource_http_check_v2.go @@ -176,12 +176,12 @@ func resourceHttpCheckV2() *schema.Resource { "key": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z]\w{1,128}$`), "custom_properties key must start with a letter and only consist of alphanumeric and underscore characters with no whitespace"), + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z](\w|-|_){1,128}$`), "custom_properties key must start with a letter and only consist of alphanumeric and underscore characters with no whitespace"), }, "value": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.StringMatch(regexp.MustCompile(`^\w{1,256}$`), "custom_properties value can only consist of alphanumeric and underscore characters with no whitespace"), + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9](\w|_){1,128}$`), "custom_properties value can only consist of alphanumeric and underscore characters with no whitespace"), }, }, }, diff --git a/synthetics/resource_port_check_v2.go b/synthetics/resource_port_check_v2.go index 2b7fa49..dedbc7b 100644 --- a/synthetics/resource_port_check_v2.go +++ b/synthetics/resource_port_check_v2.go @@ -108,12 +108,12 @@ func resourcePortCheckV2() *schema.Resource { "key": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z]\w{1,128}$`), "custom_properties key must start with a letter and only consist of alphanumeric and underscore characters with no whitespace"), + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z](\w|-|_){1,128}$`), "custom_properties key must start with a letter and only consist of alphanumeric and underscore characters with no whitespace"), }, "value": { Type: schema.TypeString, Optional: true, - ValidateFunc: validation.StringMatch(regexp.MustCompile(`^\w{1,256}$`), "custom_properties value can only consist of alphanumeric and underscore characters with no whitespace"), + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9](\w|_){1,128}$`), "custom_properties value can only consist of alphanumeric and underscore characters with no whitespace"), }, }, },