### Import Example Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/dns_record.md Example of how to import a DNS record. ```bash terraform import bunnynet_dns_record.test "$ZONE_ID|$RECORD_ID" ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/database.md Example of how to declare a bunnynet_database resource. ```terraform resource "bunnynet_database" "test" { name = "mydb" regions_primary = ["DE", "NY", "SG"] regions_replica = ["LA", "UK", "SYD"] } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone.md Example of how to create a bunnynet_pullzone resource. ```terraform resource "bunnynet_pullzone" "example" { name = "my-website" origin { type = "OriginUrl" url = "https://192.0.2.1" } routing { tier = "Standard" } } ``` -------------------------------- ### Import Example Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/compute_script_variable.md This is an example of how to import an existing bunnynet_compute_script_variable resource. ```shell terraform import bunnynet_compute_script_variable.test "1234|APP_ENV" ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/stream_video.md Example usage of the bunnynet_stream_video resource. ```terraform resource "bunnynet_stream_video" "example" { library = bunnynet_stream_library.example.id collection = bunnynet_stream_collection.example.id title = "Big Buck Bunny (2008)" description = "Big Buck Bunny (code-named Project Peach) is a 2008 animated comedy short film featuring animals of the forest, made by the Blender Institute, part of the Blender Foundation." chapters = [ { title = "Title" start = "00:00" end = "00:05" }, { title = "Film" start = "00:05" end = "08:15" }, { title = "Credits" start = "08:15" end = "10:19" }, { title = "Outro" start = "10:19" end = "10:35" }, ] moments = [ { label = "Bird gets hit with an acorn" timestamp = "00:25" }, { label = "Buck gets hit with an acorn" timestamp = "02:43" }, ] } ``` -------------------------------- ### Terraform Import Example Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/stream_library.md Example of how to import an existing stream library into Terraform state. ```shell terraform import bunnynet_stream_library.test 123 ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/stream_library.md This is an example of how to use the bunnynet_stream_library resource. ```terraform resource "bunnynet_stream_library" "example" { name = "example" player_controls = ["airplay", "play", "volume", "captions", "current-time", "fullscreen", "mute", "pip", "play-large", "progress", "settings"] player_captions_font_color = "#000" player_captions_font_size = 20 player_captions_background_color = "#fff" resolutions = ["240p", "360p", "480p", "720p", "1080p"] transcribing_enabled = true transcribing_languages = ["en", "fr", "es", "de"] direct_play_enabled = true } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_edgerule.md This is an example of how to configure a bunnynet_pullzone_edgerule resource. ```terraform resource "bunnynet_pullzone_edgerule" "redirect_admin" { enabled = true pullzone = bunnynet_pullzone.example.id description = "Redirect to homepage" actions = [ { type = "Redirect" parameter1 = "https://www.example.com" parameter2 = "302" parameter3 = null } ] match_type = "MatchAny" triggers = [ { type = "Url" match_type = "MatchAny" patterns = ["https://cdn.example.com/wp-admin/*"] parameter1 = null parameter2 = null } ] } ``` -------------------------------- ### MX Record Example Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/dns_record.md Example of how to create an MX DNS record. ```terraform resource "bunnynet_dns_record" "MX" { zone = bunnynet_dns_zone.example.id name = "" type = "A" value = "192.0.2.33" } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/data-sources/pullzone_access_lists.md Example of how to use the bunnynet_pullzone_access_lists data source. ```terraform resource "bunnynet_pullzone" "test" { // ... } data "bunnynet_pullzone_access_lists" "curated" { pullzone = bunnynet_pullzone.test.id custom = false } resource "bunnynet_pullzone_shield" "test" { // ... pullzone = bunnynet_pullzone.test.id access_list { id = data.bunnynet_pullzone_access_lists.curated.data["VPN Providers"].id action = "Block" } access_list { id = data.bunnynet_pullzone_access_lists.curated.data["TOR Exit Nodes"].id action = "Block" } } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/compute_script_secret.md This is an example of how to use the bunnynet_compute_script_secret resource. ```terraform resource "bunnynet_compute_script_secret" "APP_SECRET" { script = bunnynet_compute_script.test.id name = "APP_ENV" value = "" } ``` -------------------------------- ### Terraform Import Example Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone.md Example of how to import an existing Pull Zone resource into Terraform state. ```shell terraform import bunnynet_pullzone.test 123 ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/index.md Example usage of the bunnynet provider in Terraform. ```terraform terraform { required_providers { bunnynet = { source = "BunnyWay/bunnynet" } } } provider "bunnynet" { api_key = "00000000-0000-0000-0000-000000000000" } resource "bunnynet_pullzone" "example" { name = "example" origin { type = "OriginUrl" url = "https://192.0.2.1" } routing { tier = "Standard" } } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/storage_zone.md This is an example of how to use the bunnynet_storage_zone resource to create a storage zone. ```terraform resource "bunnynet_storage_zone" "example" { name = "my-storage" region = "DE" zone_tier = "Standard" } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/data-sources/video_language.md Example of how to use the bunnynet_video_language data source to retrieve language information. ```terraform data "bunnynet_video_language" "en" { code = "en" } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_shield.md This is an example of how to configure the bunnynet_pullzone_shield resource in Terraform. ```terraform resource "bunnynet_pullzone_shield" "test" { pullzone = bunnynet_pullzone.test.id tier = "Standard" ddos { level = "Medium" mode = "Block" } waf { enabled = true mode = "Block" } } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/compute_script.md This resource manages a compute script in bunny.net. ```terraform resource "bunnynet_compute_script" "test" { type = "standalone" name = "test" # to import from a file, use: # content = file("src/script.ts") content = <<-CODE import * as BunnySDK from "https://esm.sh/@bunny.net/edgescript-sdk@0.10.0"; BunnySDK.net.http.serve(async (request: Request): Response | Promise => { return new Response('

