Easy ReviewDOP-C02
SDLC Automation29

CodeCommit

Host private Git repositories, control branch changes, automate reviews, and migrate source history.

CodeCommit stores a team’s Git repositories in AWS. These sections explain Git access, branch permissions, pull request approvals, repository events, and the transfer of existing code into CodeCommit.

Repositories and Git access

CodeCommit hosts private Git repositories so a team can track file history without running a source control server. Git is the version control system; a repositoryA repository stores a project's files and the history of changes to them. is the collection of files and their history.

How it works

  1. Create the repository in an AWS Region and use its regional Git endpoint.
  2. Choose an authentication method, which proves the caller’s identity. An IAM roleA role is an AWS identity whose permissions a caller can use by assuming it. is an identity with permissions that a caller can assume; federationFederation lets an identity authenticated outside AWS obtain access through an IAM role. lets an external sign-in use that role. Temporary credentialsTemporary credentials authorize AWS access for a limited lifetime and stop working after they expire. authorize access for a limited lifetime.
  3. CloneA clone is a local copy of a remote Git repository. the repository to make a local copy. Record local changes as commitsA commit records a set of file changes in a repository's history., then pushA push sends local commits to a remote repository. those commits to CodeCommit.
  4. CodeCommit encrypts stored data with AWS KMS, which manages encryption keys. HTTPS and SSH encrypt the network connection.
Git access method Identity and credentials Use when
HTTPS Git credentials IAM user with a static username and password A Git tool accepts username/password authentication
SSH IAM user with an associated public key A Git client uses key-based SSH authentication
git-remote-codecommit Temporary or federated role credentials An external sign-in or assumed role needs Git access; AWS recommends this option
AWS CLI credential helperA credential helper supplies authentication information when Git connects to a repository. Temporary or federated credentials Git needs the AWS CLI to supply authentication

Exam cues

  • If the question says a federated developer needs CodeCommit access, think git-remote-codecommit or the AWS CLI credential helper, because both support temporary credentials.
  • If the question says the repository belongs to another account, think assume a repository-access role in that account, because its permissions authorize access.
  • If the question says large files change frequently or audit records accumulate continuously, think S3, because Git history can make those workloads slower over time.

Remember

  • New customer sign-ups reopened on November 24, 2025, following the July 2024 de-emphasis.
  • The default repository encryption key is aws/codecommit; a customer managed key is optional.
  • Use the Git endpoint for the repository’s Region.
  • CodeCommit encrypts data at rest and in transit.

Trap: An SSH key or static Git password does not make temporary credentials usable. Use git-remote-codecommit or the AWS CLI credential helper for temporary or federated access.

Access a repository in another account
Caller accountRepository accountAssume role12Developergit-remote-codecommitIAM roleRepository permissionsCodeCommitPrivate repository
  1. The caller assumes the role configured for access in the repository account.

  2. git-remote-codecommit uses role credentials to access the repository with that role's permissions.

From the AWS docs (15)
  • CodeCommit hosts private Git repositories without requiring users to operate source control servers.
  • A repository stores files and their history; developers clone a local copy, commit changes locally, and push them to CodeCommit.
  • CodeCommit reopened new customer sign-ups and returned to full general availability on November 24, 2025, following its July 2024 de-emphasis.
  • HTTPS Git credentials are a static username and password generated in IAM for an IAM user.
  • SSH authenticates with a key pair whose public key is associated with an IAM user.
  • Federated and temporary access support git-remote-codecommit, which AWS recommends, or the AWS CLI credential helper; static HTTPS Git credentials and SSH cannot use rotating or temporary credentials.
  • A federated identity receives the permissions of its associated IAM role after authenticating.
  • An IAM role is an identity with permissions that callers can assume.
  • Temporary credentials grant access for a limited lifetime and cannot be used after they expire.
  • Users can access a CodeCommit repository in another AWS account by assuming a role for repository access and using git-remote-codecommit.
  • A CodeCommit repository belongs to an AWS Region, and Git connections must use that Region's endpoint.
  • CodeCommit encrypts stored repository data and transmits it over encrypted HTTPS or SSH connections.
  • CodeCommit uses an AWS managed KMS key named aws/codecommit unless a customer managed key is specified.
  • Git performance can degrade with frequently changing large files, database data, audit trails, and filesystem or database backups.
  • AWS suggests S3 for versioning large files or storing audit trails and DynamoDB for database workloads rather than using CodeCommit for those tasks.

Pull request approvals

Approval rules require reviewers to approve a CodeCommit pull requestA pull request proposes source branch changes for review before merging them into a destination branch. before it can merge. A pull request compares the source branchA branch is a named reference pointing to its latest commit., which contains proposed changes, with the destination branch that will receive them. Templates apply the same review requirements to matching new requests across repositories.

How it works

  1. Create an approval rule on a pull request, or create a template for reuse. Set the required approval count.
  2. Optionally define an approval poolAn approval pool identifies the reviewers whose approvals count toward a pull request approval rule., the identities whose approvals count. A pool can name IAM users or assumed roles using an Amazon Resource NameAn ARN uniquely identifies an AWS resource. (ARN), the identifier of an AWS resource. Wildcard patternsA wildcard lets one pattern match multiple identity or branch names. can match multiple role sessionsA role session is a temporary use of a role through the credentials issued when the caller assumes it., each a temporary use of a roleA role is an AWS identity whose permissions a caller can use by assuming it. by a caller.
  3. Associate a template with repositories in its Region. A template creates rules when matching pull requests are created. Destination branch filtersA destination reference selects the branch receiving changes when a template determines whether to create an approval rule. select requests such as those targeting refs/heads/main.
  4. Reviewers approve the request. The request’s creator cannot approve it. Approvals from outside a configured pool do not count toward that pool’s requirement.
  5. For an exception, an identity with codecommit:OverridePullRequestApprovalRules permission can set aside all rules on an open request. The activity records who did so; the override can be revoked while the request is open.
Control What it specifies Scope
Approval rule Required approval count and optional approval pool A pull request
Approval rule template Reusable rule and optional destination branch filters Matching new pull requests in associated repositories
Approval override Sets aside all approval rules on the request An open pull request

Exam cues

  • If the question says apply consistent review rules across repositories, think approval rule template plus repositoryA repository stores a project's files and the history of changes to them. associations, because creating a template alone does not apply it.
  • If the question says require review only for changes entering main, think a destination branch filter, because the template matches the branch receiving the changes.
  • If the question says approvals from arbitrary users must not count, think approval pool, because it restricts which identities satisfy the rule.
  • If the question says an emergency requires bypassing review, think an authorized approval override, because it sets aside all approval rules and records the actor.

Remember

  • The console’s default approval count is 1.
  • A new template has no repository associations by default.
  • Templates and associated repositories must be in the same Region.
  • Without branch filters, a template applies to all destination branches in its associated repositories.
  • Approval rules do not support cross-account approvals.

Trap: A pull request author cannot supply an approval for their own request, even if they otherwise belong to the approval pool.

Trap: An override affects every approval rule on the request. It cannot exempt just one rule, and it cannot be revoked after the request is merged.

From the AWS docs (19)
  • A pull request compares changes in a source branch with a destination branch where reviewed changes will be merged.
  • An approval rule specifies how many users must approve a pull request before it can merge.
  • Number of approvals needed defaults to 1 when creating an approval rule in the console.
  • Number of approvals needed defaults to 1 when creating an approval rule template in the console.
  • An optional approval pool restricts which users' approvals count toward the required approval count.
  • Approval pools support IAM user names, assumed roles, and fully qualified Amazon Resource Names, including wildcard patterns for role sessions.
  • When an approval pool matches users assuming a role, their individual role session names count toward the required approver count.
  • Assuming a role provides temporary credentials for a role session.
  • An Amazon Resource Name identifies an AWS resource.
  • CodeCommit approval rules do not support cross-account approvals.
  • The creator of a CodeCommit pull request cannot approve that pull request.
  • An associated approval rule template creates approval rules when matching pull requests are created in the repository.
  • An approval rule template can be associated only with repositories in the same AWS Region.
  • Creating an approval rule template does not associate it with a repository unless an association is specified.
  • DestinationReferences filters a template by the pull request's destination branch, such as refs/heads/main.
  • Without branch filters an approval rule template applies to all branches in an associated repository.
  • Overriding a pull request's approval rules sets aside all its rules, including template-generated rules; individual rules cannot be selectively overridden.
  • An approval override records the actor in pull request activity and can be revoked while the pull request is open, but not after merging.
  • codecommit:OverridePullRequestApprovalRules grants permission to override pull request approval rules.

Repository events

CodeCommit events let repositoryA repository stores a project's files and the history of changes to them. activity start automated work or notify people. An event describes a change; an EventBridge ruleAn event rule matches fields in an event and routes matching events to configured targets. matches its fields and sends it to a target, such as a build project or function.

How it works

  1. For pull requestA pull request proposes source branch changes for review before merging them into a destination branch. tests, match source: aws.codecommit and detail-type: CodeCommit Pull Request State Change. Select pullRequestCreated and pullRequestSourceBranchUpdated in detail.event.
  2. Target CodeBuild and select the proposed commitA commit records a set of file changes in a repository's history., a recorded source revision, with sourceVersion. CodeBuild runs the tests for that revision.
  3. Return feedback to the request. CodeBuild can post a comment using its service roleA service role is a role an AWS service assumes to perform actions on your behalf., the identity it uses to call AWS APIs. Another documented design matches the build-completion event and invokes Lambda to post the outcome and a log link, as shown in the diagram.
  4. For a release pipeline, use separate repository change events filtered to the desired branchA branch is a named reference pointing to its latest commit.. referenceUpdated describes a branch update, including a merge.
  5. For simpler actions, configure a repository triggerA repository trigger invokes Lambda or sends an SNS notification when selected repository operations occur. to SNS or Lambda in the same Region. A trigger sends to an SNS topicA topic is a named communication channel used to distribute notifications to subscribers., a named notification channel, or invokes a function. For reviewer emails about comments, use notification rules with the relevant event types.
Mechanism Events and targets Useful distinction
EventBridge rule Repository and pull request events routed to configured targets Supports pull request checks and release automation
Repository trigger Operational events sent to SNS or Lambda At most 10 per repository; target must be in the same Region
Notification ruleA notification rule selects repository event types for notifications sent to its configured target. Selected activity sent as notifications through SNS Includes comment activity for reviewer emails

For a Lambda repository trigger, creating the trigger in the Lambda console includes the invocation permissions. Creating it in CodeCommit requires a policyA policy defines permissions that determine which operations an identity can perform on a resource. allowing CodeCommit to invoke the function.

Exam cues

  • If the question says test each new CodeCommit pull request and later source updates, think EventBridge plus CodeBuild, because the pull request events can start the build project.
  • If the question says post the test result back to the request, think a permitted CodeBuild comment call or a build-completion rule invoking Lambda, because starting a build alone does not post its result.
  • If the question says release only changes reaching main, think repository change events filtered to that branch, because pull request creation describes proposed work.
  • If the question says email reviewers about comments, think notification rules, because repository triggers have a narrower operational scope.

Remember

  • Repository triggers: maximum 10; SNS or Lambda target in the repository’s Region.
  • No trigger branch list means all branches.
  • Trigger event options are all, updateReference, createReference, and deleteReference. Use all on its own.
  • CodeCommit’s direct service events use best-effort deliveryBest-effort delivery attempts to send every service event to EventBridge but can occasionally leave an event undelivered. to EventBridge: an event can occasionally go undelivered.

Trap: CodeBuild’s native webhooksA webhook lets a supported source provider notify CodeBuild about repository activity that can start a build., which let supported Git providers notify CodeBuild of changes, do not support CodeCommit. Use CodeCommit events through EventBridge.

Trap: EventBridge calls the branch-change event referenceUpdated. A repository trigger uses the option updateReference; these names are not interchangeable.

Test a pull request and return build results
12345CodeCommitPull requestEventBridgeRequest eventsCodeBuildRun testsEventBridgeBuild completionLambdaPost results
  1. A rule matches pullRequestCreated or pullRequestSourceBranchUpdated for the repository.

  2. The rule starts a CodeBuild project for the proposed source revision.

  3. CodeBuild runs the tests and emits a build-completion event.

  4. A result rule invokes the Lambda function with the build outcome.

  5. Lambda posts the result and a build-log link to the pull request.

From the AWS docs (23)
  • EventBridge matches CodeCommit events with rules and routes matching events to configured targets.
  • CodeCommit events use source aws.codecommit; pull request events use detail-type CodeCommit Pull Request State Change.
  • The pullRequestCreated event reports creation of a pull request.
  • The pullRequestSourceBranchUpdated event reports a change to a pull request's source branch.
  • A referenceUpdated event reports an updated branch and uses detail-type CodeCommit Repository State Change with referenceType and referenceName fields.
  • An EventBridge rule matching pullRequestCreated and pullRequestSourceBranchUpdated can directly target a CodeBuild project for pull request checks.
  • CodeBuild StartBuild accepts sourceVersion to select a CodeCommit commit ID, branch, or tag for the build.
  • A CodeBuild project can run checks and post the results as pull request comments when its service role has the required CodeCommit permissions.
  • A build-completion event can invoke Lambda to post build results and a build-log link to the CodeCommit pull request.
  • CodeBuild native webhooks support GitHub, GitHub Enterprise Server, GitLab, GitLab Self Managed, and Bitbucket, not CodeCommit.
  • CodePipeline can use EventBridge to detect CodeCommit branch changes; AWS examples filter referenceCreated and referenceUpdated by branch type and branch name.
  • CodeCommit repository triggers can publish to SNS or invoke Lambda.
  • A CodeCommit repository supports at most 10 repository triggers.
  • An SNS topic or Lambda function targeted by a CodeCommit repository trigger must be in the repository's Region.
  • A Lambda trigger created in the Lambda console includes invocation permissions; a trigger created in CodeCommit requires a policy allowing invocation.
  • Repository trigger event options are all, updateReference, createReference, and deleteReference; all cannot be combined with other event options.
  • A repository trigger without a branch list applies to all branches in the repository.
  • Repository notification rules send emails for selected event types through an SNS topic, including comment activity.
  • Repository triggers cover operational events such as branch creation and pushes, and do not use event rules to evaluate repository activity.
  • CodeCommit service events sent directly to EventBridge use best-effort delivery.
  • Best-effort delivery means a service attempts to send every event to EventBridge, but an event can occasionally go undelivered.
  • A service role is an IAM role a service assumes to perform actions on a customer's behalf.
  • An SNS topic is a named communication channel that groups notification recipients.

Repository migration

RepositoryA repository stores a project's files and the history of changes to them. migration transfers an existing Git repository into CodeCommit. The documented process creates a local migration copy, pushesA push sends local commits to a remote repository. its branchesA branch is a named reference pointing to its latest commit. and tagsA Git tag gives a name to a particular commit in a repository's history., and then creates a separate working cloneA clone is a local copy of a remote Git repository. for developers.

How it works

  1. Create the destination CodeCommit repository and copy its clone URL, the address Git uses to connect. Use the Git endpoint for the repository’s Region.
  2. Run git clone --mirror <source-url> and enter the new directory. This creates a bare repository, the local copy used for transfer rather than daily editing.
  3. Run git push <destination-url> --all to send every branch. A branch points to its latest commitA commit records a set of file changes in a repository's history. in the repository’s history.
  4. Wait for the branch push to complete, then run git push <destination-url> --tags. A tag is a named reference to a point in the repository’s history; --all does not send tags.
  5. For a large transfer or unreliable connection, consider incremental migrationIncremental migration transfers commits in chunks so a failed transfer can resume with the chunks that did not succeed., which sends chunks of commits and retries unsuccessful chunks. After migration, use git clone <destination-url> without --mirror for normal development.

