75.1k views
2 votes
Creating IAM Role MalformedPolicyDocument: Condition can contain only one colon

1 Answer

0 votes

Final answer:

The 'MalformedPolicyDocument' error in IAM policies arises when there's incorrect syntax in the condition block. Each condition operator should only contain one colon, separating the condition key from the condition value. The syntax must be corrected for the IAM role creation to succeed.

Step-by-step explanation:

The MalformedPolicyDocument error message you are encountering while creating an IAM role suggests that there is an issue with the syntax of the policy document you're trying to implement. In IAM policy language, conditions are used to specify the circumstances under which a policy grants permission. The error indicates that your condition block contains more than one colon, but according to the IAM policy grammar, a condition operator can only contain one colon. You will need to review your policy document and correct the syntax, ensuring that each condition operator only has a single colon separating the condition key from the condition value. For example, "aws:RequestTag/tag-key": "tag-value" is the correct syntax.

User Matt Olan
by
7.3k points