AWSのCodeCommitを使ってみたら手順通りした(つもり)なのにエラーが出て怒られた話。
通常の手順等はこちらを見てください。
https://qiita.com/3utama/items/04994efa9a79d7aa36e6
で、今回ハマったのはgit pushとかした時に以下エラーが出ました。
$ git push tentatsu master
Enter passphrase for key '/Users/hoge/.ssh/code_commit_key':
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
あれー?なんでだと思ったら、.ssh/configの指定が間違っていたらしい。
Host git-codecommit.*.amazonaws.com
User 1234567890ABCDEFGHIJK # SSH Key ID
IdentityFile ~/.ssh/id_rsa # 秘密鍵のパス
このSSH Key IDというのが勘違いしやすい。
AWSのアカウント名かと思ったら、IAMで見れる以下の赤囲みの部分のことでした。