title: Creating an ec2 instance along with IAM roles using cloud formation
body: <p>I'm very new to Amazon cloudformation technique. I'm trying to launch an ec2 instance along with the IAM roles.</p>
  
  <p>I have cloudformation script for this. But the problem I face is the IAM roles and Ec2 instances are created, but they aren't tied with each other.</p>
  
  <p>I did create the IAM-roles using <code>AWS::IAM::Role</code> and <code>AWS::IAM::InstanceProfile</code>. </p>
  
  <p>Is there any other command that I should use?</p>
  
  <p>Thanks in advance.</p>