title: Attach policy to a IAM Role
body: <p>Following cloudformation template gives error on line 9 :</p>
  
  <pre><code>{
  "AWSTemplateFormatVersion" : "2010-09-09",
  "Description" : "Policy to allow send receive message from SQS Queue",
  "Resources" : {
  "MyPolicy" : {
    "Type" : "AWS::IAM::Policy",
      "Properties" : {
          "PolicyName" : "CFUsers",
          "Roles": [ { "arn:aws:iam::710161973367:role/Cognito_CFIAuth_Role" } ],
          "PolicyDocument" : {
              "Version" : "2012-10-17",
              "Statement": [
              {
                  "Sid": "Sid1482400105445",
                  "Effect": "Allow",
                  "Principal": {
                      "AWS":         "arn:aws:iam::710161973367:role/Cognito_CFIAuth_Role"
                  },
                  "Action": [
                      "SQS:SendMessage",
                      "SQS:ReceiveMessage",
                      "SQS:DeleteMessage",
                      "SQS:GetQueueUrl"
                  ],
                  "Resource": "arn:aws:sqs:ap-south-1:710161973367:CFI-Trace"
              }
              ]
          }
      }
   }
   }
  </code></pre>
  
  <p>I want role Cognito_CFIAuth_Role to have message send/read/delete previleges on SQS queue CFI-Trace. How do I attach SQS operation privileges to IAM Role ? </p>