Automate Cloudsmith with the Terraform Provider
Cloudsmith's Terraform Provider lets you define repositories, access controls, entitlement tokens, and permissions as code. Bring Cloudsmith into your existing IaC workflows and eliminate manual configuration drift across environments.
How we support Terraform Provider
Why teams integrate Cloudsmith with Terraform Provider
Frequently asked questions
You can manage repositories, entitlement tokens, repository privileges, and namespace-level settings. This covers the core Cloudsmith resources needed to provision a fully working artifact registry configuration as code.
The provider is published on the official Terraform Registry under cloudsmith-io/cloudsmith. You can reference it directly in your required_providers block.
Authentication uses a Cloudsmith API key, passed via the api_key argument in the provider block or through the CLOUDSMITH_API_KEY environment variable. Using an environment variable is recommended for CI/CD pipelines to avoid storing credentials in code.
Yes. The repository privileges resource lets you assign users, teams, and service accounts with specific privilege levels such as Read, Write, or Admin. This makes it possible to enforce least-privilege access as part of your standard provisioning workflow.
Yes. You can create entitlement tokens and configure restrictions including download limits, IP allowlists, and path restrictions directly through the Terraform resource. This lets you govern artifact distribution programmatically.
Yes. The Cloudsmith provider works alongside any other Terraform provider. A common pattern is to provision cloud infrastructure with an AWS, Azure, or GCP provider and use the Cloudsmith provider in the same configuration to set up the artifact repositories those services depend on.
Yes. The provider follows the standard Terraform provider interface and works with any execution environment that supports Terraform, including Terraform Cloud, Atlantis, Spacelift, and custom CI/CD runners.
When provisioning repository privileges using a service account, ensure you explicitly grant that account Admin privilege in the same privileges resource block. Without this, the service account may lose access to further provisioning on that repository after the first apply.
Yes. Use terraform plan to preview all changes before applying. You can also maintain separate Cloudsmith workspaces for dev, staging, and production and promote validated configurations through each stage using the same Terraform modules.
The Cloudsmith documentation at docs.cloudsmith.com includes worked examples, a minimal complete module example, and notes on managing entitlements and repository privileges. The Terraform Registry entry for cloudsmith-io/cloudsmith also contains the full resource and data source reference.