For a new empty destination, git push <destination-url> --mirror is an alternative to separate branch and tag pushes. It pushes all references at once, including branches and tags.

Ongoing replication is a separate workflow that keeps another repository updated. The AWS integration guide lists continuous replication between Regions using Fargate and an event-driven Lambda replication example. Treat each regional copy as a separate repository with its own Git endpoint. The regional diagram shows that integration pattern.

During a transition, a local repository can also push to two remotes, which are repositories reached through configured Git URLs. Explicitly add both push URLs with git remote set-url --add --push; the first addition replaces the default push URL. Push order matters: if the first destination fails, Git does not push to the second.

Exam cues

  • If the question says move an existing Git repository’s branches and tags to CodeCommit, think mirror cloneA mirror clone is the bare local repository copy used to transfer an existing repository during migration. followed by branch and tag pushes, because the branch push alone leaves tags behind.
  • If the question says a large migration repeatedly fails on a poor connection, think incremental pushes, because only unsuccessful chunks need retrying.
  • If the question says keep a repository copied into another Region, think an ongoing replication integration, because each CodeCommit repository has a regional endpoint.
  • If the question says keep the current Git host while trying CodeCommit, think two configured push destinations, because one local repository can send changes to both.

Remember

  • Migration order: destination repository, mirror clone, --all push, --tags push, normal clone.
  • --all sends branches; --tags sends tags.
  • For a new empty destination, --mirror can push all references at once.
  • AWS suggests considering incremental migration when transferring an entire repository larger than 2 GB or using an unreliable connection.
  • With two push destinations, a failure at the first prevents the second push.

Trap: A mirror clone does not make git push --all include tags. Push tags separately after the branch push.

Trap: The bare mirror is a migration copy. Make a normal clone from CodeCommit for daily work.

Transfer branches and tags before daily work
12Source repositoryExisting Git historyMigration copyBare local repositoryCodeCommitNew repository
  1. Use git clone --mirror to create the migration copy from the source.

  2. Push branches with --all, then tags with --tags. After migration, make a normal clone for daily work.

Cross-Region replication uses an integration workflow
Source RegionDestination Region12CodeCommitSource repositoryReplicationIntegration workflowiCodeCommitSeparate repository
  1. A replication integration processes changes from the source repository.

  2. The workflow transfers changes to a repository using the destination Region's endpoint.

Box details (1)
Replication

The integration guide lists event-driven Lambda and Fargate examples.

From the AWS docs (17)
  • A Git repository can be migrated to CodeCommit by creating a destination repository, cloning the source locally, and pushing its contents to CodeCommit.
  • The documented migration procedure uses git clone --mirror to create a bare local copy for migration rather than daily development.
  • Git push --mirror can push all references at once when migrating a repository to a new CodeCommit repository.
  • git push with --all pushes all branches but does not push other references such as tags.
  • After the initial branch push completes, git push with --tags transfers the tags to the destination.
  • After migration, git clone without --mirror creates a local repository suitable for working with the CodeCommit repository.
  • A Git tag names a particular commit in a repository's history.
  • A Git branch is a reference pointing to its latest commit.
  • A local Git repository connects to a remote repository through a configured URL.
  • Incremental migration pushes commits in chunks and can retry only chunks that did not succeed after an interruption.
  • AWS suggests considering incremental migration for a repository larger than 2 GB when migrating its entire contents, as well as for unreliable network connections.
  • Each CodeCommit repository is associated with a Region and requires that Region's Git connection endpoint.
  • The CodeCommit integration guide lists continuous replication from one AWS Region to another as a serverless integration pattern using Fargate.
  • The CodeCommit integration guide also lists replication workflows using repository events, event rules, and Lambda.
  • A local Git repository can push changes to two remote repositories to keep an existing repository in use while trying CodeCommit.
  • When using git remote set-url --add --push to configure two push destinations, both destination URLs must be explicitly added because the first command replaces the default push URL.
  • With the documented two-destination Git configuration, pushes run in destination order and failure at the first destination prevents the push to the second.

