Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for LUA records (Feature Request) #65

Open
WhatshallIbreaktoday opened this issue Dec 11, 2020 · 2 comments
Open

Add support for LUA records (Feature Request) #65

WhatshallIbreaktoday opened this issue Dec 11, 2020 · 2 comments

Comments

@WhatshallIbreaktoday
Copy link

WhatshallIbreaktoday commented Dec 11, 2020

First, thanks for your great work!
Please find a new feature Request regarding Powerdns LUA Records.

Affected Resource(s)

  • powerdns_record

Expected Behavior

To be able to pass LUA Records to Powerdns. https://doc.powerdns.com/authoritative/lua-records/.
I do not expect the provider to handle the LUA syntax, but just to pass LUA Record to Powerdns API. (Let Powerdns handle issues with LUA syntax..)

@mbag
Copy link
Collaborator

mbag commented Dec 13, 2020

@WhatshallIbreaktoday do you have working API example? I couldn't find anything in the PowerDNS API documentation: https://doc.powerdns.com/authoritative/http-api/index.html

I found someone mentioned that they were able to figure out API syntax and opened issue to document it (PowerDNS/pdns#9310) but it seems no one added the documentation.

If you send me working API example (curl example would be the best), I can implement it. But since there are no checks on record type, I think that LUA type would be supported, same as A or NS or any other type.

@mbag
Copy link
Collaborator

mbag commented Dec 13, 2020

@WhatshallIbreaktoday ok, never mind, I managed to figure out the API syntax.

So it seems that this works out of the box without need to change the code. Here is the syntax (tested against docker-compose pdns server that I have for testing in this repo, after setting --enable-lua-records=yes in docker-compose.yml):

  zone = "sysa.xyz."
  name = "test-lua.sysa.xyz."
  type = "LUA"
  ttl = 60
  records = [ "A \"pickrandom({'192.168.0.111','192.168.0.222'})\"" ]
}

I don't know what LUA functions are you using, but you might need to play around with quotes and escaping them, to be able to send correct syntax to PowerDNS server.

I'll add this to documentation, however it might take some time, as I still haven't migrated to new documentation strucutre needed by Terraform Registry.

Thanks for raising this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants