Skip to content

Commit

Permalink
r/aws_dynamodb_table: Use '_Values()' functions (#14601).
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Nov 8, 2022
1 parent de8b20f commit 93b9b2f
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions internal/service/dynamodb/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func ResourceTable() *schema.Resource {
Read: resourceTableRead,
Update: resourceTableUpdate,
Delete: resourceTableDelete,

Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Expand Down Expand Up @@ -123,13 +124,9 @@ func ResourceTable() *schema.Resource {
Required: true,
},
"type": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{
dynamodb.ScalarAttributeTypeB,
dynamodb.ScalarAttributeTypeN,
dynamodb.ScalarAttributeTypeS,
}, false),
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice(dynamodb.ScalarAttributeType_Values(), false),
},
},
},
Expand Down Expand Up @@ -339,13 +336,7 @@ func ResourceTable() *schema.Resource {
value := v.(string)
return strings.ToUpper(value)
},
ValidateFunc: validation.StringInSlice([]string{
"",
dynamodb.StreamViewTypeNewImage,
dynamodb.StreamViewTypeOldImage,
dynamodb.StreamViewTypeNewAndOldImages,
dynamodb.StreamViewTypeKeysOnly,
}, false),
ValidateFunc: validation.StringInSlice(append(dynamodb.StreamViewType_Values(), ""), false),
},
"table_class": {
Type: schema.TypeString,
Expand Down

0 comments on commit 93b9b2f

Please sign in to comment.