Hello world!

', {headers: {"Content-Type": "text/html"}}) }); CODE } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/compute_container_app.md This is an example of how to use the bunnynet_compute_container_app resource to manage a Magic Containers application. ```terraform resource "bunnynet_compute_container_app" "app" { name = "my-app" version = 2 autoscaling_min = 1 autoscaling_max = 3 regions_allowed = ["DE", "SG", "NY"] regions_required = ["DE"] container { name = "app" image_registry = bunnynet_compute_container_imageregistry.github.id image_namespace = "my-org" image_name = "my-app" image_tag = "2.12.6" endpoint { name = "app" type = "CDN" cdn { origin_ssl = false sticky_sessions { headers = ["X-Forwarded-For"] } } port { container = 8080 protocols = ["TCP", "UDP"] } } env { name = "APP_ENV" value = "prod" } env { name = "LISTEN_PORT" value = "3000" } volumemount { name = "data" path = "/data" } } container { name = "sidecar" image_registry = bunnynet_compute_container_imageregistry.github.id image_namespace = "my-org" image_name = "my-sidecar" image_tag = "1.3.7" } volume { name = "data" size = 2 # GB } } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_optimizer_class.md This example demonstrates how to define an optimizer class for a pull zone. ```terraform resource "bunnynet_pullzone_optimizer_class" "thumbnail" { pullzone = bunnynet_pullzone.example.id name = "thumbnail" width = 200 height = 300 brightness = 15 } ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/stream_video.md Import is supported using the following syntax: The terraform import command can be used, for example: ```bash terraform import bunnynet_stream_video.test "$LIBRARY_ID|$VIDEO_GUID" ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_optimizer_class.md This example shows how to import an existing optimizer class into Terraform state. ```bash terraform import bunnynet_pullzone_optimizer_class.test "$PULLZONE_ID|thumbnail" ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/stream_collection.md This is an example of how to use the bunnynet_stream_collection resource to create a new stream collection. ```terraform resource "bunnynet_stream_collection" "example" { library = bunnynet_stream_library.example.id name = "example collection" } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/compute_script_variable.md This is an example of how to use the bunnynet_compute_script_variable resource to manage an environment variable for a compute script. ```terraform resource "bunnynet_compute_script_variable" "APP_ENV" { script = bunnynet_compute_script.test.id name = "APP_ENV" default_value = "prod" required = true } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_access_list.md This resource manages an Access List for a bunny.net pullzone. ```terraform resource "bunnynet_pullzone_access_list" "hetzner" { pullzone = bunnynet_pullzone.test.id name = "VIP customers" action = "Allow" type = "CIDR" entries = [ "192.0.2.0/24", "2001:db8:cafe::/48" ] } ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/dns_zone.md The terraform import command can be used, for example: ```terraform terraform import bunnynet_dns_zone.test 123 ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/dns_zone.md This resource manages a DNS zone in bunny.net. It is used to create and manage DNS zones. ```terraform resource "bunnynet_dns_zone" "example" { domain = "example.com" } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_ratelimit_rule.md This resource manages a rate limit rule for a bunny.net pullzone. ```terraform resource "bunnynet_pullzone_ratelimit_rule" "wplogin" { pullzone = bunnynet_pullzone.test.id name = "WordPress Login" description = "WordPress Login" transformations = ["LOWERCASE", "NORMALIZEPATH", "URLDECODE"] condition { variable = "REQUEST_URI" operator = "BEGINSWITH" value = "/wp-login.php" } limit { requests = 2 interval = 10 # seconds } response { interval = 3600 # seconds } } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/compute_container_imageregistry.md This resource manages an Image Registry connection for Magic Containers in bunny.net. ```terraform resource "bunnynet_compute_container_imageregistry" "github" { registry = "GitHub" username = "my-github-username" token = "ghp_abc1234d" } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/data-sources/compute_container_app_container.md This data source represents a container in a Magic Containers application. ```terraform data "bunnynet_compute_container_app_container" "nginx" { app = vars.app_id name = "nginx" } ``` -------------------------------- ### docker.io public images Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/data-sources/compute_container_imageregistry.md Example for fetching public images from DockerHub. ```terraform # docker.io public images data "bunnynet_compute_container_imageregistry" "dockerhub" { registry = "DockerHub" username = "" } ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/stream_collection.md Import is supported using the following syntax: The terraform import command can be used, for example: ```shell terraform import bunnynet_stream_collection.test "$LIBRARY_ID|$COLLECTION_GUID" ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/data-sources/dns_record.md This data source represents a DNS record in Bunny DNS https://bunny.net/dns/. ```terraform data "bunnynet_dns_record" "A" { zone = data.bunnynet_dns_zone.example.id type = "A" name = "www" # id is optional, can be used to distinguish between records with the same name and type id = 123456 } output "record" { value = data.bunnynet_dns_record.A } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/data-sources/dns_zone.md This data source represents a DNS zone in Bunny DNS https://bunny.net/dns/. ```terraform data "bunnynet_dns_zone" "example" { domain = "example.org" } output "nameservers" { value = [ data.bunnynet_dns_zone.example.nameserver1, data.bunnynet_dns_zone.example.nameserver2, ] } ``` -------------------------------- ### ghcr.io public images Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/data-sources/compute_container_imageregistry.md Example for fetching public images from GitHub Container Registry. ```terraform # ghcr.io public images data "bunnynet_compute_container_imageregistry" "github" { registry = "GitHub" username = "" } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/storage_file.md This resource manages files in a bunny.net storage zone. It is used to upload, update, and delete files within a storage zone. ```terraform resource "bunnynet_storage_file" "homepage" { zone = bunnynet_storage_zone.example.id path = "index.html" ## file contents # either content = "

