BunnyWay / terraform-provider-bunnynet

bunny.net Terraform provider
https://registry.terraform.io/providers/BunnyWay/bunnynet
Mozilla Public License 2.0
7 stars 1 forks source link

Bug. bunnynet_pullzone #4

Closed AndreiPaulau closed 3 months ago

AndreiPaulau commented 3 months ago

Not setting use_background_update which is false by default leads to error

When applying changes to module.wasm_bunny_cdn.bunnynet_pullzone.wasm, provider "provider[\"registry.terraform.io/bunnyway/bunnynet\"]" produced an unexpected new value: .use_background_update: was cty.False, but now │ cty.True.

resource content

resource "bunnynet_pullzone" "wasm" {
  name = "${local.name}-${local.environment}-${local.domain}"

  origin {
    type                = "StorageZone"
    storagezone         = bunnynet_storage_zone.wasm.id
    verify_ssl          = true
    forward_host_header = false
    follow_redirects    = false
  }

  routing {
    tier  = "Standard"
    zones = var.pull_zone_routing_zones
  }

  tls_support = []

  cache_enabled         = false
  cache_errors          = false
  cache_expiration_time = 2592000
  cache_stale           = ["offline", "updating"]

  cors_enabled    = true
  cors_extensions = ["data", "js", "br", "gz", "wasm"]

  originshield_enabled = false

  block_root_path     = true
  block_post_requests = true
  block_no_referer    = false

  log_enabled          = true
  log_anonymized       = true
  log_anonymized_style = "OneDigit"
  log_forward_enabled  = false

  use_background_update = true
}
rafael-at-bunny commented 3 months ago

Hi!

Thank you for your report.

I've checked with our API team and using the cache_stale options requires use_background_update to be true. I've updated the provider to automatically set it to true, so users shouldn't need to define use_background_update anymore.

The fix has been released in v0.3.10.

Thank you!