I am trying to create an AWS IoT Policy using the command: 'aws iot create-policy --policy-name "PubSubToAnyTopic" --policy-document file://path-to-your-policy-document'.
For some reason I can't get around the following: A client error (MalformedPolicyException) occurred when calling the CreatePolicy operation: Policy document is Malformed. I believe I've verified the path to the json file is correct with echo $(pwd)/file.json.
The AWS json code is below
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["iot:*"],
"Resource": ["*"]
}]
}
I've tried numerous changes (spacing, additional lines in between [ & {, etc..) but still can't create the policy. Tried vi & nano as well. Has anyone seen this error before? Thanks