Skip to content

Commit

Permalink
Replace custom validation functions with standard helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Apr 4, 2018
1 parent 7e983ed commit f147424
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aws/resource_aws_launch_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/hashicorp/terraform/helper/hashcode"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
)

func resourceAwsLaunchConfiguration() *schema.Resource {
Expand All @@ -34,14 +35,14 @@ func resourceAwsLaunchConfiguration() *schema.Resource {
Computed: true,
ForceNew: true,
ConflictsWith: []string{"name_prefix"},
ValidateFunc: validateMaxLength(255),
ValidateFunc: validation.StringLenBetween(1, 255),
},

"name_prefix": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: validateMaxLength(255 - resource.UniqueIDSuffixLength),
ValidateFunc: validation.StringLenBetween(1, 255-resource.UniqueIDSuffixLength),
},

"image_id": {
Expand Down Expand Up @@ -82,7 +83,7 @@ func resourceAwsLaunchConfiguration() *schema.Resource {
return ""
}
},
ValidateFunc: validateMaxLength(16384),
ValidateFunc: validation.StringLenBetween(1, 16384),
},

"security_groups": {
Expand Down

0 comments on commit f147424

Please sign in to comment.