My user has a policy that allows him to iam:CreateRole and iam:DeleteRole but when I launch this command :
aws iam create-role --role-name MyRole --path /projects/ --assume-role-policy-document file://MyRoleTrust.json
But I have this error :
An error occcured (ValidationError) when calling the CreateRole operation: The specified value for path is invalid.It must begin and end with / and contain only alphanumeric characters and / or / characters.
But I have policies using this condition with this type of arn : "arn:aws:iam::<account-id>:role/projects/*"
. It means that this /projects/* should exist.
So why do I get this error...I'm a bit confused. Thanks for you replies.
Looks like you are using Windows as your OS. And command line tool is a something like Git for Windows with bash emulation.
Same bug is mentioned in GitHub. The problem is that mingw trying to be smart, and converting paths
Here are three possible solutions:
MSYS_NO_PATHCONV=1
to disable path conversions/projects/
parameter by adding extra /
(//projects/
)