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
已提問 1 個月前檢視次數 150 次
1 個回答
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
已回答 1 個月前
profile picture
專家
已審閱 1 個月前
  • 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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南