Skip to content

Commit

Permalink
use validateArn instead of regex pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
richardjennings committed May 26, 2021
1 parent b6aceba commit 3f11872
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions aws/resource_aws_ec2_capacity_reservation.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package aws
import (
"fmt"
"log"
"regexp"
"time"

"github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -100,14 +99,9 @@ func resourceAwsEc2CapacityReservation() *schema.Resource {
ForceNew: true,
},
"outpost_arn": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.All(
validation.StringMatch(
regexp.MustCompile(`^arn:aws([a-z-]+)?:outposts:[a-z\d-]+:\d{12}:outpost/op-[a-f0-9]{17}$`),
"must match ^arn:aws([a-z-]+)?:outposts:[a-z\\d-]+:\\d{12}:outpost/op-[a-f0-9]{17}$",
),
),
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateArn,
},
"owner_id": {
Type: schema.TypeString,
Expand Down

0 comments on commit 3f11872

Please sign in to comment.