Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/resources/domain_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ The following arguments are supported:

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

- `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/).

- `name` - (Optional) The name of the record (can be an empty string for a root record).

- `type` - (Required) The type of the record (`A`, `AAAA`, `MX`, `CNAME`, `DNAME`, `ALIAS`, `NS`, `PTR`, `SRV`, `TXT`, `TLSA`, or `CAA`).
Expand Down
9 changes: 1 addition & 8 deletions internal/services/domain/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ var changeKeys = []string{
"weighted",
"view",
"dns_zone",
"keep_empty_zone",
}

func ResourceRecord() *schema.Resource {
Expand All @@ -56,12 +55,6 @@ func ResourceRecord() *schema.Resource {
Required: true,
ForceNew: true,
},
"keep_empty_zone": {
Type: schema.TypeBool,
Description: "When destroy a resource record, if a zone have only NS, delete the zone",
Optional: true,
Default: false,
},
"root_zone": {
Type: schema.TypeBool,
Description: "Does the DNS zone is the root zone or not",
Expand Down Expand Up @@ -503,7 +496,7 @@ func resourceDomainRecordDelete(ctx context.Context, d *schema.ResourceData, m a
d.SetId("")

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

Expand Down
1 change: 0 additions & 1 deletion internal/services/domain/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,6 @@ func TestAccDomainRecord_SRVZone(t *testing.T) {
name = "%[2]s"
type = "%[3]s"
data = "%[4]s"
keep_empty_zone = false
}
`, testDNSZone, name, recordType, data),
Check: resource.ComposeTestCheckFunc(
Expand Down
Loading
Loading