npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

pulumi-bunnynet

v0.11.2

Published

A Pulumi provider for managing Bunny.net CDN and edge computing resources, dynamically bridged from the Terraform Bunnynet provider with support for pull zones, storage, DNS, compute containers, and video streaming.

Readme

Pulumi Bunnynet Provider

A Pulumi provider for managing Bunny.net CDN and edge computing resources, dynamically bridged from the Terraform Bunnynet Provider.

Introduction

This package provides a Pulumi provider that enables you to manage your Bunny.net CDN, storage, DNS, compute containers, and video streaming resources using TypeScript, JavaScript, Python, Go, or C#. The provider is automatically generated from the Terraform Bunnynet provider, giving you access to all its functionality within the Pulumi ecosystem.

Features

  • Pull Zones (CDN): Create and manage CDN pull zones with edge rules, hostnames, and optimizer classes
  • Storage Management: Manage storage zones and files for global content delivery
  • DNS Management: Configure DNS zones and records for your domains
  • Compute Containers: Deploy and manage container applications at the edge
  • Video Streaming: Set up video libraries, collections, and streaming content
  • Edge Computing: Configure compute scripts with variables and secrets
  • TypeScript Support: Full type safety with comprehensive TypeScript definitions

Installation

npm

npm install pulumi-bunnynet

yarn

yarn add pulumi-bunnynet

pnpm

pnpm add pulumi-bunnynet

Configuration

Before using the provider, you need to configure authentication with your Bunny.net API credentials.

Required Configuration

  • API Key: Your Bunny.net API key
  • Access Key: Your storage access key (for storage operations)

Setting Configuration

You can configure the provider in several ways:

1. Using Pulumi Config

pulumi config set bunnynet:apiKey your-api-key
pulumi config set bunnynet:accessKey your-access-key

2. Using Environment Variables

export BUNNYNET_API_KEY="your-api-key"
export BUNNYNET_ACCESS_KEY="your-access-key"

3. Provider Constructor

import * as bunnynet from 'pulumi-bunnynet'

const provider = new bunnynet.Provider('bunnynet-provider', {
  apiKey: 'your-api-key',
  accessKey: 'your-access-key',
})

Usage

Pull Zone Management

import * as bunnynet from 'pulumi-bunnynet'

// Create a pull zone for CDN
const pullZone = new bunnynet.Pullzone('my-cdn', {
  name: 'my-website-cdn',
  originUrl: 'https://my-website.com',
  type: 'standard',
  storageZoneId: 12345,
  cacheControlMaxAge: 3600,
  cacheControlPublicMaxAge: 86400,
  addCanonicalHeader: true,
  enableGeoipCountryCode: true,
  enableOriginShield: true,
})

// Add a custom hostname
const hostname = new bunnynet.PullzoneHostname('custom-domain', {
  pullzoneId: pullZone.id,
  hostname: 'cdn.my-website.com',
  certificateId: 67890,
})

// Create edge rules
const edgeRule = new bunnynet.PullzoneEdgerule('cache-rule', {
  pullzoneId: pullZone.id,
  actionType: 'SetCacheTime',
  triggerType: 'RequestHeader',
  triggerValue: 'X-Cache-Control',
  actionParameter1: '3600',
})

Storage Management

import * as bunnynet from 'pulumi-bunnynet'

// Create a storage zone
const storageZone = new bunnynet.StorageZone('media-storage', {
  name: 'media-files',
  region: 'NY', // New York region
  replicationRegions: ['LA', 'SG'], // Los Angeles and Singapore replicas
})

// Upload files to storage
const file = new bunnynet.StorageFile('logo', {
  storageZoneName: storageZone.name,
  path: '/images/logo.png',
  source: './assets/logo.png',
  contentType: 'image/png',
})

DNS Management

import * as bunnynet from 'pulumi-bunnynet'

// Create DNS zone
const dnsZone = new bunnynet.DnsZone('my-domain', {
  domain: 'example.com',
  soaEmail: '[email protected]',
})

// Add DNS records
const aRecord = new bunnynet.DnsRecord('www-record', {
  zoneId: dnsZone.id,
  type: 'A',
  name: 'www',
  value: '203.0.113.1',
  ttl: 3600,
})

const cnameRecord = new bunnynet.DnsRecord('cdn-record', {
  zoneId: dnsZone.id,
  type: 'CNAME',
  name: 'cdn',
  value: 'b-cdn.net',
  ttl: 3600,
})

Compute Container Applications

import * as bunnynet from 'pulumi-bunnynet'

