amazon web services - AWS malformed policy error -


i trying set aws group policy via aws cli so:

aws iam put-group-policy --group-name my-group --policy-name s3-full-access --policy-document /tmp/policy.json 

this content of /tmp/policy.json:

{   "version": "2012-10-17",   "statement": [     {       "action": [         "s3:listallmybuckets"       ],       "effect": "allow",       "resource": "arn:aws:s3:::*"     },     {       "action": "s3:*",       "effect": "allow",       "resource": "arn:aws:s3:::my-bucket*"     }   ] } 

i keep getting following error:

a client error (malformedpolicydocument) occurred when calling putgrouppolicy operation: policy not in valid json format. 

i don not know how proceed, error unspecific. able help?

solved riddle!

there has file:// prefix in front of policy file name:

aws iam put-group-policy --group-name my-group --policy-name s3-full-access --policy-document file:///tmp/policy.json 

the original error message misleading, same message if provide filename does not exist @ all.

so not syntax of policy in file fact cli not see file @ all, causes error.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -