Pulumi Any Terraform

Logtail Provider

Manage Logtail log management resources with Pulumi

The Logtail provider enables you to manage log sources, metrics, and analytics resources in Logtail using Pulumi. This provider is dynamically bridged from the Terraform Logtail Provider.

Installation

Install the Logtail provider package using your preferred package manager:

bun add pulumi-logtail
pnpm add pulumi-logtail
yarn add pulumi-logtail
npm install pulumi-logtail

Configuration

Getting API Token

  1. Log in to Logtail at logs.betterstack.com
  2. Navigate to Settings → API Tokens
  3. Create a new API token
  4. Copy the token value

Provider Setup

pulumi config set logtail:apiToken YOUR_API_TOKEN --secret

Or using environment variables:

export LOGTAIL_API_TOKEN="your-api-token"

Quick Start

import * as pulumi from "@pulumi/pulumi";
import * as logtail from "pulumi-logtail";

// Create a log source
const source = new logtail.Source("app-logs", {
    name: "Application Logs",
    platform: "docker",
});

export const sourceToken = source.token;

Key Features

Log Sources

const dockerSource = new logtail.Source("docker", {
    name: "Docker Containers",
    platform: "docker",
});

const syslogSource = new logtail.Source("syslog", {
    name: "System Logs",
    platform: "syslog",
});

Views

const errorView = new logtail.View("errors", {
    name: "Error Logs",
    query: "level:error",
});