Configure Source Control with AWS CodeCommit
Learn how to set up Source Control with AWS CodeCommit.
You can use Source Control with AWS CodeCommit to manage changes with pull requests.
Create a new IAM Role in your AWS account
Enter a name for the user and check the Access key - Programmatic access setting.

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.

Save the Access key ID and Secret access key in a secure location locally. You'll use these in your repository settings.

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 in your repository settings.

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 README.md file to this repository. The repository needs to contain at least one file to sync.
Configure AWS CodeCommit repository settings
Go to the Source Control settings, and select Set up AWS CodeCommit. Enter the following settings.
| Setting | Description | Example |
|---|---|---|
| AWS CodeCommit Repository | The name of the CodeCommit repository. | retool-apps |
| AWS CodeCommit Branch | The default branch for your CodeCommit repository. | main |
| AWS Region | The region of the CodeCommit repository. | us-east-1 |
| Access Key Id | The Access key ID you generated in step 1. | AKIAWS3BACWHP6QW6VB2 |
| Secret Access Key | The Secret access key you generated in step 1. | loDJlwRetoolTYXOFbO |
| HTTPS Username | The HTTPS username you generated in step 1. | retool-https-username |
| HTTPS Password | The HTTPS password you generated in step 1. | retool-https-password |

Secure credential management
Sensitive credential fields, including Access Key Id, Secret Access Key, HTTPS Username, and HTTPS Password, support embedded expressions for secure credential management.
Toggle the Template variables in Source Control config feature flag in Settings > Beta to enable this feature.
- You can reference configuration variables:
{{ environment.variables.MY_KEY_OR_TOKEN }}
- On self-hosted instances, you can also reference secrets from secrets managers:
{{ secrets.MY_SECRET.KEY }}
The UI includes autocomplete and validation to help you use embedded expressions correctly.
Verify your settings
After you set up your repository settings, 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.

If you don't see the Deployment Dashboard and your AWS CodeCommit commits, confirm your repository settings are correct.
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.