Hello world

" # or source = "data/index.html" } ``` -------------------------------- ### Example Usage Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_hostname.md This resource manages custom hostnames for a bunny.net pull zone. It is used to add and configure custom hostnames for pullzones. ```terraform resource "bunnynet_pullzone_hostname" "bunnynet" { pullzone = bunnynet_pullzone.example.id name = "my-pullzone.b-cdn.net" force_ssl = false } resource "bunnynet_pullzone_hostname" "custom" { pullzone = bunnynet_pullzone.example.id name = "cdn.example.com" tls_enabled = true force_ssl = true # Uploads a custom certificate. To use a managed certificate (Let's Encrypt), omit both attributes. certificate = file("cdn.example.com.cert") certificate_key = file("cdn.example.com.key") } ``` -------------------------------- ### ghcr.io private images Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/data-sources/compute_container_imageregistry.md Example for fetching private images from GitHub Container Registry for a specific organization. ```terraform # ghcr.io private images data "bunnynet_compute_container_imageregistry" "my-org" { registry = "GitHub" username = "my-org" } ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/compute_script.md Import is supported using the following syntax: ```shell terraform import bunnynet_compute_script.test 123 ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/database.md Import command for bunnynet_database resource. ```shell terraform import bunnynet_database.test db_01KF0XCACH2JDPGHZT3284MZ2V ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_access_list.md Import is supported using the following syntax: ```shell terraform import bunnynet_pullzone_access_list.my-customers "$PULLZONE_ID|$ACCESS_LIST_ID" ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_edgerule.md Import is supported using the following syntax: ```shell terraform import bunnynet_pullzone_edgerule.test "$PULLZONE_ID|$EDGERULE_GUID" ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_ratelimit_rule.md Import is supported using the following syntax: ```shell terraform import bunnynet_pullzone_ratelimit_rule.test "$PULLZONE_ID|$RULE_ID" ``` -------------------------------- ### nginx_http Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/data-sources/compute_container_app_container_endpoint.md Example usage for the bunnynet_compute_container_app_container_endpoint data source. ```terraform data "bunnynet_compute_container_app_container_endpoint" "nginx_http" { app = vars.app_id container = data.bunnynet_compute_container_app_container_endpoint.nginx.id name = "http" } output "url" { value = "https://${data.bunnynet_compute_container_app_container_endpoint.nginx_http.public_host}" } ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/storage_file.md Import is supported using the following syntax: ```shell terraform import bunnynet_storage_file.test "$STORAGE_ZONE_ID|blog/index.html" ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/compute_script_secret.md Import is supported using the following syntax: ```shell terraform import bunnynet_compute_script_secret.test "1234|APP_SECRET" ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_waf_rule.md Import is supported using the following syntax: ```terraform terraform import bunnynet_pullzone_waf_rule.test "$PULLZONE_ID|$RULE_ID" ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_hostname.md Import is supported using the following syntax: ```shell terraform import bunnynet_pullzone_hostname.test "$PULLZONE_ID|example.com" ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/storage_zone.md The `terraform import` command can be used to import an existing storage zone. ```shell terraform import bunnynet_storage_zone.test 123 ``` -------------------------------- ### Import Source: https://github.com/bunnyway/terraform-provider-bunnynet/blob/main/docs/resources/pullzone_shield.md The `terraform import` command can be used to import an existing bunnynet_pullzone_shield resource. ```shell terraform import bunnynet_pullzone_shield.test $PULLZONE_ID ```