# CodeConnections

Source: /aws/services/codeconnections/

:::tip
CodeConnections was formerly known as CodeStar Connections.
:::

## Introduction

CodeConnections is a service provided by Amazon Web Services (AWS) that enables you to connect your code repositories to your AWS resources.
It allows you to create connections to your code repositories and integrate them with supported AWS services.

LocalStack provides a mock implementation of the CodeConnections API that allows you to create and manage connections to your code repositories.
The supported APIs are available on our [API Coverage section](#api-coverage), which provides information on the extent of CodeConnections's integration with LocalStack.

## Getting started

This guide is designed for users new to CodeConnections and assumes basic knowledge of the AWS CLI and our [`lstk aws`](/aws/developer-tools/running-localstack/lstk/cloud-and-iac-commands/#aws) command.

Start your LocalStack container using your preferred method.
We will demonstrate how to create a connection to a code repository using the CodeConnections API.

### Create a connection

You can create a connection to a code repository using the [`CreateConnection`](https://docs.aws.amazon.com/codeconnections/latest/APIReference/API_CreateConnection.html) API.

```bash
lstk aws codeconnections create-connection \
    --connection-name my-connection
```

You should see the connection in the output.

```bash title="Output"
{
    "ConnectionArn": "arn:aws:codeconnections:eu-central-1:000000000000:connection/7c9f0d0b"
}

### List connections

You can list connections using the [`ListConnections`](https://docs.aws.amazon.com/codeconnections/latest/APIReference/API_ListConnections.html) API.

```bash
lstk aws codeconnections list-connections
```

```bash title="Output"
{
    "Connections": [
        {
            "ConnectionName": "my-connection",
            "ConnectionArn": "arn:aws:codeconnections:us-east-1:000000000000:connection/023ff7e3",
            "ProviderType": "GitHub",
            "OwnerAccountId": "000000000000",
            "ConnectionStatus": "AVAILABLE"
        }
    ]
}
```

### Get a connection

You can get a connection using the [`GetConnection`](https://docs.aws.amazon.com/codeconnections/latest/APIReference/API_GetConnection.html) API.

```bash
lstk aws codeconnections get-connection --connection-arn arn:aws:codeconnections:us-east-1:000000000000:connection/023ff7e3
```

Replace the `connection-arn` with the ARN of the connection you want to get.

```bash title="Output"
{
    "Connection": {
        "ConnectionName": "my-connection",
        "ConnectionArn": "arn:aws:codeconnections:us-east-1:000000000000:connection/023ff7e3",
        "ProviderType": "GitHub",
        "OwnerAccountId": "000000000000",
        "ConnectionStatus": "AVAILABLE"
    }
}
```

### Delete a connection

You can delete a connection using the [`DeleteConnection`](https://docs.aws.amazon.com/codeconnections/latest/APIReference/API_DeleteConnection.html) API.

```bash
lstk aws codeconnections delete-connection --connection-arn arn:aws:codeconnections:us-east-1:000000000000:connection/023ff7e3
```

Replace the `connection-arn` with the ARN of the connection you want to delete.

## API Coverage


### codeconnections API coverage

Source service: `codeconnections`. 7 of 27 tracked operations are implemented.

Service documentation: /aws/services/codeconnections/
License availability: available starting with the Base plan. See /aws/licensing/ for current plan details.

| Operation | Status |
| --- | --- |
| CreateConnection | Implemented |
| CreateHost | Not implemented |
| CreateRepositoryLink | Not implemented |
| CreateSyncConfiguration | Not implemented |
| DeleteConnection | Implemented |
| DeleteHost | Not implemented |
| DeleteRepositoryLink | Not implemented |
| DeleteSyncConfiguration | Not implemented |
| GetConnection | Implemented |
| GetHost | Not implemented |
| GetRepositoryLink | Not implemented |
| GetRepositorySyncStatus | Not implemented |
| GetResourceSyncStatus | Not implemented |
| GetSyncBlockerSummary | Not implemented |
| GetSyncConfiguration | Not implemented |
| ListConnections | Implemented |
| ListHosts | Not implemented |
| ListRepositoryLinks | Not implemented |
| ListRepositorySyncDefinitions | Not implemented |
| ListSyncConfigurations | Not implemented |
| ListTagsForResource | Implemented |
| TagResource | Implemented |
| UntagResource | Implemented |
| UpdateHost | Not implemented |
| UpdateRepositoryLink | Not implemented |
| UpdateSyncBlocker | Not implemented |
| UpdateSyncConfiguration | Not implemented |
