My solution is to use dynamic variables and append the domain with the dot replaced by an underscore to the variable so you can export a set for each domain.
Better yet would be to make use of the json file "/etc/letsencrypt/acmedns.json" that contains the accounts.
Similar to how it is used here: https://github.com/joohoi/acme-dns-certbot-joohoi/blob/master/acme-dns-auth.py