简体   繁体   中英

git clone to AWS Codecommit repo returns 403

I am trying to clone source code hosted in an AWS Codecommit Repo using HTTP-GRC method.

I have followed this setup guide: https://docs.aws.amazon.com/codecommit/latest/userguide/temporary-access.html?icmpid=docs_acc_console_connect#tc-role

git clone codecommit::us-west-2://my-code-repo 
returns:
Cloning into 'common-ops-cdk'...
fatal: unable to access 'https://git-codecommit.us-west-2.amazonaws.com/v1/repos/my-code-repo/': The requested URL returned error: 403

Here's some info that might come handy understanding what's wrong:

$ git config --list
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=C:/Users/myusername/AppData/Local/Programs/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
pull.rebase=false
credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
credential.helper=!aws codecommit credential-helper $@
credentials.helper=UseHttpPath=true

Any insights will be helpful. Thanks!

You need to create an IAM user with access to CodeCommit, then go to Security Credentials for that user and under the HTTPS Git credentials for AWS CodeCommit section select the Generate Credentials button.

Use these to authenticate against the AWS git repo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM