From 3aeb8962c1027b80626201b287fca178fabd40c0 Mon Sep 17 00:00:00 2001 From: Ryan Dyer Date: Fri, 17 Oct 2025 07:44:32 -0500 Subject: [PATCH] Remove pattern patching to match documentation and allow other aws partitions to work Signed-off-by: Ryan Dyer --- kms/keysource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kms/keysource.go b/kms/keysource.go index bdb9637220..8b7c7f4558 100644 --- a/kms/keysource.go +++ b/kms/keysource.go @@ -108,8 +108,8 @@ func NewMasterKeyWithProfile(arn string, role string, context map[string]*string func NewMasterKeyFromArn(arn string, context map[string]*string, awsProfile string) *MasterKey { key := &MasterKey{} arn = strings.Replace(arn, " ", "", -1) + roleIndex := strings.Index(arn, "+") key.Arn = arn - roleIndex := strings.Index(arn, "+arn:aws:iam::") if roleIndex > 0 { // Overwrite ARN key.Arn = arn[:roleIndex]