Skip to content

Commit 209bb81

Browse files
authored
fix(domaim): remove keep empty zone (#3217)
1 parent f0bd00c commit 209bb81

File tree

4 files changed

+150
-111
lines changed

4 files changed

+150
-111
lines changed

docs/resources/domain_record.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ The following arguments are supported:
207207

208208
- `dns_zone` - (Required) The DNS zone of the domain. If the domain has no DNS zone, one will be automatically created.
209209

210-
- `keep_empty_zone` - (Optional, defaults to `false`) When destroying a resource, if only NS records remain and this is set to `false`, the zone will be deleted. Note that each zone not deleted will [be billed](https://www.scaleway.com/en/dns/).
211-
212210
- `name` - (Optional) The name of the record (can be an empty string for a root record).
213211

214212
- `type` - (Required) The type of the record (`A`, `AAAA`, `MX`, `CNAME`, `DNAME`, `ALIAS`, `NS`, `PTR`, `SRV`, `TXT`, `TLSA`, or `CAA`).

internal/services/domain/record.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ var changeKeys = []string{
2929
"weighted",
3030
"view",
3131
"dns_zone",
32-
"keep_empty_zone",
3332
}
3433

3534
func ResourceRecord() *schema.Resource {
@@ -56,12 +55,6 @@ func ResourceRecord() *schema.Resource {
5655
Required: true,
5756
ForceNew: true,
5857
},
59-
"keep_empty_zone": {
60-
Type: schema.TypeBool,
61-
Description: "When destroy a resource record, if a zone have only NS, delete the zone",
62-
Optional: true,
63-
Default: false,
64-
},
6558
"root_zone": {
6659
Type: schema.TypeBool,
6760
Description: "Does the DNS zone is the root zone or not",
@@ -503,7 +496,7 @@ func resourceDomainRecordDelete(ctx context.Context, d *schema.ResourceData, m a
503496
d.SetId("")
504497

505498
// for non-root zone, if the zone have only NS records, then delete the zone
506-
if d.Get("keep_empty_zone").(bool) || d.Get("root_zone").(bool) {
499+
if d.Get("root_zone").(bool) {
507500
return nil
508501
}
509502

internal/services/domain/record_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,6 @@ func TestAccDomainRecord_SRVZone(t *testing.T) {
675675
name = "%[2]s"
676676
type = "%[3]s"
677677
data = "%[4]s"
678-
keep_empty_zone = false
679678
}
680679
`, testDNSZone, name, recordType, data),
681680
Check: resource.ComposeTestCheckFunc(

0 commit comments

Comments
 (0)