bobtfish / terraform-provider-nsone

A terraform provider to manage zones/records/feeds in nsone
Apache License 2.0
17 stars 10 forks source link

Filter Config JSON / #16

Closed packplusplus closed 2 years ago

packplusplus commented 8 years ago

Been trying to set netfence_prefix to do split horizon DNS. There's something defining filters when a bool like netfence_prefix is converted into JSON. I'm not really sure how to fix it. Almost like when schema.TypeMap is turned into JSON nothing is defining remove_no_ip_prefixes as a bool

I get errors like

nsone_record.www_priv: 400 Bad Request: {"message":"filter declaration incorrect: \"1\" invalid for option \"remove_no_ip_prefixes\""}

In a test record

  filters {
    filter = "netfence_prefix"
    config = {
      remove_no_ip_prefixes = true
    }
  }

Gets translated into

  "filters": [{
    "filter": "netfence_prefix",
    "config": {
      "remove_no_ip_prefixes": 1
    }
  }]

I also tried

  filters {
    filter = "netfence_prefix"
    config = {
      remove_no_ip_prefixes = "true"
    }
  }

Which translates into

  "filters": [{
    "filter": "netfence_prefix",
    "config": {
      "remove_no_ip_prefixes": "true"
    }
  }],

From testing on the command line, the stanza should be

  "filters": [{
    "filter": "netfence_prefix",
    "config": {
      "remove_no_ip_prefixes": true
    }
  }]

Any thoughts on how to work around / fix this?

packplusplus commented 2 years ago

Closing, I lost context of if this is still an issue and don't want to clutter up the issues history.