Blog

Easier API Access, A Faster Terraform Provider with Organization Support

We’ve shipped two updates that make it easier to automate ClusterNest end-to-end: a simpler way to authenticate against the API programmatically, and a Terraform provider release that’s faster on long applies and can now manage organizations directly.

Simpler, Documented Programmatic API Access

Getting an access token for scripts, CI pipelines, or other backend services previously meant driving the same browser-based login flow a human would use. There’s now a dedicated endpoint for this:

POST /auth/token
{
  "email": "[email protected]",
  "app_password": "..."
}

Exchange your email and an app password for an access token in a single request - no browser, no redirect handling. Generate an app password from the MFA settings page in your account settings; your regular account password won’t work here by design, so a leaked app password can always be revoked independently of your login credentials.

This endpoint is now part of the published OpenAPI schema, so it’s fully documented (request/response shapes included) at ClusterNest API Documentation.

Terraform Provider: Faster Applies, Now with Organizations

The Terraform provider has also been updated:

  • Automatic token refresh. The provider previously authenticated once at startup and reused that token for the whole run. Long applies - especially ones provisioning clusters, which can take several minutes to become available - could outlive the token and fail partway through. The provider now refreshes its token automatically before it expires, so long-running applies complete reliably without manual retries.

  • clusternest_organization resource. Create, rename, and delete organizations directly from your Terraform configuration:

    resource "clusternest_organization" "engineering" {
      name = "engineering"
    }
    
    resource "clusternest_opensearch" "logs" {
      name            = "logs"
      tier            = "standard"
      organization_id = clusternest_organization.engineering.id
    }
  • clusternest_organization data source. Look up an existing organization you don’t manage in Terraform:

    data "clusternest_organization" "existing" {
      id = 123
    }
    
    output "organization_name" {
      value = data.clusternest_organization.existing.name
    }

The provider’s authentication input has also been renamed from password to app_password to make the app-password requirement explicit:

provider "clusternest" {
  email        = "[email protected]"
  app_password = "..."
}

Full details are available in the Terraform provider documentation.

Get Started

Update to the latest provider release and check out the Terraform docs for the new organization resource and data source, or head to the API documentation to start authenticating programmatically. As always, reach out at [email protected] if you have questions.