Skip to content
Get Started for Free

CodeConnections

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, which provides information on the extent of CodeConnections’s integration with LocalStack.

This guide is designed for users new to CodeConnections and assumes basic knowledge of the AWS CLI and our lstk 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.

You can create a connection to a code repository using the CreateConnection API.

Terminal window
lstk aws codeconnections create-connection \
--connection-name my-connection

You should see the connection in the output.

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
Output
{
"Connections": [
{
"ConnectionName": "my-connection",
"ConnectionArn": "arn:aws:codeconnections:us-east-1:000000000000:connection/023ff7e3",
"ProviderType": "GitHub",
"OwnerAccountId": "000000000000",
"ConnectionStatus": "AVAILABLE"
}
]
}

You can get a connection using the GetConnection API.

Terminal window
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.

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

You can delete a connection using the DeleteConnection API.

Terminal window
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.

7 of 27 operations implemented

Available from the Base plan. Licensing details

Find an API

Search the full operation list, then sort the table to compare current support.

Loading operations…

Verified on Kubernetes
Loading operations…
Complete static API list All 27 operations and their current support status
OperationStatus
CreateConnectionImplemented
CreateHostNot implemented
CreateRepositoryLinkNot implemented
CreateSyncConfigurationNot implemented
DeleteConnectionImplemented
DeleteHostNot implemented
DeleteRepositoryLinkNot implemented
DeleteSyncConfigurationNot implemented
GetConnectionImplemented
GetHostNot implemented
GetRepositoryLinkNot implemented
GetRepositorySyncStatusNot implemented
GetResourceSyncStatusNot implemented
GetSyncBlockerSummaryNot implemented
GetSyncConfigurationNot implemented
ListConnectionsImplemented
ListHostsNot implemented
ListRepositoryLinksNot implemented
ListRepositorySyncDefinitionsNot implemented
ListSyncConfigurationsNot implemented
ListTagsForResourceImplemented
TagResourceImplemented
UntagResourceImplemented
UpdateHostNot implemented
UpdateRepositoryLinkNot implemented
UpdateSyncBlockerNot implemented
UpdateSyncConfigurationNot implemented
Was this page helpful?