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.