title: Put CloudWatch Events rule with CLI
body: <p>I want to stop my EC2 instance everyday with CloudWatch Events.  On console, it works without any problems.  By reverse-engineering the configuration I have done with console, a series of commands which is equivalent to it seems to be the following:</p>
  
  <pre><code>aws events put-rule \
    --name stop-ec2-instance \
    --schedule-expression 'cron(0 13 * * ? *)' \
    --description "Stop EC2 instance everyday" \
    --role-arn arn:aws:iam::012345678901:role/AWS_Events_Actions_Execution
  
  aws events put-targets \
    --rule stop-ec2-instance \
    --targets "[{ \
      \"Arn\": \"arn:aws:automation:ap-northeast-1:012345678901:action/EC2StopInstance/EC2StopInstance_stop-ec2-instance\", \
      \"Id\": \"EC2StopInstance_stop-ec2-instance\", \
      \"Input\": \"\\\"arn:aws:ec2:ap-northeast-1:012345678901:instance/i-01234567\\\"\" \
    }]"
  </code></pre>
  
  <p>.</p>
  
  <p>However, this doesn't work because I get the following error at the first command:</p>
  
  <pre><code>A client error (ValidationException) occurred when calling the PutRule operation: Provided role 'arn:aws:iam::012345678901:role/AWS_Events_Actions_Execution' cannot be assumed by principal 'events.amazonaws.com'.
  </code></pre>
  
  <p>.</p>
  
  <p>How can I put Amazon CloudWatch Events rule with CLI?</p>