Skip to content

Commit

Permalink
azurerm_active_directory_domain_service - domain_name now support…
Browse files Browse the repository at this point in the history
…s a length of `30` (hashicorp#21555)
  • Loading branch information
mariussm authored and xiaxyi committed Apr 28, 2023
1 parent ce928e9 commit 6302ca1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func DomainServiceName(input interface{}, key string) (warnings []string, errors
return
}

p := regexp.MustCompile(`^(([0-9a-zA-Z])|(([0-9a-zA-Z][0-9a-zA-Z-]{0,13}[0-9a-zA-Z])))(\.[0-9a-zA-Z-]+)+$`)
p := regexp.MustCompile(`^(([0-9a-zA-Z])|(([0-9a-zA-Z][0-9a-zA-Z-]{0,28}[0-9a-zA-Z])))(\.[0-9a-zA-Z-]+)+$`)
if !p.MatchString(v) {
errors = append(errors, fmt.Errorf("domain_name must be a valid FQDN and the first element must be 15 or fewer characters"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func TestDomainServiceName(t *testing.T) {
},

{
// subdomain longer than 15
Input: strings.Repeat("a", 16) + ".com",
// subdomain longer than 30
Input: strings.Repeat("a", 31) + ".com",
Valid: false,
},

Expand All @@ -55,7 +55,7 @@ func TestDomainServiceName(t *testing.T) {

{
// wide length subdomain
Input: strings.Repeat("a", 15) + ".com",
Input: strings.Repeat("a", 30) + ".com",
Valid: true,
},

Expand Down Expand Up @@ -85,7 +85,7 @@ func TestDomainServiceName(t *testing.T) {

{
// wide length subdomain
Input: strings.Repeat("a", 14) + ".com",
Input: strings.Repeat("a", 29) + ".com",
Valid: true,
},
}
Expand Down

0 comments on commit 6302ca1

Please sign in to comment.