AWS CodeCommitとは??
Amazon Web Services (AWS) が提供するマネージド型のGitベースのバージョン管理サービスです。開発者は、CodeCommitを使用して、ソースコード、ドキュメント、設定ファイルなどを管理し、安全に共有することができます。
CodeCommitは、高度なセキュリティ機能を備えています。データは暗号化され、IAMユーザーアカウントによるアクセス管理が可能です。また、AWS CodePipeline、AWS CodeBuild、AWS CodeDeployなどのAWSデベロップメントツールと連携して、コンティニュアスデリバリー/デプロイメントパイプラインを構築することもできます。
CodeCommitは、パブリックリポジトリとプライベートリポジトリの両方をサポートしています。パブリックリポジトリは誰でもアクセスできるリポジトリで、プライベートリポジトリはアクセスを許可されたユーザーのみがアクセスできるリポジトリです。プライベートリポジトリの料金は、ストレージ使用量とアクティブユーザー数に基づいています。
リポジトリ作成
CodeCommitにアクセスするとこのような画面が表示されます

右上の「リポジトリ作成」をクリックします

「リポジトリ名」を入力します

作成すると以下の画面が表示されます
これは、ルートユーザを使用して作成しています
メインで使用するのにセキュリティ的にはよろしくないのでIAMユーザを作成して、権限を最小限にしてCodeCommitを使用します

IAMユーザ作成







クライアント設定
Windows

1. Gitインストール
Gitを下記URLからダウンロードしてインストールします
SSH パブリックキーを登録する
WindowsでGit Bashを開きます

以下のコマンドを実行してSSHの鍵を生成します
user@DESKTOP MINGW64 ~
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users//.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users//.ssh/id_rsa
Your public key has been saved in /c/Users//.ssh/id_rsa.pub
The key fingerprint is:
SHA256:53kdOjATi0r5bBmugMIUj015x54VvVxYbW1P9dqXk2k user@DESKTOP
The key's randomart image is:
+---[RSA 3072]----+
| .. o.. +|
| . . .o . o=|
| . o . o .o o .oo|
| * . o.o. = o=|
| o o ooS * oEo|
|o . . = = = o..o|
|... . . * o + . |
| . . o . . |
| . |
+----[SHA256]-----+
$ cd .ssh/
@DESKTOP MINGW64 ~/.ssh
$ ls
config id_rsa id_rsa.pub known_hosts
ユーザのIAMを開きSSH公開キーのアップロードをクリックします

以下のコマンドで公開鍵をメモ帳で表示します
メモ帳に書かれているテキストをコピーします
$ notepad id_rsa.pub
コピーしたテキストをアップロード画面に張り付けします

SSHキーIDをメモして

configファイルをメモ帳で開きます
notepad ~/.ssh/config
Userに先ほどメモしたSSHキーIDを入れて下記のテキストをconfigに入れて保存します
Host git-codecommit.*.amazonaws.com
User APKAEIBAERJR2EXAMPLE
IdentityFile ~/.ssh/id_rsa
コメント