What you’ll need
Before you begin, make sure you have:- A bunny.net account
- Terraform installed on your machine
- Your bunny.net API key
Quickstart
1
Set up your project
- New project
- Existing project
- From template
Create a new directory and add the provider configuration:Create a
provider.tf file with the following content:You can also use the
BUNNYNET_API_KEY environment variable instead of
hardcoding your API key. See Authentication for
more options.2
Initialize Terraform
Run the init command to download the bunny.net provider:
3
Define your resources
Create a Replace
main.tf file with your infrastructure. This example creates a Storage Zone with an index file and a Pull Zone:my-project-name with your desired project name.4
Preview and apply
Preview the changes Terraform will make:Apply the configuration to create your resources:Type
yes when prompted to confirm.5
Verify your deployment
Open the bunny.net dashboard to see your new resources. Your content is now being served through the bunny.net CDN.