- Newest
- Most votes
- Most comments
The error you're encountering suggests that there's an issue with the policy document you're trying to create. Specifically, the error indicates that the resource specified in your policy document is invalid.
This error typically occurs when the policy document contains placeholders or variables that haven't been properly replaced with actual values. In this case, it seems that the placeholder $(jq --raw-output '.roleAliasArn' iot-role-alias.json) is still present in your policy document.
To fix this issue, you need to ensure that all placeholders in your iot-policy-document.json file are replaced with actual values before running the aws iot create-policy command. Here's what you should do:
-
Open your iot-policy-document.json file and locate the line containing the placeholder.
-
Replace the placeholder with the actual Role Alias ARN. You can get this value by running:
jq --raw-output '.roleAliasArn' iot-role-alias.json
-
Make sure you've replaced all other placeholders in the policy document with their corresponding values.
-
Save the updated iot-policy-document.json file.
-
Run the aws iot create-policy command again with the updated policy document.
If you're still having trouble, double-check that the iot-role-alias.json file exists and contains the expected roleAliasArn value. Also, ensure that you have the necessary permissions to create IoT policies and that your AWS CLI is configured correctly with the right credentials and region.
Remember, when working with IoT policies and role aliases, it's crucial to follow AWS best practices for security and to grant only the necessary permissions required for your specific use case.
Sources
Grant permission - Kinesis Video Streams
Troubleshooting Amazon Kinesis Video Streams with WebRTC - Kinesis Video Streams
If you are comfortable, you could post the contents of your iot-policy-document.json file and we could help spot/correct the error.
Relevant content
asked 2 years ago
asked 7 years ago

or maybe just install jq