Skip to content

Commit

Permalink
update regex for custom properties. update docs. (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
greatestusername authored Apr 23, 2024
1 parent 7671546 commit 016cc3f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/resources/create_api_check_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<a id="nestedblock--test--custom_properties"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/create_browser_check_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
1 change: 0 additions & 1 deletion docs/resources/create_location_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
```
Expand Down
5 changes: 3 additions & 2 deletions synthetics/resource_api_check_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"),
},
},
},
Expand Down
5 changes: 3 additions & 2 deletions synthetics/resource_browser_check_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions synthetics/resource_http_check_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions synthetics/resource_port_check_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
},
},
Expand Down

0 comments on commit 016cc3f

Please sign in to comment.