Branch protection

BranchA branch is a named reference pointing to its latest commit. protection uses IAM policies, rules that allow or deny AWS operations, to control who can change a CodeCommit branch. A branch is a named pointer to its latest commitA commit records a set of file changes in a repository's history.. A pull requestA pull request proposes source branch changes for review before merging them into a destination branch. proposes changes for review before merging one branch into another.

How it works

  1. Scope the policyA policy defines permissions that determine which operations an identity can perform on a resource. to the repositoryA repository stores a project's files and the history of changes to them.’s Amazon Resource NameAn ARN uniquely identifies an AWS resource. (ARN), its AWS resource identifier. Match codecommit:References to the full branch name, such as refs/heads/main.
  2. Deny the write paths the restricted developers must not use. The AWS example uses StringEqualsIfExists for the branch condition and includes GitPush, file changes, branch deletion, and branch and pull request merges. Also account for CreateCommit if that API is otherwise allowed.
  3. Include "Null": {"codecommit:References": "false"} when a deny contains GitPush. Attach the policy to the relevant group or roleA role is an AWS identity whose permissions a caller can use by assuming it. so it takes effect.
  4. Developers work on other branches and open pull requests. An approval rule sets the review requirement. Keep the needed MergePullRequestBy* permission available to the authorized merger; the complete AWS example denies it to restricted developers.
Change path IAM actions to consider What they control
Git client codecommit:GitPush Sending commits through Git
File and commit APIs codecommit:PutFile, codecommit:DeleteFile, codecommit:CreateCommit Writing files without a Git pushA push sends local commits to a remote repository.
Branch deletion codecommit:DeleteBranch Removing the branch
Branch merge APIs codecommit:MergeBranchesByFastForward, codecommit:MergeBranchesBySquash, codecommit:MergeBranchesByThreeWay Merging branches directly
Pull request merge APIs codecommit:MergePullRequestByFastForward, codecommit:MergePullRequestBySquash, codecommit:MergePullRequestByThreeWay Merging a pull request

Exam cues

  • If the question says block direct writes to main while requiring review, think branch-scoped IAM restrictions plus approval rules, because permissions and review requirements control different operations.
  • If the question says developers can propose changes but only maintainers can merge, think attach the full update deny to developers and retain merge permissions for maintainers, because denied developers can still create pull requests.
  • If the question says an approved pull request still cannot merge, think inspect the merger’s branch permissions, because approval does not remove the IAM restriction.

Remember

  • main is matched as refs/heads/main in codecommit:References.
  • A deny containing GitPush needs Null with codecommit:References set to false.
  • Branch restrictions do not take effect until the policy is attached.
  • Without branch restrictions, repository push permission permits changes to any branch.

Trap: Approval rules do not block direct Git pushes. Restrict branch writes through IAM as well.

Trap: Copying the full AWS deny onto every merger blocks pull request merges too. Preserve the required merge permission for the identity that must merge approved requests.

