---
title: "Create and manage connected repositories with Terraform"
description: "With the new cloudsmith_connected_repository resource for the Cloudsmith Terraform provider, you can define connected repository configurations in code alongside the rest of your Cloudsmith infrastructure."
canonical_url: "https://cloudsmith.com/changelog/create-and-manage-connected-repositories-with-terraform"
last_updated: "2026-06-15T12:30:02.012Z"
---
# Create and manage connected repositories with Terraform

With the new `cloudsmith_connected_repository` resource for the Cloudsmith Terraform provider, you can define connected repository configurations in code alongside the rest of your Cloudsmith infrastructure.



## How it works

You can now declare connected repository configurations alongside your other Cloudsmith resources, apply them through standard `terraform apply` workflows, and track changes in version control.  


### Example usage

```json
{
  "_key": "0466c2433b03",
  "_type": "code",
  "code": "provider \"cloudsmith\" {\n    api_key = \"my-api-key\"\n}\n\ndata \"cloudsmith_organization\" \"my_organization\" {\n    slug = \"my-organization\"\n}\n\nresource \"cloudsmith_repository\" \"source\" {\n    description = \"Source repository\"\n    name        = \"source-repo\"\n    namespace   = data.cloudsmith_organization.my_organization.slug_perm\n}\n\nresource \"cloudsmith_repository\" \"target\" {\n    description = \"Target repository\"\n    name        = \"target-repo\"\n    namespace   = data.cloudsmith_organization.my_organization.slug_perm\n}\n\nresource \"cloudsmith_repository_connected\" \"link\" {\n    namespace         = cloudsmith_repository.source.namespace\n    repository        = cloudsmith_repository.source.slug_perm\n    target_repository = cloudsmith_repository.target.slug\n    is_active         = true\n    priority          = 1\n}\n",
  "filename": null,
  "language": "bash",
  "markDefs": null
}
```

For more information about managing connected repositories with the Cloudsmith Terraform provider, see [Terraform Registry: Cloudsmith - Repository Connected Resource](https://registry.terraform.io/providers/cloudsmith-io/cloudsmith/latest/docs/resources/repository_connected).



### **Early Access - Connected repositories**

Connected repositories are in early access and are currently supported for Maven, Docker, Python, NPM, Go, Cargo (Rust), NuGet, Helm, Conda, and Conan. Please [contact us](/company/contact-us) if you are interested in trying them.  
  
For more information about connected repositories, see our [documentation](https://docs.cloudsmith.com/repositories/connected-repositories).
