title: How to give ElasticBeanstalk access to AWS CodeCommit
body: <p>I am deploying a Flask application to ElasticBeanstalk. One of the dependencies of this application is a package that should be installed from a CodeCommit git repository. </p>
  
  <p>Locally, I have successfully set up SSH to connect to the CodeCommit repo to <code>pip install</code> and push code. I have added the package to <code>requirements.txt</code>, and locally this installs fine with <code>pip</code>. </p>
  
  <p>The question is, how should I configure EBS to have SSH access to this repo? </p>
  
  <p>I see the IAM role used by EBS is <code>aws-elasticbeanstalk-ec2-role</code>. I attached the <code>AWSCodeCommitReadOnly</code> policy to this role, but to no avail. </p>
  
  <p>In the <code>eb-activity.log</code> it gives an SSH error when trying to get the package from CodeCommit:</p>
  
  <pre><code>Host key verification failed.
  fatal: Could not read from remote repository.
  Please make sure you have the correct access rights and the repository exists.
  </code></pre>
  
  <p>How should I configure access to AWS CodeCommit from EBS? </p>