How to access Account A's CodeCommit repository from Account B
Prerequisite:
- You need to have been granted a Role in Account A as Cross Account access with the necessary permission to access all or specific CodeCommit repository
- The instruction is meant for access from Windows, adjust accordingly if you are doing this from Linux or Mac
Create an User in your own account with Programmatic Access with (at least) STS:AssumeRole
Download Access Key
- Go to IAM >> Users
- Go to Security Credentials
- Create Access Key
Install AWS CLI and install with default settings
https://aws.amazon.com/cli/Install git and install with default settings
https://git-scm.com/downloadsYou can use this for reference if you are not familiar with git
http://rogerdudler.github.io/git-guide/Configure AWS CLI
- Open Command Prompt (or powershell)
- Run aws configure, provide as follows
- Go to your personal directory (c:\users\name\.aws) - you will need to show hidden files
- Open credentials files in text editor and replace content with following:
- AAAAAAAAAA - Account ID of Account A
- 99999999999999 - Your Given Role Name in Account A
- xxxxxxxxxxxxx - keys generated from above
Configure Git
- Go to your personal directory (c:\users\name) and open .gitconfig in text editor
- Make sure your region matches
- Open git command prompt and test your connection
- Press Cancel when you receive username/password prompt from Git Credential Manager (if installed)
No comments:
Post a Comment