AWS CodeCommit

AWS Configure profile

aws configure --profile "your username"

https://docs.aws.amazon.com/ko_kr/cli/latest/userguide/cli-configure-profiles.html

git clone 자격 증명 문제

https://docs.aws.amazon.com/ko_kr/codecommit/latest/userguide/troubleshooting-ch.html#troubleshooting-macoshttps

Setup for HTTPS users using Git credentials

https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html#setting-up-gc-iam

로컬 환경에서 codecommit 소스 클론하기

인스턴스가 아니라 일반 로컬 환경에서 codecommit 소스를 클론하는 경우 인증 profile을 다음과 같이 git config에 적용할 수 있다.

vi ~/.gitconfig

gitconfig 파일에 아래와 같은 내용을 추가한다. ProfileName은 본인이 사용하는 aws profile을 사용한다.

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

인스턴스에서 codecommit 소스 클론하기

인스턴스에 적용된 보안그룹이 codecommit에 access 가능한 정책을 연결하였다면 아래와 같이 인스턴스 내에서 git config 설정을 해주어야 https 프로토콜을 이용해 소스코드를 클론하는 것이 가능하다.

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

위 설정을 하지 않으면 아래와 같이 Username과 Password를 묻는 절차가 생긴다.

Username for 'https://git-codecommit.ap-northeast-2.amazonaws.com':

참고

https://docs.aws.amazon.com/ko_kr/codecommit/latest/userguide/setting-up-https-unixes.html

Leave a Reply