Validate connection pool name (#403)
* Validate length of database connection pool name DO currently returns a 500 if the database connection pool name is longer than 60 characters, and their documentation states that it should be between 3 and 63 characters long. * Sort imports * Fix typo
This commit is contained in:
parent
2300b94e63
commit
12af297769
|
@ -32,7 +32,7 @@ func resourceDigitalOceanDatabaseConnectionPool() *schema.Resource {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validation.NoZeroValues,
|
ValidateFunc: validation.StringLenBetween(3, 63),
|
||||||
},
|
},
|
||||||
|
|
||||||
"user": {
|
"user": {
|
||||||
|
|
|
@ -3,11 +3,12 @@ package digitalocean
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/digitalocean/godo"
|
"github.com/digitalocean/godo"
|
||||||
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
|
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
|
||||||
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
|
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
|
||||||
"log"
|
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func resourceDigitalOceanProject() *schema.Resource {
|
func resourceDigitalOceanProject() *schema.Resource {
|
||||||
|
@ -34,7 +35,7 @@ func resourceDigitalOceanProject() *schema.Resource {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "",
|
Default: "",
|
||||||
Description: "the descirption of the project",
|
Description: "the description of the project",
|
||||||
ValidateFunc: validation.StringLenBetween(0, 255),
|
ValidateFunc: validation.StringLenBetween(0, 255),
|
||||||
},
|
},
|
||||||
"purpose": {
|
"purpose": {
|
||||||
|
|
Loading…
Reference in New Issue