Skip to content

Commit

Permalink
ec2/spot_fleet_request: regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Sep 8, 2023
1 parent cc8906a commit 6b1bee6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/service/ec2/ec2_spot_fleet_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@ func testAccCheckSpotFleetRequest_IAMInstanceProfileARN(sfr *ec2.SpotFleetReques
return fmt.Errorf("Expected IamInstanceProfile to be set, got nil")
}
//Validate the string whether it is ARN
re := regexache.MustCompile(fmt.Sprintf(`arn:%s:iam::\d{12}:instance-profile/?[0-9A-Za-z_+=,.@-].*`, acctest.Partition()))
re := regexache.MustCompile(fmt.Sprintf(`arn:%s:iam::\d{12}:instance-profile/?[0-9A-Za-z@-_+=,.].*`, acctest.Partition())) // regex seems suspicious, @-_ is a range
if !re.MatchString(*profile.Arn) {
return fmt.Errorf("Expected IamInstanceProfile input as ARN, got %s", *profile.Arn)
}
Expand Down

0 comments on commit 6b1bee6

Please sign in to comment.