Mastercard / terraform-provider-restapi

A terraform provider to manage objects in a RESTful API
Other
808 stars 217 forks source link

Diff is not shown in case of manual changes outside of terraform #241

Open pwilczynskiclearcode opened 1 year ago

pwilczynskiclearcode commented 1 year ago

When I call TF_LOG=debug terraform plan

I can see that provider/terraform detects manual changes as it's in the debug logs:

      - .api_data["OriginHostHeader"]: was cty.StringVal("a-bucket-com.storage.googleapis.com"), but now cty.StringVal("b-bucket-com.storage.googleapis.com")

but it doesn't appear in the plan output

No changes. Your infrastructure matches the configuration.

My terraform config:

provider "restapi" {
  create_returns_object = true
  debug                 = true
  headers = {
    "AccessKey"    = var.bunny_access_key
    "Content-Type" = "application/json"
  }
  update_method        = "POST"
  uri                  = "https://api.bunny.net/"
  write_returns_object = true
}
resource "restapi_object" "pull-zone" {
  create_path = "/pullzone/"
  data = jsonencode({
    Name             = "my-unique-name"
    OriginUrl        =  "http://a-bucket-com.storage.googleapis.com"
    OriginHostHeader = "a-bucket-com.storage.googleapis.com"
  })
  debug = true
  id_attribute = "Id"
  path         = "/pullzone/"
  read_path    = "/pullzone/{id}"
  update_path  = "/pullzone/{id}"
}