Skip to content

Commit

Permalink
Updating ARN regex to handle non-standard regions
Browse files Browse the repository at this point in the history
Changing the regex scrip to handle the ARN format in non-standard AWS regions.

The ARN format used in AWS China and GovCloud is different than in other regions.
  • Loading branch information
viggeh authored Apr 29, 2021
1 parent 06a34b0 commit 45d7c49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

var (
configFilePath = fmt.Sprintf("%s/.aws/roles", os.Getenv("HOME"))
roleArnRe = regexp.MustCompile(`^arn:aws:iam::(.+):role/([^/]+)(/.+)?$`)
roleArnRe = regexp.MustCompile(`^arn:aws(-((cn)|(us-gov)))?:iam::(.+):role/([^/]+)(/.+)?$`)
)

func usage() {
Expand Down

0 comments on commit 45d7c49

Please sign in to comment.