How to set up custom display of subdomains in aws codecommit?

Let's say I have mydomain.com and I also host this domain on Route 53. I want to set up a subdomain, say git.mydomain.com, pointing to the host codecommit. For example git.mydomain.com => git -codecommit.us-west-2.amazonaws.com

I created a CNAME record on Route 53 for this. I think the DNS was really picking up changes.

Trying "git.mydomain.com"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8020
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;git.mydomain.com.      IN  ANY

;; ANSWER SECTION:
git.mydomain.com.   41  IN  CNAME   git-codecommit.us-west-2.amazonaws.com.

      

However, when I try to clone reop by running

git clone ssh: // git.mydomain.com/v1/repos/reponame

i keep getting

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

      

It works when I just do

git clone SSH: // git -codecommit.us-west-2.amazonaws.com/v1/repos/reponame

Does anyone know how to set this up correctly?

Many thanks.

+3


source to share


2 answers


If you have this problem try adding the following to your ssh config

Host git.yourdomain.com
  User {iam ssh user key id} 
  IdentityFile path/to/id_file

      



In my case, the ssh agent did not choose the default location, so I had to specify it in the config.

+1


source


The git -codecommit.us-west-2.amazonaws.com SSL certificate does not list your domain. Therefore, you cannot use CNAME where SSL is required, such as for SSH or HTTPS. What you are trying will only work for HTTP connections or TCP connections that don't require TLS. See this answer Why is there no way to use CNAME redirection with HTTPS for more information.



0


source







All Articles