Docs / Terraform Provider

Terraform Provider

Official Terraform provider for Nitrozen.io — manage changelog projects and entries as infrastructure code.

Terraform Registry GitHub

Installation

Declare the provider in your Terraform configuration and run terraform init to install it.

terraform
terraform {
  required_providers {
    nitrozen = {
      source  = "nitrozenio/nitrozen"
      version = "~> 1.0"
    }
  }
}

Quick Start

A complete example that creates a project and publishes a changelog entry:

terraform
terraform {
  required_providers {
    nitrozen = {
      source  = "nitrozenio/nitrozen"
      version = "~> 1.0"
    }
  }
}

provider "nitrozen" {
  token = var.nitrozen_token
}

variable "nitrozen_token" {
  description = "Nitrozen API token"
  type        = string
  sensitive   = true
}

resource "nitrozen_project" "my_app" {
  name        = "My App"
  description = "Changelog for My App"
}

resource "nitrozen_entry" "launch" {
  project_id   = nitrozen_project.my_app.id
  title        = "v1.0 — Initial Release"
  content      = "We shipped v1.0. Thanks for your patience and support!"
  category     = "new"
  is_published = true
}

Authentication

Create an API token from the API Tokens page and pass it to the provider. It's recommended to use a Terraform variable or environment variable rather than hardcoding the token.

terraform
provider "nitrozen" {
  token = var.nitrozen_token
}

variable "nitrozen_token" {
  description = "Nitrozen API token"
  type        = string
  sensitive   = true
}

You can also provide the token via a .tfvars file or the TF_VAR_nitrozen_token environment variable:

shell
export TF_VAR_nitrozen_token="your-token-here"
terraform apply

Resource: nitrozen_project

Manages a changelog project on Nitrozen.io.

terraform
resource "nitrozen_project" "example" {
  name        = "My App"
  description = "Product updates and release notes"
}

output "project_id" {
  value = nitrozen_project.example.id
}

Arguments

Argument Type Required Description
name string Yes The name of the project.
description string No An optional description for the project.

Attributes

Attribute Type Description
id number The unique ID of the project. Exported after creation.

Resource: nitrozen_entry

Manages a changelog entry within a project.

terraform
resource "nitrozen_entry" "release" {
  project_id   = nitrozen_project.my_app.id
  title        = "v2.0 — Dark mode"
  content      = "We added dark mode support across the entire app."
  category     = "new"
  is_published = true
}

# Draft entry (is_published defaults to false)
resource "nitrozen_entry" "draft" {
  project_id = nitrozen_project.my_app.id
  title      = "Upcoming maintenance window"
  content    = "Scheduled maintenance on Saturday 2am–4am UTC."
  category   = "announcement"
}

Arguments

Argument Type Required Description
project_id number Yes The ID of the parent project. Changing this forces a new resource.
title string Yes The title of the changelog entry.
content string Yes The body content of the entry. Markdown is supported.
category string Yes The entry category. See valid values below.
is_published bool No Whether the entry is publicly visible. Defaults to false.
Every project starts with these built-in category values: new improvement fix announcement Projects on a plan with custom categories enabled can define additional category slugs from the dashboard — any of those slugs are valid here too.

Attributes

Attribute Type Description
id number The unique ID of the entry. Exported after creation.

Importing Existing Resources

Bring existing Nitrozen resources under Terraform management using terraform import.

Import a project

shell
# Import using the project ID
terraform import nitrozen_project.example 123

Import an entry

shell
# Import using project_id/entry_id
terraform import nitrozen_entry.example 42/7