Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Allow forcing SSL on the default b-cdn.net hostname #109

Open
softminus opened this issue Mar 1, 2023 · 0 comments
Open

Allow forcing SSL on the default b-cdn.net hostname #109

softminus opened this issue Mar 1, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@softminus
Copy link

Terraform Version

sasha_work@myouren:~/src/download-server-terraform$ terraform -version
Terraform v1.3.9
on linux_amd64
+ provider registry.terraform.io/simplesurance/bunny v0.10.0
sasha_work@myouren:~/src/download-server-terraform$ 

Affected Resource(s)

  • bunny_hostname

Terraform Configuration Files

terraform {
  required_providers {
    bunny = {
      source = "registry.terraform.io/simplesurance/bunny"
    }
  }
}


provider "bunny" {
  api_key = "REDACTED"
}

resource "bunny_pullzone" "download_pullzone" {
  name       = "pz-terraform-test"
  type = 1
  follow_redirects = true
  verify_origin_ssl = true
  disable_cookies = true
  block_post_requests = true
  block_root_path_access = true
  origin_url = "https://xkcd.com"
}

resource "bunny_hostname" "bcdn_default_hostname" {
  hostname = "${bunny_pullzone.download_pullzone.name}.${bunny_pullzone.download_pullzone.cname_domain}"
  pull_zone_id = bunny_pullzone.download_pullzone.id
  force_ssl = true
}

Debug Output

https://gist.github.com/softminus/41bb3760844c97b9cf366e9669798840

Panic Output

No panic.

Expected Behavior

The "Force SSL" checkmark for the domain pz-terraform-test.b-cdn.net is set to ON, and no errors are elicited.

Actual Behavior

Terraform produces this error:

2023-02-28T17:07:57.120-0800 [ERROR] vertex "bunny_hostname.bcdn_default_hostname" error: could not add hostname
╷
│ Error: could not add hostname
│ 
│   with bunny_hostname.bcdn_default_hostname,
│   on main.tf line 25, in resource "bunny_hostname" "bcdn_default_hostname":
│   25: resource "bunny_hostname" "bcdn_default_hostname" {
│ 
│ http-request to https://api.bunny.net/pullzone/1240826/addHostname failed: Bad Request (400), pullzone.hostname_already_registered: Hostname, The hostname is already registered.

and the desired change is not executed:
Screenshot from 2023-02-28 17-11-12

Steps to Reproduce

  1. create the main.tf file with the contents above (with a valid API key of course!)
  2. terraform apply

Important Factoids

Nothing atypical that I can tell.

References

No other github issues I could find.

@fho fho added the bug Something isn't working label Mar 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants