Pulumi Any Terraform

Bunnynet Provider

Manage Bunny.net CDN and edge computing resources with Pulumi

The Bunnynet provider enables you to manage Bunny.net CDN, storage, DNS, and edge computing resources using Pulumi. This provider is dynamically bridged from the Terraform Bunnynet Provider.

Installation

Install the Bunnynet provider package using your preferred package manager:

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

Configuration

Getting API Key

  1. Log in to your Bunny.net account at bunny.net
  2. Navigate to Account → API
  3. Copy your API key

Provider Setup

pulumi config set bunnynet:apiKey YOUR_API_KEY --secret

Or using environment variables:

export BUNNY_API_KEY="your-api-key"

Quick Start

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

// Create a pull zone (CDN)
const pullZone = new bunnynet.PullZone("my-cdn", {
    name: "my-website-cdn",
    originUrl: "https://example.com",
});

export const cdnUrl = pullZone.cdnUrl;

Key Features

Pull Zones (CDN)

const pullZone = new bunnynet.PullZone("cdn", {
    name: "my-cdn",
    originUrl: "https://origin.example.com",
    cacheControlMaxAge: 3600,
    enableGeoZoneAsia: true,
    enableGeoZoneEurope: true,
    enableGeoZoneUS: true,
});

Storage Zones

const storageZone = new bunnynet.StorageZone("storage", {
    name: "my-storage",
    region: "DE", // Germany
    replicationRegions: ["NY", "LA"],
});

DNS Management

const dnsZone = new bunnynet.DnsZone("dns", {
    domain: "example.com",
});

const dnsRecord = new bunnynet.DnsRecord("www", {
    zoneId: dnsZone.id,
    name: "www",
    type: "A",
    value: "192.168.1.1",
    ttl: 300,
});