I am trying to fetch a private repo as a library from AWS CodeCommit in my go.mod file as part of the build stage in my Gitlab pipeline.
I am using the the following in the Gitlab stage:
before_script:
- go env -w GOPRIVATE=source.org.gitlab,git-codecommit.us-east-1.amazonaws.com
- git config --global credential.helper '!aws codecommit credential-helper $@'
- git config --global credential.helper '!aws codecommit --region us-east-1 credential-helper $@'
- git config --global credential.UseHttpPath true
- git config --global user.email "test@email.com"
- git config --global user.name "username"
I have also set the AWS_SECRET_KEY, AWS_ACCESS_KEY and AWS_DEFAULT REGION as env variables in my Gitlab repo. For the access key and secret key, I am using an IAM User which has access to AWS CodeCommit.
However, I am getting the following error:
fatal: unable to connect to git-codecommit.us-east-1.amazonaws.com:
git-codecommit.us-east-1.amazonaws.com[0: 52.94.204.165]: errno=Connection refused
I am not really sure what is going wrong here. Any hints/directions would be appreciated. Thank you.