@@ -651,6 +651,49 @@ func TestAccScalewayDomainRecord_Weighted(t *testing.T) {
651651 })
652652}
653653
654+ func TestAccScalewayDomainRecord_SRVZone (t * testing.T ) {
655+ tt := NewTestTools (t )
656+ defer tt .Cleanup ()
657+
658+ testDNSZone := fmt .Sprintf ("test-srv.%s" , testDomain )
659+ l .Debugf ("TestAccScalewayDomainRecord_SRVZone: test dns zone: %s" , testDNSZone )
660+
661+ name := "_proxy-preproduction._tcp"
662+ recordType := "SRV"
663+ data := "100 1 3128 bigbox.example.com."
664+ ttl := 3600 // default value
665+ priority := 100 // default value
666+
667+ resource .ParallelTest (t , resource.TestCase {
668+ PreCheck : func () { testAccPreCheck (t ) },
669+ ProviderFactories : tt .ProviderFactories ,
670+ CheckDestroy : testAccCheckScalewayDomainRecordDestroy (tt ),
671+ Steps : []resource.TestStep {
672+ {
673+ Config : fmt .Sprintf (`
674+ resource "scaleway_domain_record" "proxy_srv" {
675+ dns_zone = "%[1]s"
676+ name = "%[2]s"
677+ type = "%[3]s"
678+ data = "%[4]s"
679+ keep_empty_zone = false
680+ }
681+ ` , testDNSZone , name , recordType , data ),
682+ Check : resource .ComposeTestCheckFunc (
683+ testAccCheckScalewayDomainRecordExists (tt , "scaleway_domain_record.proxy_srv" ),
684+ resource .TestCheckResourceAttr ("scaleway_domain_record.proxy_srv" , "dns_zone" , testDNSZone ),
685+ resource .TestCheckResourceAttr ("scaleway_domain_record.proxy_srv" , "name" , name ),
686+ resource .TestCheckResourceAttr ("scaleway_domain_record.proxy_srv" , "type" , recordType ),
687+ resource .TestCheckResourceAttr ("scaleway_domain_record.proxy_srv" , "data" , data ),
688+ resource .TestCheckResourceAttr ("scaleway_domain_record.proxy_srv" , "ttl" , fmt .Sprint (ttl )),
689+ resource .TestCheckResourceAttr ("scaleway_domain_record.proxy_srv" , "priority" , fmt .Sprint (priority )),
690+ testCheckResourceAttrUUID ("scaleway_domain_record.proxy_srv" , "id" ),
691+ ),
692+ },
693+ },
694+ })
695+ }
696+
654697func testAccCheckScalewayDomainRecordExists (tt * TestTools , n string ) resource.TestCheckFunc {
655698 return func (s * terraform.State ) error {
656699 rs , ok := s .RootModule ().Resources [n ]
0 commit comments