Set up Source Control with AWS CodeCommit

Learn how to implement Source Control with AWS CodeCommit for self-hosted Retool.


Source Control with AWS CodeCommit is available on Retool Cloud and on-premise deployments of Self-hosted Retool v2.102 or later.

Setup instructions

Disable git syncing

If you've enabled Git Syncing, disable it:

  • In your docker.env file, set DISABLE_GIT_SYNCING=true and VERSION_CONTROL_LOCKED=false.
  • In the Settings > Advanced tab in Retool, remove the repository URL and branch name from your Git Syncing configuration.

1. Create a new IAM Role in your AWS account

Enter a name for the user and check the Access key - Programmatic access setting.

Create AWS IAM RoleCreate AWS IAM Role

Next, select Attach existing policies directly, search for "codecommit", and select the AWSCodeCommitFullAccess policy name. This is the only permission required for this new user.

IAM Role - Access KeyIAM Role - Access Key

Save the Access key ID and Secret access key in a secure location locally. You'll use these as environment variables in step 3.

Save access key ID and secret access keySave access key ID and secret access key

Go to the newly created user on your IAM console. Select the Security credentials tab, scroll to HTTPS Git Credentials for AWS CodeCommit, and click Generate Credentials. Download and save these credentials in a secure location. You'll use these HTTPS credentials as environment variables in step 3.

Generate HTTPS Git credentialsGenerate HTTPS Git credentials

2. Create a new CodeCommit repository

Go to CodeCommit on your AWS console and create a new repository for Retool syncing. You can select any region of your preference.

Add a file to this repository. The repository needs to contain at least one file to sync.

3. Set up environment variables on your Retool instance

Set the following environment variables on your Retool instance:

Variable nameDescriptionExample value
CODE_COMMIT_AWS_ACCESS_KEY_IDThe Access key ID you generated in step 1.AKIAWS3BACWHP6QW6VB2
CODE_COMMIT_AWS_SECRET_ACCESS_KEYThe Secret access key you generated in step 1.loDJlwRetoolTYXOFbO
CODE_COMMIT_AWS_DEFAULT_REGIONThe region of the CodeCommit
CODE_COMMIT_REPOSITORY_NAMEThe name of the CodeCommit repository.retool-apps
CODE_COMMIT_MAIN_BRANCHThe default branch for your CodeCommit repository.main
CODE_COMMIT_HTTPS_USERNAMEThe HTTPS username you generated in step 1.retool-https-username
CODE_COMMIT_HTTPS_PASSWORDThe HTTPS password you generated in step 1.retool-https-password

4. Verify your settings

After you set up your environment variables, visit the Settings > Source Control on your Retool instance.

If your environment is correctly configured, the page will show a Deployment Dashboard. Click Test connection under the AWS CodeCommit section to test your connection and confirm the sync works as expected.

Deployment DashboardDeployment Dashboard

If you don't see the Deployment Dashboard and your AWS CodeCommit commits, go back to step 3 and confirm your environment variables are correctly set.

You are now ready to use source control with AWS CodeCommit. Read the source control getting started guide to learn more about source control workflows.