Which solution will meet these requirements?
Create a CodeCommit repository in the secondary Region. Create an AWS CodeBuild project to perform a Git mirror operation of the primary Region’s CodeCommit repository to the secondary Region’s CodeCommit repository. Create an AWS Lambda function that invokes the CodeBuild project. Create an Amazon EventBridge rule that reacts to merge events in the primary Region’s CodeCommit repository. Configure the EventBridge rule to invoke the Lambda function.
Create an Amazon S3 bucket in the secondary Region. Create an AWS Fargate task to perform a Git mirror operation of the primary Region’s CodeCommit repository and copy the result to the S3 bucket. Create an AWS Lambda function that initiates the Fargate task. Create an Amazon EventBridge rule that reacts to merge events in the CodeCommit repository. Configure the EventBridge rule to invoke the Lambda function.
Create an AWS CodeArtifact repository in the secondary Region. Create an AWS CodePipeline pipeline that uses the primary Region’s CodeCommit repository for the source action. Create a cross-Region stage in the pipeline that packages the CodeCommit repository contents and stores the contents in the CodeArtifact repository when a pull request is merged into the CodeCommit repository.
Create an AWS Cloud9 environment and a CodeCommit repository in the secondary Region. Configure the primary Region’s CodeCommit repository as a remote repository in the AWS Cloud9 environment. Connect the secondary Region’s CodeCommit repository to the AWS Cloud9 environment.
Explanations:
This option meets the requirements by using a Git mirror operation with CodeBuild to sync the primary Region’s CodeCommit repository to the secondary Region’s repository. The Lambda function triggered by EventBridge can automate the process based on merge events, enabling developers to switch to the secondary Region.
This option uses S3 and Fargate, but the requirement is to mirror the CodeCommit repository, not just copy files to S3. AWS Fargate is not ideal for Git mirroring and does not directly address the need for version control functionality.
CodeArtifact is a repository for storing packages, not for mirroring a Git-based CodeCommit repository. This solution does not meet the requirement of providing the same Git-based development capability in the secondary Region.
Cloud9 provides an IDE, but this solution does not fulfill the requirement of automating code replication or mirroring between Regions. Additionally, it doesn’t provide a scalable solution for failover or disaster recovery.