Clone aws codecommit repo using chef


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 ‘’ .

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

When tried to clone from the command line it works.

helps would be appreciated

You may wanna check which user is chef-client running with and if that user has aws configuration added into .gitconfig file or not. Also check what credential manager is being used? Share some logs, that helps at times.

Please don’t cross-post on here and SO until at least some time has passed, most of us that watch also watch the other.

Posted on both places to get a quick response as its urgent my friend.

Chef client is running under root user. and the aws credentials and .gitconfig are stored under /root/.aws/ and /root/.gitconfig respectively.

Error reported

       Expected process to exit with [0], but received '128'
       ---- Begin output of "bash"  "/tmp/chef-script20171227-27351-v4c747" ----
       STDERR: Cloning into 'lead-engine-intake'...
       fatal: could not read Username for '': No such device or address
       ---- End output of "bash"  "/tmp/chef-script20171227-27351-v4c747" ----
       Ran "bash"  "/tmp/chef-script20171227-27351-v4c747" returned 128

I tried to run the git clone with chef’s bash resource as well. same error.

Detailed chef recipe

cookbook_file '/root/.gitconfig' do
  source 'gitconfig'
  owner 'root'
  group 'root'
  mode '0755'
  action :create

cloudcli_aws_credentials '/root/.aws/credentials' do
  owner 'root'
  group 'root'
  mode 0600
    aws_access_key_id: 'xxxxxxxxxxx',
    aws_secret_access_key: 'xxxxxxxx',
    region: 'us-east-1'

git config file

[filter "lfs"]
        required = true
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge -- %f
        process = git-lfs filter-process

        helper = !aws codecommit credential-helper $@
        UseHttpPath = true

If it is urgent, you can purchase a support contract from Chef Software Inc. See for details. Or I’m sure many other places will sell you a commercial support incident.

Brother. Ultimate goal to come here is to get my problem solved. So please help. It will be appreciated.

Then pick one place and ask there. Though you can probably now consider yourself persona non grata by virtue of being rude to support volunteers. Maybe someone else will help you.

Did I sound rude? I’m sorry if you get offended by my words. i didt mean to be rude, its my bad English , sorry :frowning: