Fix validation of the `name_prefix` parameter of the `aws_alb` resource (#13441)
This parameter is being validated using the wrong validation function, which means that we are incorrectly disallowing a `name_prefix` value ending with a dash.
This commit is contained in:
parent
87ebc19ae5
commit
76b0eefacc
|
@ -48,7 +48,7 @@ func resourceAwsAlb() *schema.Resource {
|
|||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: validateElbName,
|
||||
ValidateFunc: validateElbNamePrefix,
|
||||
},
|
||||
|
||||
"internal": {
|
||||
|
|
|
@ -113,7 +113,7 @@ func TestAccAWSALB_namePrefix(t *testing.T) {
|
|||
testAccCheckAWSALBExists("aws_alb.alb_test", &conf),
|
||||
resource.TestCheckResourceAttrSet("aws_alb.alb_test", "name"),
|
||||
resource.TestMatchResourceAttr("aws_alb.alb_test", "name",
|
||||
regexp.MustCompile("^tf-lb")),
|
||||
regexp.MustCompile("^tf-lb-")),
|
||||
),
|
||||
},
|
||||
},
|
||||
|
@ -851,7 +851,7 @@ resource "aws_security_group" "alb_test" {
|
|||
func testAccAWSALBConfig_namePrefix() string {
|
||||
return fmt.Sprintf(`
|
||||
resource "aws_alb" "alb_test" {
|
||||
name_prefix = "tf-lb"
|
||||
name_prefix = "tf-lb-"
|
||||
internal = true
|
||||
security_groups = ["${aws_security_group.alb_test.id}"]
|
||||
subnets = ["${aws_subnet.alb_test.*.id}"]
|
||||
|
|
Loading…
Reference in New Issue