1 |
aws codecommit create-repository --repository-name gitlab-mirroring |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
yuta@DESKTOP-V36210S:~$ cat gitlab-mirroring-policy.json{ "Version": "2012-10-17", "Statement" : [ { "Effect" : "Allow", "Action" : [ "codecommit:GitPull", "codecommit:GitPush" ], "Resource" : "arn:aws:codecommit:ap-northeast-1:xxxxxxxxxxxx:gitlab -mirroring" } ] } |
1 2 |
aws iam create-policy --policy-name gitlab-mirroring-policy --policy-document file://gitlab-mirroring-policy.json |
1 2 3 4 5 |
aws iam create-user --user-name gitlab-mirroring-user aws iam attach-user-policy --user-name gitlab-mirroring-user --policy-arn arn:aws:iam::xxxxxxxxxxxx:policy/gitlab-mirroring-policy aws iam create-service-specific-credential --user-name gitlab-mirroring-user --service-name codecommit.amazonaws.com |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
yuta@DESKTOP-V36210S:~$ aws iam create-service-specific-credential --user-name gitlab-mirroring-user --service-name codecommit.amazonaws.com { "ServiceSpecificCredential": { "CreateDate": "2020-07-21T02:38:32+00:00", "ServiceName": "codecommit.amazonaws.com", "ServiceUserName": "gitlab-mirroring-user+1-at-697333814928", "ServicePassword": "g3O0IGoYIHeUNNn3SFxxxxxxxxxxxxxxx55qWQM+ /mEtEQp8=", "ServiceSpecificCredentialId": "ACCA2ExxxxxxxIBBQR27J6B", "UserName": "gitlab-mirroring-user", "Status": "Active" } } yuta@DESKTOP-V36210S:~$ |
GitlabのRepository-settings-Monitoring Repository
URL:https://@git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/gitlab-mirroring
パスワード:aws iamコマンドで取得したパスワード