Skip to content

Commit

Permalink
feat(#8): adds validation for phone_number on action resources
Browse files Browse the repository at this point in the history
closes #8
  • Loading branch information
HarryEMartland committed Aug 8, 2020
1 parent 360c478 commit 571a2d2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions appdynamics/resource_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package appdynamics
import (
"github.com/HarryEMartland/terraform-provider-appdynamics/appdynamics/client"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"regexp"
"strconv"
"strings"
)
Expand Down Expand Up @@ -46,8 +48,9 @@ func resourceAction() *schema.Resource {
},
},
"phone_number": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringMatch(regexp.MustCompile("^\\d{10,}$"), "Phone number must match regex ^\\d{10,}$"),
},
"http_request_template_name": {
Type: schema.TypeString,
Expand Down

0 comments on commit 571a2d2

Please sign in to comment.