Blog

Terraform Provider Enhancements

Feb 23 2023/Integrations/2 min read
The team at Cloudsmith is excited to build upon our past support and integration with Hashicorp Terraform to include managing teams, update repository settings, and manage services (API Keys) via the Terraform Provider Module.

The team at Cloudsmith is excited to build upon our past support and integration with Hashicorp Terraform to include managing teams, update repository settings, and manage services (API Keys) via the Terraform Provider Module. And we are an official Partner, check out the fancy handshake badge!

While Cloudsmith and Terraform are nothing new to each other, the capabilities continue to grow based on community and customer feedback.

History between Terraform and Cloudsmith

For a few years now, Cloudsmith has included Terraform Private Module Registry capabilities to help manage both public and private modules or packages. Cloudsmith delivers on the promise of being truly universal and offering a variety of packaging formats in a consistent and secure way. Review the documentation to find out more.

Terraform has long been the industry standard for infrastructure and application provisioning via code.

Why not manage Cloudsmith with Terraform?

With the Cloudsmith Terraform Provider, users can quickly and easily provision Cloudsmith resources and realize the benefits of Infrastructure-As-Code for creating and managing repositories and access control.

Overview of the Cloudsmith Terraform Provider

The Terraform Provider allows Cloudsmith users to automate the provisioning of resources using Terraform. New capabilities are highlighted below.

Users can:

  • Create and manage repositories, including updating repository settings
  • Create and manage entitlement tokens, granting read-only access to end users
  • Create and manage services (API keys for machine-to-machine or programmatic access) for a Cloudsmith organization
  • Create and manage teams within a Cloudsmith organization
  • Create and manage webhooks for a given Cloudsmith repository

The trend to manage every aspect of the infrastructure lifecycle is expanding with each and every revision. Databases and database schemes are even being managed with Terraform and infrastructure as code. DevOps and Platform teams are attempting to realize the goal of a platform-as-a-service, and the Cloudsmith team wants to help everyone reach that potential.

Example Usage

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

data "cloudsmith_namespace" "my_namespace" {
slug = "my-namespace"
}

resource "cloudsmith_repository" "my_repository" {
description = "A certifiably-awesome private package repository"
name = "My Repository"
namespace = "${data.cloudsmith_namespace.my_namespace.slug_perm}"
slug = "my-repository"
}

resource "cloudsmith_entitlement" "my_entitlement" {
name = "Test Entitlement"
namespace = "${cloudsmith_repository.test.namespace}"
repository = "${cloudsmith_repository.test.slug_perm}"
}

Example Resources

  • cloudsmith_entitlement
  • cloudsmith_repository
  • cloudsmith_repository_geo_ip_rules
  • cloudsmith_repository_privileges
  • cloudsmith_service
  • cloudsmith_team
  • cloudsmith_webhook

Example Data Sources

  • cloudsmith_namespace
  • cloudsmith_organization
  • cloudsmith_package_list
  • cloudsmith_repository

Summary

Terraform plus Cloudsmith is a powerful combination. It allows you to automate the creation of your package repositories and associated access tokens in a controlled, reproducible way. Also, as you have now defined these resources as code, you can version them and treat them as you would any other source code that you have.

The Terraform Module Registry is the home for the validated Terraform provider; find out about the latest enhancements in the documentation. If you like to test things out on your own, sign up for a free trial to realize the value and benefits of Terraform and Cloudsmith together!


Get our next blog straight to your inbox