@@ -124,6 +124,34 @@ func TestAccDomainZoneRecord_Basic(t *testing.T) {
124
124
"ovh_domain_zone_record.foobar" , "ttl" , "3600" ),
125
125
),
126
126
},
127
+ {
128
+ Config : testAccCheckOvhDomainZoneRecordConfig_A (zone , subdomain , "192.168.0.11" , 0 ),
129
+ Check : resource .ComposeTestCheckFunc (
130
+ testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
131
+ resource .TestCheckResourceAttr (
132
+ "ovh_domain_zone_record.foobar" , "subdomain" , subdomain ),
133
+ resource .TestCheckResourceAttr (
134
+ "ovh_domain_zone_record.foobar" , "zone" , zone ),
135
+ resource .TestCheckResourceAttr (
136
+ "ovh_domain_zone_record.foobar" , "target" , "192.168.0.11" ),
137
+ resource .TestCheckResourceAttr (
138
+ "ovh_domain_zone_record.foobar" , "ttl" , "0" ),
139
+ ),
140
+ },
141
+ {
142
+ Config : testAccCheckOvhDomainZoneRecordConfig_A_noTTL (zone , subdomain , "192.168.0.12" ),
143
+ Check : resource .ComposeTestCheckFunc (
144
+ testAccCheckOvhDomainZoneRecordExists ("ovh_domain_zone_record.foobar" , & record ),
145
+ resource .TestCheckResourceAttr (
146
+ "ovh_domain_zone_record.foobar" , "subdomain" , subdomain ),
147
+ resource .TestCheckResourceAttr (
148
+ "ovh_domain_zone_record.foobar" , "zone" , zone ),
149
+ resource .TestCheckResourceAttr (
150
+ "ovh_domain_zone_record.foobar" , "target" , "192.168.0.12" ),
151
+ resource .TestCheckResourceAttr (
152
+ "ovh_domain_zone_record.foobar" , "ttl" , "0" ),
153
+ ),
154
+ },
127
155
},
128
156
})
129
157
}
@@ -312,6 +340,16 @@ resource "ovh_domain_zone_record" "foobar" {
312
340
}` , zone , subdomain , target , ttl )
313
341
}
314
342
343
+ func testAccCheckOvhDomainZoneRecordConfig_A_noTTL (zone , subdomain , target string ) string {
344
+ return fmt .Sprintf (`
345
+ resource "ovh_domain_zone_record" "foobar" {
346
+ zone = "%s"
347
+ subdomain = "%s"
348
+ target = "%s"
349
+ fieldtype = "A"
350
+ }` , zone , subdomain , target )
351
+ }
352
+
315
353
func testAccCheckOvhDomainZoneRecordConfig_CNAME (zone , subdomain , target string , ttl int ) string {
316
354
return fmt .Sprintf (`
317
355
resource "ovh_domain_zone_record" "foobar" {
0 commit comments