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-logtailpnpm add pulumi-logtailyarn add pulumi-logtailnpm install pulumi-logtailConfiguration
Getting API Token
- Log in to Logtail at logs.betterstack.com
- Navigate to Settings → API Tokens
- Create a new API token
- Copy the token value
Provider Setup
pulumi config set logtail:apiToken YOUR_API_TOKEN --secretOr 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",
});