From the AWS docs (14)
  • An IAM policy defines permissions that determine whether an operation is allowed or denied.
  • An Amazon Resource Name identifies an AWS resource.
  • A Git branch is a reference pointing to its latest commit; codecommit:References identifies branches in IAM conditions using names such as refs/heads/main.
  • Without branch restrictions, a user with repository push permission can contribute to any branch.
  • A conditional IAM Deny can restrict selected update actions on branches in the repositories named by Resource.
  • The AWS branch deny example uses StringEqualsIfExists to match codecommit:References to full branch names.
  • The AWS branch policy example includes GitPush, PutFile, DeleteFile, DeleteBranch, MergeBranchesByFastForward, MergeBranchesBySquash, MergeBranchesByThreeWay, MergePullRequestByFastForward, MergePullRequestBySquash, and MergePullRequestByThreeWay.
  • codecommit:CreateCommit can change files and create a commit in a branch, and supports the codecommit:References condition key.
  • An IAM Deny containing GitPush requires a Null condition with codecommit:References set to false because of Git's push protocol.
  • The conditional branch policy takes effect when attached to an IAM user, group, or role; AWS recommends groups or roles for scaling policy management.
  • Developers denied updates to a protected branch can still read it, work on other branches, and create pull requests when those actions are otherwise allowed.
  • A user covered by the example branch deny can create a pull request to the protected branch but receives an error when attempting to merge it.
  • Approval rules require approvals before a pull request can merge to its destination branch; branch update permissions are controlled separately through IAM.
  • Federated users and temporary credentials can access CodeCommit with git-remote-codecommit or the AWS CLI credential helper.

Flashcards

tap to flip
Answer

·

All 29 cards as a list

A team needs a private Git repository without operating its own source control server. How does AWS CodeCommit support its workflow?

Use a CodeCommit repository. Developers clone it, commit changes locally, and push them to CodeCommit.

How can a Git client authenticate to CodeCommit?

Use HTTPS Git credentials for an IAM user, SSH with an IAM user's associated public key, or git-remote-codecommit / the AWS CLI credential helper for temporary or federated access.

A federated identity receives its IAM role's permissions.

How is CodeCommit data protected, and what is it a poor fit for?

CodeCommit encrypts repository data at rest and uses HTTPS or SSH in transit.

Git performance can degrade with frequently changing large files, databases, audit trails, and filesystem or database backups. AWS suggests S3 for large-file versioning and audit trails, and DynamoDB for databases.

A federated developer uses temporary credentials to access CodeCommit. Which Git connection method should the team choose?

Use git-remote-codecommit, the AWS recommendation, or the AWS CLI credential helper. Static HTTPS Git credentials and SSH cannot use temporary credentials.

Developers must clone a CodeCommit repository owned by another AWS account. How can they obtain Git access?

Configure role-based repository access in the repository account. Developers assume that role and use git-remote-codecommit with its credentials.

Which encryption key does CodeCommit use if a team does not specify its own repository key?

The AWS managed KMS key aws/codecommit. A customer managed key can be specified instead.

A team needs the same CodeCommit pull request approval rule across many repositories. What should it use?

Associate an approval rule template with the repositories in the same Region. Matching new pull requests receive its rule automatically.

Optional destination branch filters select which requests receive the rule.

What is the default Number of approvals needed when creating a CodeCommit approval rule template in the console?

1 approval. An optional approval pool limits whose approvals count toward that number.

A team needs CodeCommit review rules on pull requests targeting main, but not on requests targeting development branches. How should it configure the template?

Set DestinationReferences to refs/heads/main and associate the template with the repositories. The filter matches the destination branch of new pull requests.

A CodeCommit approval pool must count reviewers who assume a review role with different session names. What should the pool match?

Use an assumed-role pattern with a wildcard for the role sessions. The matching individual session names count toward the required number of approvers.

Can a CodeCommit approval rule count a reviewer identity from a different AWS account?

No. Approval rules do not support cross-account approvals.

A CodeCommit pull request has several approval rules, but an emergency operator wants to override just one. What does CodeCommit support?

Overriding all approval rules on the request together, including rules from templates. The operator needs OverridePullRequestApprovalRules permission, and the activity records who performed the override.

Which options react to CodeCommit activity?

Use EventBridge rules for repository and pull request automation, repository triggers for SNS or Lambda actions, or notification rules for email about selected activity.

Repository triggers are limited to 10 per repository, and their SNS or Lambda target must be in the same Region.

A team needs tests on every CodeCommit pull request and a result comment. What should it configure?

Match pullRequestCreated and pullRequestSourceBranchUpdated with EventBridge and start CodeBuild using the proposed commit as sourceVersion.

A build-completion rule can invoke Lambda to post results. CodeBuild can also post comments itself with the required permissions. Native CodeBuild webhooks do not support CodeCommit.

A team wants a CodePipeline release to start when a specific CodeCommit branch changes. How should it configure change detection?

Use an EventBridge rule for CodeCommit referenceCreated and referenceUpdated events, filtered by branch type and branch name.

A release pipeline should start when the main branch in CodeCommit changes, while pull requests should run separate tests. Which events distinguish those paths?

Use repository referenceUpdated events filtered to branch main for release changes. Use pullRequestCreated and pullRequestSourceBranchUpdated for pull request checks.

A team creates a CodeCommit repository trigger with no branch list. Which branches does it monitor, and where must its Lambda target run?

It applies to all branches. The Lambda function must be in the same Region as the repository.

Is updateReference a CodeCommit EventBridge event name or a repository trigger event option?

It is a repository trigger event option. The corresponding EventBridge event is named referenceUpdated.

A team must move an existing Git repository to CodeCommit with all branches, tags and history. What are the steps?

Create the destination CodeCommit repository and run git clone --mirror <old-url> for the migration copy.

From that copy, run git push <codecommit-url> --all, wait for completion, then run git push <codecommit-url> --tags. The --all option sends branches, not tags.

Use incremental pushes if needed for a large transfer, then make a normal clone from CodeCommit for daily work.

What does git push --all transfer during a CodeCommit migration, and what needs another push?

It transfers all branches. Tags need a separate push with --tags after the branch push completes.

A team is migrating an entire Git repository larger than 2 GB to CodeCommit over an unreliable connection. What approach reduces repeated work after failures?

Use incremental migration. Push commits in chunks and retry the chunks that did not succeed after a failure.

A team needs ongoing copies of a CodeCommit repository in another AWS Region. What kind of solution does the CodeCommit integration guide describe?

A replication integration workflow between regional repositories. The guide lists serverless Fargate and event-driven Lambda patterns; each repository uses its own Region's endpoint.

A team wants local Git pushes to reach both its current repository and CodeCommit during a transition. What configuration detail matters?

Add both destination URLs explicitly with git remote set-url --add --push. The first such command replaces the default push URL. If the first destination fails, the second is not pushed to.

A team has made a mirror clone of a Git repository and wants to push all its references to a new empty CodeCommit repository at once. Which Git option can it use?

Use git push --mirror to push the references at once to the new empty repository. For large repositories, consider incremental migration.

A team needs CodeCommit pull requests for changes to main and must block direct pushes. What should it configure?

Use a conditional IAM Deny for branch writes, matching codecommit:References to refs/heads/main, and an approval rule for pull request merges.

Include Null: codecommit:References = false when denying GitPush. Allow an authorized merger to use the required MergePullRequestBy* action; denying it to that merger would also block approved requests.

A CodeCommit approval rule requires reviewers to approve a pull request. Can a developer with push permission still bypass it?

Yes. Approval rules gate merging a pull request only, not git push to the branch.

Deny direct branch writes through IAM and retain pull request merge permission for the authorized merger.

A federated developer needs CodeCommit Git access and an approval rule cannot stop direct pushes to the protected branch. What controls address both needs?

Use git-remote-codecommit or the CLI credential helper, and add an IAM branch deny. Approval rules govern pull request merges, not direct pushes.

What extra condition is required when a CodeCommit branch policy uses Deny with GitPush?

Add a Null condition with codecommit:References set to false, alongside the branch-reference condition. AWS requires it because of Git's push protocol.

A CodeCommit pull request has all required approvals, but its merger is denied MergePullRequestBySquash on the destination branch. Will the approved request merge?

No. The branch policy still blocks the merge action. Use a merger identity allowed to perform the required pull request merge operation.

You finished every topic of DOP-C02!

Your badge turned gold. Next step: book the exam on AWS. Once you pass, add yourself to Who passed.

Share

Share that you finished this certification

I finished every topic of AWS Certified DevOps Engineer - Professional (DOP-C02) on Easy Review. Come study too!