How to define multiple dns challange api keys for the same provider?

Hi,

there seems to be a rather problematic design decision about how to provide API keys for DNS challenges. I can not define an API key for each DNS challenge. Instead, I can only provide a "global" API key via env vars. Have I missed something in the docs?

dns1 and dns2 are different gandi.net accounts. How can I provide a different API key for dns2?

My config:

command:
  - "--certificatesresolvers.dns1.acme.email=nolooky@privacy.com"
  - "--certificatesresolvers.dns1.acme.storage=/acme/dns1/acme.json"
  - "--certificatesresolvers.dns1.acme.dnschallenge=true"
  - "--certificatesresolvers.dns1.acme.dnschallenge.provider=gandiv5"

  - "--certificatesresolvers.dns2.acme.email=nolooky@privacy.com"
  - "--certificatesresolvers.dns2.acme.storage=/acme/dns2/acme.json"
  - "--certificatesresolvers.dns2.acme.dnschallenge=true"
  - "--certificatesresolvers.dns2.acme.dnschallenge.provider=gandiv5"

environment:
  - GANDIV5_API_KEY={{ dc_traefik_dns1_token }}"

Thank you for any help on this!

Hi @razem-io,
Thanks for your interest in Traefik.

Unfortunately, Traefik does not support multiple account for the same provider.
Configuring the API key for gandiV5 uses the same key for all gandiV5 usages.

Thank you, I will open a Github issue then -> Allow multiple dns challenge accounts for the same provider · Issue #9099 · traefik/traefik · GitHub

EDIT: There is already an open issue here: Provide dnsChallenge credentials per resolver · Issue #5472 · traefik/traefik · GitHub