share code commit repositories between aws accounts

0

Hi team, I have 3 AWS accounts: DEV, STG and PROD

my code commit repositories are in the DEV account.

I don't want to duplicate those repositories on the STG and PROD accounts.

So that my repositories in the DEV account be the single point of truth. and I can be able to create a release from the STG or the PROD using the DEV repositories.

Is there a best way/architecture to achieve this? without doing a workaround on the build spec (like using keys and doing git pull ... on the build spec of STG and PROD).

I followed points 1 and 2 o this tutorial : https://docs.aws.amazon.com/codecommit/latest/userguide/cross-account.html

after that, I can see DEV repositories in PROD account with switch role but I can't create a codeBuild/ code pipeline project ... because the role switched give only permission to DEV repos, but I want to create the codeBuild in PROD not DEV using the DEV repos (even I give to the role switched more permissions the codeBuild created from PROD was actually created in DEV not in PROD)

Just want to create a new code deploy for fargate in PROD that relies on tags / repos generated from DEV account, so when creating the code deploy in PRD account I can select DEV repos/ tags as source.

can we use the RAM service to share repos ? appreciate any help.

1개 답변
1

Hi,

Yes this is a possible use case. You can create CodeBuild or CodePipeline in Prod or Stg account, and reference to the Repo in Dev account. To do this, you would need a role created in Dev account which can be assumed by Prod or Stg account. See this blog for your reference.

지원 엔지니어
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