@@ -910,3 +910,51 @@ func testAccCheckDomainRecordDestroy(tt *acctest.TestTools) resource.TestCheckFu
910910 return nil
911911 }
912912}
913+
914+ func TestAccDomainRecord_NameDiffSuppress (t * testing.T ) {
915+ tt := acctest .NewTestTools (t )
916+ defer tt .Cleanup ()
917+
918+ testDNSZone := "test-name-diff." + acctest .TestDomain
919+ logging .L .Debugf ("TestAccDomainRecord_NameDiffSuppress: test dns zone: %s" , testDNSZone )
920+
921+ resource .ParallelTest (t , resource.TestCase {
922+ PreCheck : func () { acctest .PreCheck (t ) },
923+ ProtoV6ProviderFactories : tt .ProviderFactories ,
924+ CheckDestroy : testAccCheckDomainRecordDestroy (tt ),
925+ Steps : []resource.TestStep {
926+ {
927+ Config : fmt .Sprintf (`
928+ resource "scaleway_domain_record" "dmarc" {
929+ dns_zone = "%s"
930+ name = "_dmarc"
931+ type = "TXT"
932+ data = "v=DMARC1; p=none"
933+ }
934+ ` , testDNSZone ),
935+ Check : resource .ComposeTestCheckFunc (
936+ testAccCheckDomainRecordExists (tt , "scaleway_domain_record.dmarc" ),
937+ resource .TestCheckResourceAttr ("scaleway_domain_record.dmarc" , "name" , "_dmarc" ),
938+ resource .TestCheckResourceAttr ("scaleway_domain_record.dmarc" , "type" , "TXT" ),
939+ resource .TestCheckResourceAttr ("scaleway_domain_record.dmarc" , "data" , "v=DMARC1; p=none" ),
940+ ),
941+ },
942+ {
943+ // Use FQDN format - should not cause replacement
944+ Config : fmt .Sprintf (`
945+ resource "scaleway_domain_record" "dmarc" {
946+ dns_zone = "%s"
947+ name = "_dmarc.%s."
948+ type = "TXT"
949+ data = "v=DMARC1; p=none"
950+ }
951+ ` , testDNSZone , testDNSZone ),
952+ Check : resource .ComposeTestCheckFunc (
953+ testAccCheckDomainRecordExists (tt , "scaleway_domain_record.dmarc" ),
954+ resource .TestCheckResourceAttr ("scaleway_domain_record.dmarc" , "name" , "_dmarc" ),
955+ resource .TestCheckResourceAttr ("scaleway_domain_record.dmarc" , "type" , "TXT" ),
956+ ),
957+ },
958+ },
959+ })
960+ }
0 commit comments