27

I am new to Amazon Web Services world, and I am implementing Continuous Delivery to the company I work for.

I followed AWS's [instructions to configure CodeCommit Service] (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-windows.html#setting-up-https-windows-account)

Step 1: Initial Configuration for AWS CodeCommit

To create and configure an IAM user for accessing AWS CodeCommit: I created a new IAM user and gave him AWSCodeCommitFullAccess

To install and configure the AWS CLI :

I installed and configured the credentials doing aws configure. Setting AWS Access Key ID, AWS Secret Access Key, Default region name to us-east-1 and de

Step 2: Install Git I installed Git For Windows making sure the Enable Git Credential Manager option was cleared.

Step 3: Set Up the Credential Helper

git config --global credential.helper "!aws codecommit credential-helper $@"
git config --global credential.UseHttpPath true

Executing:

git config --global --edit

My Configuration is:

[http]
  sslVerify = false
[credential]<br> 
  helper = "aws codecommit list-repositories codecommit credential-helper "
  UseHttpPath = true

Step 4: Connect to the AWS CodeCommit Console and Clone the Repository

    $ git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/teste-git-to-s3<br>
    Cloning into 'teste-git-to-s3'...<br>
    git: 'credential-aws' is not a git command. See 'git --help'.<br>
    Username for 'https://git-codecommit.us-east-1.amazonaws.com/v1/repos/teste-git-to-s3': Lucas<br>
    fatal: unable to access 'https://git-codecommit.us-east-1.amazonaws.com/v1/repos/teste-git-to-s3/': The requested URL returned error: 403

Looking for AWS troubleshooting, I found: Troubleshooting AWS CodeCommit but I couldn't solve it.

How can this be solved?

Bostone
  • 36,858
  • 39
  • 167
  • 227
Lucas Amorim Silva
  • 567
  • 1
  • 7
  • 14

3 Answers3

29

I think the issue is in your .gitconfig file. Change it to below and it should work.

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

By the way, if you are using a Bash emulator instead of the Windows command line, you must use single quotes instead of double quotes.

Let me know if this doesn't work.

Hsiao-Tung Chen
  • 316
  • 3
  • 3
  • 1
    Open a command prompt and use Git to run git config, specifying the use of the Git credential helper with the AWS credential profile, which enables the Git credential helper to send the path to repositories: `git config --global credential.helper "!aws codecommit credential-helper $@"` If you are using a Bash emulator instead of the Windows command line, you must use single quotes instead of double quotes. http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-windows.html#setting-up-https-windows-credential-helper – shrimpwagon Apr 17 '17 at 16:32
  • I use ZSH and I had the same issue. – emurano Mar 30 '19 at 13:10
0

If you are using cygwin, after you created the repository, click the connect info button, select linux instead of windows, it works on mine.

Downhillski
  • 2,555
  • 2
  • 27
  • 39
0

I experienced this problem with Python 3.8.x - make sure you are using Python 3.7.x instead, as shown in the docs

Andrew
  • 580
  • 5
  • 13