mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
validate aws_alb_target_group name is less than 32 characters (#11699)
This commit is contained in:
parent
1ab38ceae5
commit
64e2381cb2
@ -37,9 +37,10 @@ func resourceAwsAlbTargetGroup() *schema.Resource {
|
||||
},
|
||||
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: validateAwsAlbTargetGroupName,
|
||||
},
|
||||
|
||||
"port": {
|
||||
@ -436,6 +437,14 @@ func validateAwsAlbTargetGroupHealthCheckProtocol(v interface{}, k string) (ws [
|
||||
return
|
||||
}
|
||||
|
||||
func validateAwsAlbTargetGroupName(v interface{}, k string) (ws []string, errors []error) {
|
||||
name := v.(string)
|
||||
if len(name) > 32 {
|
||||
errors = append(errors, fmt.Errorf("%q (%q) cannot be longer than '32' characters", k, name))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func validateAwsAlbTargetGroupPort(v interface{}, k string) (ws []string, errors []error) {
|
||||
port := v.(int)
|
||||
if port < 1 || port > 65536 {
|
||||
|
Loading…
Reference in New Issue
Block a user