

End of support notice: On October 7, 2026, AWS will end support for AWS Proton. After October 7, 2026, you will no longer be able to access the AWS Proton console or AWS Proton resources. Your deployed infrastructure will remain intact. For more information, see [AWS Proton Service Deprecation and Migration Guide](https://docs.aws.amazon.com/proton/latest/userguide/proton-end-of-support.html).

# Using git repositories with AWS Proton
Repositories

AWS Proton uses git repositories for a variety of purposes. The following list categorizes the repository types associated with AWS Proton resources. For AWS Proton features that repeatedly connect to your repository to either push content to it or pull content from it, you have to register a *repository link* with AWS Proton in your AWS account. A repository link is a set of properties that AWS Proton can use when it connects to a repository. AWS Proton currently supports GitHub, GitHub Enterprise, and BitBucket.

Developer repositories  
*Code repository* – A repository that developers use to store application code. Used for *code deployment*. AWS Proton doesn't interact directly with this repository. When a developer provisions a service that includes a pipeline, they provide the repository name and branch to read their application code from. AWS Proton passes this information to the pipeline that it provisions.  
For more information, see [Create a service](ag-create-svc.md).

Administrator repositories  
*Template repository* – A repository where administrators store AWS Proton template bundles. Used for *template sync*. When an administrator creates a template in AWS Proton, they can point to a template repository, and AWS Proton keeps the new template in sync with it. When the administrator updates the template bundle in the repository, AWS Proton automatically creates a new template version. Link a template repository to AWS Proton before you can use it for syncing.  
For more information, see [Template sync configurations](ag-template-sync-configs.md).  
A template repository isn't required if you continue to upload your templates to Amazon Simple Storage Service (Amazon S3) and call the AWS Proton template management APIs to create new templates or template versions.

Self-managed provisioning repositories  
*Infrastructure repository* – A repository that hosts rendered infrastructure templates. Used for *self-managed provisioning* of *resource infrastructure*. When an administrator creates an environment for self-managed provisioning, they provide a repository. AWS Proton submits pull requests (PRs) to this repository to create the infrastructure for the environment and for any service instance deployed to the environment. Link an infrastructure repository to AWS Proton before you can use it for self-managed infrastructure provisioning.  
*Pipeline repository* – A repository used to create pipelines. Used for *self-managed provisioning* of *pipelines*. Using an additional repository to provision pipelines allows AWS Proton to store pipeline configurations independently from any individual environment or service. You only need to provide a single pipeline repository for all your self-managed provisioning services. Link a pipeline repository to AWS Proton before you can use it for self-managed pipeline provisioning.   
For more information, see [How AWS-managed provisioning works](ag-works-prov-methods.md#ag-works-prov-methods-direct).

**Topics**
+ [

# Create a link to your repository
](ag-create-repo.md)
+ [

# View linked repository data
](ag-repo-view.md)
+ [

# Delete a repository link
](ag-repo-delete.md)

# Create a link to your repository
Create a repository link

You can create a link to your repository using the console or CLI. When you create a repository link, AWS Proton creates a [service linked role](using-service-linked-roles.md) for you.

------
#### [ AWS Management Console ]

**Create a link to your repository as shown in the following console steps.**

1. In the [AWS Proton console](https://console.aws.amazon.com//proton/), choose **Repositories**.

1. Choose **Create repository**.

1. In the **Link new repository** page, in the **Repository details** section:

   1. Choose your repository provider.

   1. Choose one of your existing connections. If you don't have one, choose **Add a new CodeStar connection** to create a connection, and then go back to the AWS Proton console, refresh the connection list, and choose your new connection.

   1. Choose from your connected source code repositories.

1. *[optional]* In the **Tags** section, choose **Add new tag** one or more times, and enter **Key** and **Value** pairs.

1. Choose **Create repository**.

1. View the detail data for your linked repository.

------
#### [ AWS CLI ]

**Create and register a link to your repository.**

Run the following command:

```
$ aws proton create-repository \
    --name myrepos/environments \
    --connection-arn "arn:aws:codestar-connections:region-id:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" \
    --provider "GITHUB" \
    --encryption-key "arn:aws:kms:region-id:123456789012:key/bPxRfiCYEXAMPLEKEY" \
    --tags key=mytag1,value=value1 key=mytag2,value=value2
```

The last two parameters, **--encryption-key** and **--tags**, are optional.

Response:

```
{
    "repository": {
        "arn": "arn:aws:proton:region-id:123456789012:repository/github:myrepos/environments",
        "connectionArn": "arn:aws:codestar-connections:region-id:123456789012:connection/2ad03b28-a7c4-EXAMPLE11111",
        "encryptionKey": "arn:aws:kms:region-id:123456789012:key/bPxRfiCYEXAMPLEKEY",
        "name": "myrepos/environments",
        "provider": "GITHUB"
    }
}
```

After you create a repository link, you can view a list of AWS and customer managed tags, as shown in the following example command. AWS Proton automatically generates AWS managed tags for you. You can also modify and create customer managed tags using the AWS CLI. For more information, see [AWS Proton resources and tagging](resources.md).

Command:

```
$ aws proton list-tags-for-resource \
    --resource-arn "arn:aws:proton:region-id:123456789012:repository/github:myrepos/environments"
```

------

# View linked repository data


You can list and view linked repository details using the console or the AWS CLI. For repository links that are used to sync git repositories with AWS Proton, you can retrieve repository sync definition and status using the AWS CLI.

------
#### [ AWS Management Console ]

**List and view linked repository details using the [AWS Proton console](https://console.aws.amazon.com//proton/).**

1. To list of your linked repositories, choose **Repositories** in the navigation pane.

1. To view detail data, choose the name of a repository.

------
#### [ AWS CLI ]

**List your linked repositories.**

Run the following command:

```
$ aws proton list-repositories
```

Response:

```
{
    "repositories": [
        {
            "arn": "arn:aws:proton:region-id:123456789012:repository/github:myrepos/templates",
            "name": "myrepos/templates",
            "provider": "GITHUB"
        },
        {
            "arn": "arn:aws:proton:region-id:123456789012:repository/github:myrepos/environments",
            "name": "myrepos/environments",
            "provider": "GITHUB"
        }
    ]
}
```

**View the details of a linked repository.**

Run the following command:

```
$ aws proton get-repository \
    --name myrepos/templates \
    --provider "GITHUB"
```

Response:

```
{
    "repository": {
        "arn": "arn:aws:proton:region-id:123456789012:repository/github:myrepos/templates",
        "name": "myrepos/templates",
        "provider": "GITHUB"
    }
}
```

**List your synced repositories.**

The following example lists repositories that you configured for template sync.

Run the following command:

```
$ aws proton list-repository-sync-definitions \
    --branch "main" \
    --repository-name myrepos/templates \
    --repository-provider "GITHUB" \
    --sync-type "TEMPLATE_SYNC"
```

**View repository sync status.**

The following example retrieves sync status of a template sync repository.

Run the following command:

```
$ aws proton get-repository-sync-status \
    --branch "main" \
    --repository-name myrepos/templates \
    --repository-provider "GITHUB" \
    --sync-type "TEMPLATE_SYNC"
```

Response:

```
{
    "latestSync": {
        "events": [
            {
                "event": "Clone started",
                "time": "2021-11-21T00:26:35.883000+00:00",
                "type": "CLONE_STARTED"
            },
            {
                "event": "Updated configuration",
                "time": "2021-11-21T00:26:41.894000+00:00",
                "type": "CONFIG_UPDATED"
            },
            {
                "event": "Starting syncs for commit 62c03ff86eEXAMPLE1111111",
                "externalId": "62c03ff86eEXAMPLE1111111",
                "time": "2021-11-21T00:26:44.861000+00:00",
                "type": "STARTING_SYNC"
            }
        ],
        "startedAt": "2021-11-21T00:26:29.728000+00:00",
        "status": "SUCCEEDED"
    }
}
```

------

# Delete a repository link


You can delete a repository link by using the console or the AWS CLI.

**Note**  
Deleting a repository link only removes the registered link that AWS Proton has in your AWS account. It does not delete any information from your repository.

------
#### [ AWS Management Console ]

**Delete a repository link using the console.**

**In the repository detail page.**

1. In the [AWS Proton console](https://console.aws.amazon.com//proton/), choose **Repositories**.

1. In the list of repositories, choose the radio button to the left of the repository that you want to delete.

1. Choose **Delete**.

1. A modal prompts you to confirm the Delete action.

1. Follow the instructions and choose **Yes, delete**.

------
#### [ AWS CLI ]

**Delete a repository link.**

Run the following command:

```
$ aws proton delete-repository \
    --name myrepos/templates \
    --provider"GITHUB"
```

Response:

```
{
    "repository": {
        "arn": "arn:aws:proton:region-id:123456789012:repository/github:myrepos/templates",
        "name": "myrepos/templates",
        "provider": "GITHUB"
    }
}
```

------