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

provider "cloudsmith" {
    api_key = "my-api-key"
}

data "cloudsmith_organization" "my_organization" {
    slug = "my-organization"
}

resource "cloudsmith_repository" "source" {
    description = "Source repository"
    name        = "source-repo"
    namespace   = data.cloudsmith_organization.my_organization.slug_perm
}

resource "cloudsmith_repository" "target" {
    description = "Target repository"
    name        = "target-repo"
    namespace   = data.cloudsmith_organization.my_organization.slug_perm
}

resource "cloudsmith_repository_connected" "link" {
    namespace         = cloudsmith_repository.source.namespace
    repository        = cloudsmith_repository.source.slug_perm
    target_repository = cloudsmith_repository.target.slug
    is_active         = true
    priority          = 1
}

For more information about managing connected repositories with the Cloudsmith Terraform provider, see Terraform Registry: Cloudsmith - Repository Connected Resource.

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 if you are interested in trying them.

For more information about connected repositories, see our documentation.



Keep up to date with our monthly product bulletin