Skip to main content
Connect AWS CodeCommit to let CloudThinker agents list and read your repositories, and to run Review (automated AI code review) on their pull requests. The connection signs in with an IAM role (recommended) or IAM user access keys, and covers one AWS Region.

Prerequisites

  • An AWS account that holds the CodeCommit repositories you want to connect.
  • Permission to create an IAM role or IAM user in that account, and to open AWS CloudShell. The AWSCloudShellFullAccess managed policy grants CloudShell access.
  • The AWS Region where the repositories live, for example us-east-1.
A workspace holds one AWS CodeCommit connection, and that connection covers one Region. To reach repositories in a second Region, connect that Region from a separate workspace.

Setup

In the sidebar, click More → Workspace settings → Connections, stay on the Builtin Connections tab, and select AWS CodeCommit. Choose the AWS Region, then pick a tab.

Send pull request events to Review

Review doesn’t start on new pull requests until AWS sends it events.
1

Run the webhook script

In the Review setup wizard, copy the script from the Events step. It already holds your webhook URL and secret. Run it in AWS CloudShell in the account that owns the repositories.For each repository in the Region, it creates Amazon EventBridge rules named CloudThinker-CodeCommit-* for pull request, comment, and push events. It also creates an EventBridge connection, an API destination, and the IAM role CloudThinker-CodeCommit-EventBridgeInvokeRole that sends events to CloudThinker.
2

Mark it as configured

When the script prints “Webhook setup complete”, click Mark as Configured in the wizard.Success state: a new pull request gets a CloudThinker progress comment. Re-run the script after you add repositories. See provider authentication for details.

Connection details

Required permissions

The setup script attaches one inline policy with these actions: The CodeCommit actions apply to all repositories (Resource: "*"). The policy holds no iam:PassRole.
The IAM role’s trust policy lets only CloudThinker’s AWS principal assume the role, and only with your workspace’s External ID. The wizard fills in both values.
The inline policy, named CodeCommitReviewAccess on the role and CodeCommitReviewAccessKeyPolicy on the access key user:
Keep the policy exactly as the script attaches it and add nothing broader. The IAM role method stores no long-lived key, so prefer it.

Agent capabilities

Reads run without asking. Posting a pull request comment is a write, so it needs Allow writes on — it starts on — and passes through your Rules and Approval mode first. To block CodeCommit writes outright, open AWS CodeCommit in More → Workspace settings → Connections and turn off the Allow writes switch on its detail panel. On CodeCommit, you can mention @cloudthinker-ai with a question or help in a top-level pull request comment. Thread replies, review, and autofix aren’t supported. See mention commands.

Verify the connection

Expect the repository names in the connection’s Region. The count should match the one the dialog showed when you connected.

Example prompts

Troubleshooting

CloudThinker couldn’t use the credentials. Work through these:
An unexpected error stopped the check. Try again. If it repeats, contact support.
The credentials work, but the chosen Region has no repositories the role or user can list. Confirm the AWS Region and that the permissions above are attached.
It lives in another Region. A connection only sees the Region it was set up for.
AWS sends no pull request events until the webhook step is done. Run the webhook script from the wizard, then click Mark as Configured. See provider authentication.

Security

  • Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
  • Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
  • Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
  • Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
  • External ID: the role’s trust policy requires it, which stops another AWS account from tricking CloudThinker into using your role (the confused deputy problem). AWS doesn’t treat an External ID as a secret.
  • Dedicated identity: use the role or user the script creates only for CloudThinker, so you can revoke it without touching anything else.

Review setup

Turn on automated code review for your CodeCommit repositories.

Provider authentication

Auth methods and webhook steps for every Review provider.