bluecatlabs/terraform-provider-bluecat

Terraform plan results in 404 error

Opened this issue · 1 comments

Terraform Core Version

v1.5.7

Bluecat Provider Version

1.1.1

Affected Resource(s)

bluecat_host_record

bluecat_ptr_record

bluecat_cname_record

Expected Behavior

When running a terraform plan the plan output should be displayed with the above resources planned for creation.

Actual Behavior

An 404 error message is output and no plan is displayed.

Relevant Error/Panic Output Snippet

Error: API request error: 404('404 Not Found'). Contents: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL //EN" "http://www.w3.org/TR/html4/loose.dtd">

<!-- Application: proteus -->
<!-- Page: NotAuthenticated -->
<!-- Generated: Tue Dec 19 10:15:09 CST 2023 -->
....
with provider["registry.terraform.io/bluecatlabs/bluecat"]
on provider.tf  line 1, in provider "bluecat":
1: provider "bluecat" {...

Terraform Configuration Files

terraform {
  required_version = "= 1.5.7"
  required_providers {
    bluecat = {
      source = "bluecatlabs/bluecat"
      version = "1.1.1"
    }
  }
}

provider "bluecat" {
  server = "10.0.0.2"
  api_version = "1"
  transport = "http"
  port = "5000"
  encrypt_password = "False"
  username = "$BLUECAT_USER"
  password = "$BLUECAT_PASS"
}

resource "bluecat_host_record" "host_record" {
  configuration = "terraform_demo"
  view = "gg"
  zone = "gateway.com"
  absolute_name = "testhost"
  ip4_address = "30.0.0.124"
  ttl = 123
  properties = ""
}

Steps to Reproduce

  1. Save the above in main.tf
  2. Run terraform init
  3. Run terraform plan

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

Damn this repo is dead ..

Anyway, rest container configured, the api call towards the BAM are not correctly setup :

BAM 9.5.1 / api v2
rest image is 23.3

image

data "bluecat_ipv4block" "toronto_network" {
  configuration="groupe-mutuel"
  cidr="10.128.0.0/11"
}

output "id" {
  value = data.bluecat_ipv4block.toronto_network
}

output "cidr" {
  value = data.bluecat_ipv4block.toronto_network.cidr
}
terraform {
  required_providers {
    bluecat = {
      source = "bluecatlabs/bluecat"
      version = "1.1.1"
    }
  }
}

provider "bluecat" {
  # Configuration options
    server = "127.0.0.1"
    api_version = "2"
    transport = "http"
    port = "8000"
    username = "user"
    encrypt_password = false
    password = "pass"
}

a terraform plan results in the following logs in the gateway/rest container :

2024-02-16 11:05:58.266339] [wsgi] [ERROR] [app] [gateway] Endpoint /api/v2/configurations/configuration-demo**/ipv4_blocks/10.128.0.0/11/** caught unexpected error: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
[2024-02-16 11:05:58.266562] [wsgi] [ERROR] [app] [gateway] Traceback (most recent call last):
[2024-02-16 11:05:58.266571] [wsgi]   File "/venv/lib/python3.9/site-packages/flask/app.py", line 1517, in full_dispatch_request
[2024-02-16 11:05:58.266573] [wsgi]     rv = self.dispatch_request()
[2024-02-16 11:05:58.266575] [wsgi]   File "/venv/lib/python3.9/site-packages/flask/app.py", line 1493, in dispatch_request
[2024-02-16 11:05:58.266577] [wsgi]     self.raise_routing_exception(req)
[2024-02-16 11:05:58.266579] [wsgi]   File "/venv/lib/python3.9/site-packages/flask/app.py", line 1475, in raise_routing_exception
[2024-02-16 11:05:58.266581] [wsgi]     raise request.routing_exception  # type: ignore
[2024-02-16 11:05:58.266582] [wsgi]   File "/venv/lib/python3.9/site-packages/flask/ctx.py", line 397, in match_request
[2024-02-16 11:05:58.266584] [wsgi]     result = self.url_adapter.match(return_rule=True)  # type: ignore
[2024-02-16 11:05:58.266586] [wsgi]   File "/venv/lib/python3.9/site-packages/werkzeug/routing.py", line 2047, in match
[2024-02-16 11:05:58.266588] [wsgi]     raise NotFound()
[2024-02-16 11:05:58.266590] [wsgi] werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.