How Do You Troubleshoot the Error “An error occurred (InvalidParameterException) when calling the CreateNodegroup operation: The provided nodeRole is invalid.”?

Problem scenario
From the AWS CLI you try to create a node group. But you get this error: "An error occurred (InvalidParameterException) when calling the CreateNodegroup operation: The provided nodeRole is invalid."

Solution
The above can happen when you use a role's name but not the ARN string (such as arn:aws:iam::123456:role/foobar). Use the ARN string of the role instead of what you were using.

You may want to try a command such as this:

aws iam list-roles | jq -r '.Roles[] | select(.AssumeRolePolicyDocument.Statement[].Principal.Service=="eks.amazonaws.com")'

Leave a comment

Your email address will not be published. Required fields are marked *