It is quite possible for the ARN to have more than one / in it due to having an IAM path other than /. For example arn:aws:iam::account-id:instance-profile/mypath/role-name.
This should be accounted for in the split, or perhaps it may be more prudent to just get the current account ID and interpolate that into arn:aws:iam::%s:role.
Current code in question: https://github.com/uswitch/kiam/blob/77d85897e66a0c3ab2d8cbab373a607b371f9865/pkg/aws/sts/resolver_detect_arn.go#L54-L60
It is quite possible for the ARN to have more than one
/
in it due to having an IAM path other than/
. For examplearn:aws:iam::account-id:instance-profile/mypath/role-name
.This should be accounted for in the split, or perhaps it may be more prudent to just get the current account ID and interpolate that into
arn:aws:iam::%s:role
.