Terraform Provider

Manage FoPost workspaces, labels, webhooks, and automations as code.

The official Terraform provider manages the durable parts of a social publishing setup as code: workspaces, labels, webhooks, and automations. It is built on terraform-plugin-framework and the Go SDK, which owns every request, retry, and error the provider makes.

Needs Terraform 1.8 or newer.

This is a 0.x release. The schema is still settling and a minor version may change it. Pin an exact version if that matters to you.

Published on the Terraform Registry. Source and issues: github.com/fopost/terraform-provider-fopost. MIT licensed.

Install

Once the provider is published to the Terraform Registry as fopost/fopost, declaring it is all it takes:

terraform {
  required_providers {
    fopost = {
      source  = "fopost/fopost"
      version = "~> 0.1"
    }
  }
}

The registry listing is not live yet: the first publish is a manual, one-time onboarding step and it is still pending. Until it lands, build the provider from source and point Terraform at your build with a dev_overrides block in ~/.terraformrc.

Configure

The provider needs an API key, created at Settings → API Keys in the dashboard.

export FOPOST_API_KEY="fp_..."
provider "fopost" {}

Or pass it explicitly, from a variable your secret store fills in:

provider "fopost" {
  api_key = var.fopost_api_key
}
ArgumentEnvironment variableDefault
api_keyFOPOST_API_KEYnone, required
base_urlFOPOST_BASE_URLhttps://api.fopost.com/v1

api_key is marked sensitive, so it never appears in plan output. Leave base_url alone unless you are targeting another deployment.

Example

A workspace, the labels its campaigns report against, and a webhook that pushes delivery events to a system you operate:

resource "fopost_workspace" "acme" {
  name        = "Acme Social"
  slug        = "acme-social"
  type        = "TEAM"
  timezone    = "Europe/Berlin"
  description = "Everything Acme publishes."
}

resource "fopost_label" "launch" {
  workspace_id = fopost_workspace.acme.id
  name         = "Launch Week"
  color        = "#2563eb"
}

resource "fopost_webhook" "delivery" {
  workspace_id = fopost_workspace.acme.id
  url          = "https://hooks.acme.example.com/fopost"

  events = [
    "post.published",
    "post.failed",
    "delivery.failed",
    "account.health_changed",
  ]
}

# Issued once, at creation. Hand it to whatever verifies the signature.
output "webhook_signing_secret" {
  value     = fopost_webhook.delivery.secret
  sensitive = true
}

What it manages

ResourceWhat it is
fopost_workspaceThe tenant boundary everything else is scoped to
fopost_labelA campaign tag posts are grouped and reported by
fopost_webhookAn outbound event subscription, with its signing secret
fopost_automationA trigger and the ordered steps it runs
Data sourceWhat it reads
fopost_workspaceOne workspace and the accounts connected to it
fopost_workspacesEvery workspace the API key can reach
fopost_accountOne connected social account
fopost_accountsConnected accounts and their connection health
fopost_labelsLabels, optionally narrowed to one workspace

Every resource supports terraform import by its identifier.

What it deliberately does not manage

Posts are not a resource. A published post is an event, not infrastructure: Terraform would try to "update" content already live on a social network, and would delete real posts the moment the block left the configuration. Create posts through the API or one of the SDKs.

Connected accounts are read, not created. Connecting one is an interactive OAuth handshake in the dashboard.

Errors, retries, and drift

Transport is the Go SDK's, unchanged: a 30-second timeout, three attempts, exponential backoff on 429 and 5xx, and Retry-After honoured. The provider translates what is left into a diagnostic that names the failed action, the HTTP status, and the API's own error code, never the API key.

Reads treat a 404 as gone upstream: the object is removed from state and planned for re-creation rather than failing the run.

Next

Related documentation
  • SDKs & Integrations

    Official FoPost clients for TypeScript, Python, PHP, Ruby, Go, Rust, Java, .NET, Swift, Kotlin, Dart, and Elixir, framework integrations from Laravel to Next.js, and tooling for the CLI, CI, Terraform, and the automation platforms.

  • SDKs Overview

    Every official FoPost client, what it covers, and how to pick one.

  • TypeScript SDK

    The official TypeScript and Node.js client for the FoPost API.

  • Python SDK

    The official Python client for the FoPost API.

  • PHP SDK

    The official PHP client for the FoPost API, with no framework and no HTTP library.

  • Ruby SDK

    The official Ruby client for the FoPost API, with no runtime dependencies.

  • Go SDK

    The official Go client for the FoPost API.

  • Rust SDK

    The official Rust client for the FoPost API, async and built on reqwest.

Was this helpful?

On this page