bluecatlabs / terraform-provider-bluecat

Apache License 2.0
6 stars 4 forks source link

bluecat_host_record error updating TTL #14

Open rpieterick opened 1 year ago

rpieterick commented 1 year ago

code:

terraform {
  required_providers {
    bluecat = {
      source  = "bluecatlabs/bluecat"
      version = "~> 1.1"
    }
  }
}

provider "bluecat" {
  server           = "127.0.0.1"
  api_version      = "1"
  transport        = "http"
  port             = "8000"
  username         = "BlueCatGateway"
  encrypt_password = false
  password         = "******"
}

resource "bluecat_host_record" "host_record" {
  configuration = "testing"
  view          = "Internal"
  absolute_name = "host-record-example.bluecat.test"
  ip4_address   = "10.0.0.21"
  ttl           = 7200
}

versions:

Terraform v1.3.6
on linux_amd64
+ provider registry.terraform.io/bluecatlabs/bluecat v1.1.0

REST API image is 23.2.1

output:

bluecat_host_record.host_record: Refreshing state... [id=host-record-example.bluecat.test]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # bluecat_host_record.host_record will be updated in-place
  ~ resource "bluecat_host_record" "host_record" {
        id            = "host-record-example.bluecat.test"
      ~ ttl           = 3600 -> 7200
        # (5 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

bluecat_host_record.host_record: Modifying... [id=host-record-example.bluecat.test]
╷
│ Error: Error updating Host record host-record-example.bluecat.test: API request error: 500('500 INTERNAL SERVER ERROR'). Contents: {"message": "Internal Server Error"}
│
│
│   with bluecat_host_record.host_record,
│   on main.tf line 20, in resource "bluecat_host_record" "host_record":
│   20: resource "bluecat_host_record" "host_record" {
│
╵

error on API Gateway:

[2023-06-01 23:58:33.621813] [wsgi] [ERROR] [app] [gateway] Exception on /api/v1/configurations/testing/views/Internal/host_records/host-record-example.bluecat.test/ [PATCH]
[2023-06-01 23:58:33.621854] [wsgi] Traceback (most recent call last):
[2023-06-01 23:58:33.621858] [wsgi]   File "/venv/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
[2023-06-01 23:58:33.621860] [wsgi]     rv = self.dispatch_request()
[2023-06-01 23:58:33.621862] [wsgi]   File "/venv/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
[2023-06-01 23:58:33.621865] [wsgi]     return self.view_functions[rule.endpoint](**req.view_args)
[2023-06-01 23:58:33.621867] [wsgi]   File "/venv/lib/python3.9/site-packages/flask_restplus/api.py", line 325, in wrapper
[2023-06-01 23:58:33.621868] [wsgi]     resp = resource(*args, **kwargs)
[2023-06-01 23:58:33.621870] [wsgi]   File "/venv/lib/python3.9/site-packages/flask/views.py", line 89, in view
[2023-06-01 23:58:33.621872] [wsgi]     return self.dispatch_request(*args, **kwargs)
[2023-06-01 23:58:33.621874] [wsgi]   File "/venv/lib/python3.9/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
[2023-06-01 23:58:33.621876] [wsgi]     resp = meth(*args, **kwargs)
[2023-06-01 23:58:33.621878] [wsgi]   File "/portal/bluecat/util/endpoint_decorators.py", line 179, in decorated_function
[2023-06-01 23:58:33.621880] [wsgi]     return func(*args, **kwargs)
[2023-06-01 23:58:33.621882] [wsgi]   File "/portal/builtin/workflows/rest_api/v1/dns_page.py", line 690, in patch
[2023-06-01 23:58:33.621884] [wsgi]     host_record.set_properties(util.properties_to_map(properties))
[2023-06-01 23:58:33.621886] [wsgi]   File "/portal/bluecat/api_object.py", line 77, in set_properties
[2023-06-01 23:58:33.621888] [wsgi]     raise PortalException(
[2023-06-01 23:58:33.621890] [wsgi] bluecat.api_exception.PortalException: BlueCat API exception:Property: 'addressIds' can not be changed in class 'HostRecord'.