Skip to content

Commit ee8aaf1

Browse files
committed
CSRE-183: added validations
1 parent d763ced commit ee8aaf1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sumologic/resource_sumologic_data_forwarding.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package sumologic
22

33
import (
44
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
5+
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
56
"log"
67
)
78

@@ -19,8 +20,9 @@ func resourceSumologicDataForwarding() *schema.Resource {
1920
Schema: map[string]*schema.Schema{
2021

2122
"destination_name": {
22-
Type: schema.TypeString,
23-
Required: true,
23+
Type: schema.TypeString,
24+
Required: true,
25+
ValidateFunc: validation.StringLenBetween(1, 255),
2426
},
2527
"description": {
2628
Type: schema.TypeString,
@@ -29,7 +31,6 @@ func resourceSumologicDataForwarding() *schema.Resource {
2931
"bucket_name": {
3032
Type: schema.TypeString,
3133
Required: true,
32-
ForceNew: true,
3334
},
3435
"authentication": {
3536
Type: schema.TypeList,
@@ -38,8 +39,9 @@ func resourceSumologicDataForwarding() *schema.Resource {
3839
Elem: &schema.Resource{
3940
Schema: map[string]*schema.Schema{
4041
"type": {
41-
Type: schema.TypeString,
42-
Required: true,
42+
Type: schema.TypeString,
43+
Required: true,
44+
ValidateFunc: validation.StringInSlice([]string{"RoleBased", "AccessKey"}, false),
4345
},
4446
"role_arn": {
4547
Type: schema.TypeString,

0 commit comments

Comments
 (0)