Skip to main content

Configuration

Set up and configure the Bunny provider for CDN and edge computing
2 min read

This guide covers how to configure the Bunny provider for Pulumi.

Overview#

The Bunny provider requires an API key for authentication. You can manage CDN pull zones, storage zones, and edge compute scripts.

Provider Configuration#

Basic Setup#

Configuration Methods#

2. Environment Variables#

3. Pulumi Configuration#

Getting API Credentials#

Create API Key#

  1. Log in to Bunny.net dashboard
  2. Navigate to Account → API
  3. Click Add API Key
  4. Name your key (e.g., "Pulumi Integration")
  5. Set appropriate permissions
  6. Copy the generated API key

Required Permissions#

For full management capabilities:

  • Pull Zones: Read, Write
  • Storage Zones: Read, Write
  • Billing: Read (for usage monitoring)
  • Statistics: Read (for analytics)

Configuration Options#

PropertyTypeRequiredDescription
apiKeystringYesBunny.net API key

Best Practices#

Security#

Multi-Account Setup#

Integration Examples#

With Pull Zone#

With Storage Zone#

Linking Storage Zone to Pull Zone#

To use a Bunny Storage Zone as the CDN origin, set origin.type to "StorageZone" and pass the storage zone ID via origin.storagezone. The storageZoneId property on StorageZone is output-only — create the storage zone first, then reference its ID from the pull zone.

Do not confuse origin.storagezone with other pull zone storage fields:

  • logStorageZone — storage zone used for access log storage
  • permacacheStoragezone — storage zone used for Perma-Cache

Troubleshooting#

Invalid API Key#

Error: "Authentication failed: Invalid API key"

Solution:

  1. Verify API key is correct
  2. Check key hasn't been revoked
  3. Ensure key has required permissions

Rate Limiting#

Error: "Rate limit exceeded"

Solution:

  • Bunny.net has rate limits (varies by plan)
  • Add delays between resource creations
  • Use resource dependsOn to sequence operations

Permission Errors#

Error: "Insufficient permissions"

Solution:

  • Verify API key has correct permissions
  • Check account plan supports the feature
  • Ensure you're accessing resources you own

Additional Resources#