Skip to content

Commit

Permalink
update per comments
Browse files Browse the repository at this point in the history
Signed-off-by: ziyeqf <51212351+ziyeqf@users.noreply.github.com>
  • Loading branch information
ziyeqf committed Sep 27, 2023
1 parent 1f1c3e2 commit 6c0bf1d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package servicenetworking
import (
"context"
"fmt"
"regexp"
"time"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
Expand Down Expand Up @@ -35,7 +36,7 @@ func (t ApplicationLoadBalancerResource) Arguments() map[string]*schema.Schema {
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringIsNotEmpty,
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,62}[a-zA-Z0-9]$`), "the name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens. The value must be 1-64 characters long."),
},

"resource_group_name": commonschema.ResourceGroupName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ resource "azurerm_resource_group" "test" {

func (r ApplicationLoadBalancerResource) basic(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {
}
}
%s
resource "azurerm_application_load_balancer" "test" {
Expand All @@ -127,6 +132,11 @@ resource "azurerm_application_load_balancer" "test" {

func (r ApplicationLoadBalancerResource) complete(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {
}
}
%s
resource "azurerm_application_load_balancer" "test" {
Expand All @@ -142,6 +152,11 @@ resource "azurerm_application_load_balancer" "test" {

func (r ApplicationLoadBalancerResource) requiresImport(data acceptance.TestData) string {
return fmt.Sprintf(`
provider "azurerm" {
features {
}
}
%s
resource "azurerm_application_load_balancer" "import" {
Expand Down

0 comments on commit 6c0bf1d

Please sign in to comment.