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#
1. Provider Block (Recommended)#
2. Environment Variables#
3. Pulumi Configuration#
Getting API Credentials#
Create API Key#
- Log in to Bunny.net dashboard
- Navigate to Account → API
- Click Add API Key
- Name your key (e.g., "Pulumi Integration")
- Set appropriate permissions
- 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#
| Property | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Bunny.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 storagepermacacheStoragezone— storage zone used for Perma-Cache
Troubleshooting#
Invalid API Key#
Error: "Authentication failed: Invalid API key"
Solution:
- Verify API key is correct
- Check key hasn't been revoked
- 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
dependsOnto 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