// Create container image registry
const registry = new bunnynet.ComputeContainerImageregistry('my-registry', {
  name: 'my-app-registry',
  imageUrl: 'docker.io/myorg/myapp:latest',
  username: 'myusername',
  password: 'mypassword',
})

// Deploy container app
const containerApp = new bunnynet.ComputeContainerApp('edge-app', {
  name: 'my-edge-app',
  imageRegistryId: registry.id,
  environmentVariables: [
    {
      name: 'NODE_ENV',
      value: 'production',
    },
    {
      name: 'API_URL',
      value: 'https://api.example.com',
    },
  ],
  cpu: 0.1,
  memory: 128,
})

Video Streaming

import * as bunnynet from 'pulumi-bunnynet'

// Create video library
const videoLibrary = new bunnynet.StreamLibrary('video-content', {
  name: 'my-video-library',
  storageZoneId: 12345,
  replicationRegions: ['NY', 'LA', 'SG'],
  watermarkPositionLeft: 10,
  watermarkPositionTop: 10,
  watermarkWidth: 100,
  watermarkHeight: 50,
})

// Create video collection
const collection = new bunnynet.StreamCollection('tutorials', {
  libraryId: videoLibrary.id,
  name: 'Tutorial Videos',
})

// Upload video
const video = new bunnynet.StreamVideo('intro-video', {
  libraryId: videoLibrary.id,
  title: 'Introduction Tutorial',
  collectionId: collection.id,
  // Video will be uploaded separately via API or dashboard
})

Compute Scripts

import * as bunnynet from 'pulumi-bunnynet'

// Create compute script
const script = new bunnynet.ComputeScript('edge-function', {
  name: 'my-edge-function',
  scriptType: 'standalone',
  code: `
        async function handleRequest(request) {
            const response = await fetch(request);
            const body = await response.text();
            
            // Add custom header
            const headers = new Headers(response.headers);
            headers.set('X-Processed-By', 'Bunny-Edge');
            
            return new Response(body, {
                status: response.status,
                headers: headers
            });
        }
        
        addEventListener('fetch', event => {
            event.respondWith(handleRequest(event.request));
        });
    `,
})

// Add script variables
const scriptVar = new bunnynet.ComputeScriptVariable('api-endpoint', {
  scriptId: script.id,
  name: 'API_ENDPOINT',
  value: 'https://api.example.com/v1',
})

// Add script secrets
const scriptSecret = new bunnynet.ComputeScriptSecret('api-key', {
  scriptId: script.id,
  name: 'API_KEY',
  value: 'secret-api-key-value',
})

Resources

Pull Zones

  • Pullzone: Main CDN pull zone configuration
  • PullzoneHostname: Custom domains for pull zones
  • PullzoneEdgerule: Cache and routing rules
  • PullzoneOptimizerClass: Image optimization settings

Storage

  • StorageZone: Global storage zones
  • StorageFile: Individual file management

DNS

  • DnsZone: DNS zone management
  • DnsRecord: Individual DNS records (A, AAAA, CNAME, MX, TXT, etc.)

Compute

  • ComputeContainerApp: Edge container applications
  • ComputeContainerImageregistry: Container image registries
  • ComputeScript: Edge computing scripts
  • ComputeScriptVariable: Script environment variables
  • ComputeScriptSecret: Script secrets

Video Streaming

  • StreamLibrary: Video libraries
  • StreamCollection: Video collections
  • StreamVideo: Individual videos

API Reference

For detailed API documentation, see the generated documentation in your IDE or visit the Pulumi Registry.

Authentication Setup

Getting Your API Credentials

  1. Log in to Bunny.net: Go to your Bunny.net dashboard
  2. Navigate to Account Settings: Click on your profile → Account Settings
  3. Generate API Key: Go to API section and create a new API key
  4. Storage Access Key: For storage operations, get your access key from Storage → FTP & API Access
  5. Note Your Details: Save your API key and access key securely

Testing Your Setup

import * as bunnynet from 'pulumi-bunnynet'

// Test with a simple resource query
const regions = bunnynet.getRegion({})

Examples

You can find more examples in the examples directory or check out these common use cases:

Support

This provider is a derived work of the Terraform Provider distributed under MPL 2.0.

If you encounter a bug or missing feature, please consult the source terraform-provider-bunnynet repo.

For Pulumi-specific issues, please open an issue in the pulumi-any-terraform repository.

License

This package is distributed under the MIT License. The underlying Terraform provider is distributed under MPL 2.0.