Occasionally people come across various syntax issues when using the eksutils shell. One way I was able to reproduce these problems is as follows. This is an eksutils shell running on a cloud9 instance that has the proper credentials configured. For some reasons the json in the file isn't being interpreted correctly by the shell (albeit it is properly formatted because jumping back to the standard Cloud9 shell the json can be imported just fine:
max:~/environment $
max:~/environment $ docker run -it --rm -v $HOME/.aws:/root/.aws mreferre/eksutils:latest
sh-4.2#
sh-4.2# aws iam create-policy --policy-name TestPolicyDeleteMe --policy-document https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/v1.1.4/docs/examples/iam-policy.json
An error occurred (MalformedPolicyDocument) when calling the CreatePolicy operation: Syntax errors in policy.
sh-4.2# exit
exit
max:~/environment $ aws iam create-policy --policy-name TestPolicyDeleteMe --policy-document https://raw.githubusercontent.com/kubernetes-sigs/aws-alb-ingress-controller/v1.1.4/docs/examples/iam-policy.json
{
"Policy": {
"PolicyName": "TestPolicyDeleteMe",
"PermissionsBoundaryUsageCount": 0,
"CreateDate": "2020-02-28T10:43:41Z",
"AttachmentCount": 0,
"IsAttachable": true,
"PolicyId": "XXXXXXXXXXXXXXXXX",
"DefaultVersionId": "v1",
"Path": "/",
"Arn": "arn:aws:iam::XXXXXXXXXXXX:policy/TestPolicyDeleteMe",
"UpdateDate": "2020-02-28T10:43:41Z"
}
}
max:~/environment $