From 77fdd3a9ae495e740979a635e5ed0be0fbb2815d Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Mon, 27 Mar 2023 16:34:50 +0200 Subject: [PATCH] Adding DKIM example Closes #54 Info is taken from https://github.com/timohirt/terraform-provider-hetznerdns/issues/54#issuecomment-1484124155 --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 1e5100c..7856c1e 100644 --- a/README.md +++ b/README.md @@ -136,4 +136,20 @@ resource "hetznerdns_record" "example_com_spf" { value = jsonencode("v=spf1 ip4:1.2.3.4 -all") type = "TXT" } + +# DKIM record +locals { + dkim = "v=DKIM1;h=sha256;k=rsa;s=email;p=abc..."} +} +resource "hetznerdns_record" "example_com_dkim" { + zone_id = hetznerdns_zone.example_com.id + name = "default._domainkey" + type = "TXT" + # Since the maximum length of a DNS record is 255, it needs to be split in 2 parts: + value = join(" ", [ + jsonencode(substr(local.dkim, 0, 255)), + jsonencode(substr(local.dkim, 255, 255)), + "" + ]) +} ```