From a3c785d8d149272f63c96b3d1466159b19e864ca Mon Sep 17 00:00:00 2001 From: Scott Sinclair Date: Sun, 4 Jun 2017 22:41:35 +1000 Subject: [PATCH] Change split on instance profile name This now splits on the /, so we only get the last component of the instance profile name (ignoring paths) --- builtin/credential/aws/path_login.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/credential/aws/path_login.go b/builtin/credential/aws/path_login.go index caffd320f322..a36253aa921b 100644 --- a/builtin/credential/aws/path_login.go +++ b/builtin/credential/aws/path_login.go @@ -472,7 +472,7 @@ func (b *backend) verifyInstanceMeetsRoleRequirements( // Extract out the instance profile name from the instance // profile ARN - iamInstanceProfileARNSlice := strings.SplitAfter(iamInstanceProfileARN, ":instance-profile/") + iamInstanceProfileARNSlice := strings.SplitAfter(iamInstanceProfileARN, "/") iamInstanceProfileName := iamInstanceProfileARNSlice[len(iamInstanceProfileARNSlice)-1] if iamInstanceProfileName == "" {