Is it possible to clone a CodeCommit repository from a different account in a CodeBuild project?

0

I have a CICD pipeline that is implemented with CodePipeline. The purpose of this pipeline is just cloning terraform code from a CodeCommit repository and deploy the resources specified in the terraform configuration. The problem is some of the terraform configurations are located in another CodeCommit repository in the other account and we want to clone the code from it.

What I already know: I can clone the CodeCommit repository in the same account with the default instance profile in CodeBuild environment.

What I want to know: how can I clone the CodeCommit repository in a different account in CodeBuild environment? In order to specify a repo from a certain account, is using the aws config profile the only way to achieve this?

Andy Wu
asked a month ago110 views
1 Answer
1

Hi Andy,

It certainly is possible to clone a repository from a different account. The documentation page gives the details on how to accomplish this.

Please follow the steps on the page and let me know if that works. I can also help you clone the repository.

Sincerely, Mukul Dharwadkar

profile picture
answered a month ago
profile picture
EXPERT
reviewed a month ago
  • Hi Mukul,

    Thank you for sharing the documentation page. I followed the steps and can verify it works by creating an IAM user in the Account B for this specific purpose. However, I would like to know if it is also possible to use the instance profile in the CodeBuild environment (or vm) so that I don't have to create a default profile with a newly created IAM user.

    Best regards, Andy

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions