Skip to content

Commit

Permalink
Add validation for game_session_queue.notification_target
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinidu committed Jun 29, 2022
1 parent 571a893 commit 3c164b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/service/gamelift/game_session_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package gamelift
import (
"fmt"
"log"
"regexp"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/gamelift"
Expand Down Expand Up @@ -37,8 +38,9 @@ func ResourceGameSessionQueue() *schema.Resource {
ValidateFunc: validation.StringLenBetween(1, 128),
},
"notification_target": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^arn:aws:sns:[^:]*:\d{12}:[a-z0-9-_]+$`), "valid SNS topic ARN must be provided"),
},
"player_latency_policy": {
Type: schema.TypeList,
Expand Down

0 comments on commit 3c164b5

Please sign in to comment.