0

How can i clone aws codecommit repo with chef recipe?

I tried installing AWS CLI and added credentials with codecommit access, then use chef’s git resource to clone the repo. but it fails with could not read Username for ‘https://git-codecommit.us-east-1.amazonaws.com’ .

git "/home/ubuntu/lead_intake" do
  repository node[:app_name][:git_repository]
  action :sync
end

When tried to clone from the command line it works.

helps would be appreciated

Vishnu Prassad
  • 333
  • 1
  • 3
  • 12

1 Answers1

0

First, make sure you have correct Access key ID and Secret access key in IAM -> users -> Security Credentials. Second, put [credential] helper = !aws codecommit credential-helper $@ UseHttpPath = true into .gitconfig file. Third, Both .gitconfig file and .aws directory should in the /root/ . Maybe this is the problem that you have. You put the .gitconfig in the /root/.aws/, which will make credential helper useless. Thus it is asking your Username/Password.

If you have done all the things above, it also fails, I suggest you to use ssh to clone the repository. Follow this documentation http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-unixes.html

Diane
  • 41
  • 4