Skip to content

Commit 378f7b9

Browse files
author
Pedro Montiel
committed
INVS-1146: empty string validations
1 parent af0e6df commit 378f7b9

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

sumologic/resource_sumologic_cse_inventory_entity_group_configuration.go

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,19 @@ func resourceSumologicCSEInventoryEntityGroupConfiguration() *schema.Resource {
1818

1919
Schema: map[string]*schema.Schema{
2020
"criticality": {
21-
Type: schema.TypeString,
22-
Optional: true,
23-
Default: "",
21+
Type: schema.TypeString,
22+
Optional: true,
23+
ValidateFunc: validation.StringIsNotEmpty,
2424
},
2525
"description": {
2626
Type: schema.TypeString,
2727
Optional: true,
28-
Default: "",
2928
},
3029
"group": {
31-
Type: schema.TypeString,
32-
Optional: true,
33-
Default: "",
34-
Deprecated: "The field `group` is deprecated and will be removed in a future release of the provider -- please make usage of `inventory_key`, `inventory_value` instead.",
30+
Type: schema.TypeString,
31+
Optional: true,
32+
ValidateFunc: validation.StringIsNotEmpty,
33+
Deprecated: "The field `group` is deprecated and will be removed in a future release of the provider -- please make usage of `inventory_key`, `inventory_value` instead.",
3534
},
3635
"inventory_type": {
3736
Type: schema.TypeString,
@@ -43,25 +42,29 @@ func resourceSumologicCSEInventoryEntityGroupConfiguration() *schema.Resource {
4342
Required: true,
4443
},
4544
"inventory_key": {
46-
Type: schema.TypeString,
47-
Optional: true,
45+
Type: schema.TypeString,
46+
Optional: true,
47+
ValidateFunc: validation.StringIsNotEmpty,
4848
},
4949
"inventory_value": {
50-
Type: schema.TypeString,
51-
Optional: true,
50+
Type: schema.TypeString,
51+
Optional: true,
52+
ValidateFunc: validation.StringIsNotEmpty,
5253
},
5354
"tag_schema": {
54-
Type: schema.TypeString,
55-
Optional: true,
55+
Type: schema.TypeString,
56+
Optional: true,
57+
ValidateFunc: validation.StringIsNotEmpty,
5658
},
5759
"dynamic_tags": {
5860
Type: schema.TypeBool,
5961
Optional: true,
6062
Default: false,
6163
},
6264
"name": {
63-
Type: schema.TypeString,
64-
Required: true,
65+
Type: schema.TypeString,
66+
Required: true,
67+
ValidateFunc: validation.StringIsNotEmpty,
6568
},
6669
"suppressed": {
6770
Type: schema.TypeBool,
@@ -72,7 +75,8 @@ func resourceSumologicCSEInventoryEntityGroupConfiguration() *schema.Resource {
7275
Type: schema.TypeList,
7376
Optional: true,
7477
Elem: &schema.Schema{
75-
Type: schema.TypeString,
78+
Type: schema.TypeString,
79+
ValidateFunc: validation.StringIsNotEmpty,
7680
},
7781
},
7882
},

0 commit comments

Comments
 (0)