Skip to content

Commit 8ce92f7

Browse files
committed
fix(domain): remove ds records option
1 parent 27737a5 commit 8ce92f7

File tree

7 files changed

+2466
-2099
lines changed

7 files changed

+2466
-2099
lines changed

docs/resources/domain_domains_registration.md renamed to docs/resources/domain_registration.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
subcategory: "Domains and DNS"
3-
page_title: "Scaleway: scaleway_domain_domains_registration"
3+
page_title: "Scaleway: scaleway_domain_registration"
44
---
55

6-
# Resource: scaleway_domain_domains_registration
6+
# Resource: scaleway_domain_registration
77

8-
The `scaleway_domain_domains_registration` resource allows you to purchase and manage domain registrations with Scaleway. Using this resource you can register one or more domains for a specified duration, configure auto-renewal and DNSSEC options, and set contact information. You can supply an owner contact either by providing an existing contact ID or by specifying the complete contact details. The resource automatically returns additional contact information (administrative and technical) as provided by the Scaleway API.
8+
The `scaleway_domain_registration` resource allows you to purchase and manage domain registrations with Scaleway. Using this resource you can register one or more domains for a specified duration, configure auto-renewal and DNSSEC options, and set contact information. You can supply an owner contact either by providing an existing contact ID or by specifying the complete contact details. The resource automatically returns additional contact information (administrative and technical) as provided by the Scaleway API.
99

1010
Refer to the [Domains and DNS documentation](https://www.scaleway.com/en/docs/network/domains-and-dns/) and the [API documentation](https://developers.scaleway.com/) for more details.
1111

@@ -16,7 +16,7 @@ Refer to the [Domains and DNS documentation](https://www.scaleway.com/en/docs/ne
1616
The following example purchases a domain with a one-year registration period and specifies the owner contact details. Administrative and technical contacts are returned by the API.
1717

1818
```terraform
19-
resource "scaleway_domain_domains_registration" "test" {
19+
resource "scaleway_domain_registration" "test" {
2020
domain_names = ["example.com"]
2121
duration_in_years = 1
2222
@@ -41,7 +41,7 @@ resource "scaleway_domain_domains_registration" "test" {
4141
You can update the resource to enable auto-renewal and DNSSEC:
4242

4343
```terraform
44-
resource "scaleway_domain_domains_registration" "test" {
44+
resource "scaleway_domain_registration" "test" {
4545
domain_names = ["example.com"]
4646
duration_in_years = 1
4747
@@ -69,7 +69,7 @@ resource "scaleway_domain_domains_registration" "test" {
6969
The following example registers several domains in one go:
7070

7171
```terraform
72-
resource "scaleway_domain_domains_registration" "multi" {
72+
resource "scaleway_domain_registration" "multi" {
7373
domain_names = ["domain1.com", "domain2.com", "domain3.com"]
7474
duration_in_years = 1
7575
@@ -102,8 +102,6 @@ The following arguments are supported:
102102
- `technical_contact` (Computed, List): Technical contact information.
103103
- `auto_renew` (Optional, Boolean, Default: false): Enables or disables auto-renewal.
104104
- `dnssec` (Optional, Boolean, Default: false): Enables or disables DNSSEC.
105-
- `ds_record` (Optional, List): DNSSEC DS record configuration.
106-
- `is_external` (Optional, Boolean, Computed): Indicates whether Scaleway is the registrar.
107105

108106
## Attributes Reference
109107

@@ -116,6 +114,10 @@ In addition to all arguments above, the following attributes are exported:
116114
- `registrar`: Name of the registrar.
117115
- `status`: Status of the domain registration.
118116
- `dns_zones`: List of DNS zones associated with the domain.
117+
- `ds_record`: DNSSEC DS record configuration.
118+
- `task_id`: ID of the task that created the domain.
119+
120+
119121

120122
## Contact Blocks
121123

@@ -139,7 +141,7 @@ Each contact block supports the following attributes:
139141
To import an existing domain registration, use:
140142

141143
```bash
142-
terraform import scaleway_domain_domains_registration.test <project_id>/<task_id>
144+
terraform import scaleway_domain_registration.test <project_id>/<task_id>
143145
```
144146

145147

internal/provider/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func Provider(config *Config) plugin.ProviderFunc {
139139
"scaleway_container_token": container.ResourceToken(),
140140
"scaleway_container_trigger": container.ResourceTrigger(),
141141
"scaleway_domain_record": domain.ResourceRecord(),
142-
"scaleway_domain_domains_registration": domain.ResourceDomainsRegistration(),
142+
"scaleway_domain_registration": domain.ResourceRegistration(),
143143
"scaleway_domain_zone": domain.ResourceZone(),
144144
"scaleway_flexible_ip": flexibleip.ResourceIP(),
145145
"scaleway_flexible_ip_mac_address": flexibleip.ResourceMACAddress(),

internal/services/domain/helpers.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -580,42 +580,6 @@ func waitForTaskCompletion(ctx context.Context, registrarAPI *domain.RegistrarAP
580580
})
581581
}
582582

583-
func ExpandDSRecord(dsRecordList []interface{}) *domain.DSRecord {
584-
if len(dsRecordList) == 0 || dsRecordList[0] == nil {
585-
return nil
586-
}
587-
588-
dsRecordMap := dsRecordList[0].(map[string]interface{})
589-
dsRecord := &domain.DSRecord{
590-
KeyID: uint32(dsRecordMap["key_id"].(int)),
591-
Algorithm: domain.DSRecordAlgorithm(dsRecordMap["algorithm"].(string)),
592-
}
593-
594-
if digestList, ok := dsRecordMap["digest"].([]interface{}); ok && len(digestList) > 0 {
595-
digestMap := digestList[0].(map[string]interface{})
596-
dsRecord.Digest = &domain.DSRecordDigest{
597-
Type: domain.DSRecordDigestType(digestMap["type"].(string)),
598-
Digest: digestMap["digest"].(string),
599-
}
600-
601-
if publicKeyList, ok := digestMap["public_key"].([]interface{}); ok && len(publicKeyList) > 0 {
602-
publicKeyMap := publicKeyList[0].(map[string]interface{})
603-
dsRecord.Digest.PublicKey = &domain.DSRecordPublicKey{
604-
Key: publicKeyMap["key"].(string),
605-
}
606-
}
607-
}
608-
609-
if publicKeyList, ok := dsRecordMap["public_key"].([]interface{}); ok && len(publicKeyList) > 0 {
610-
publicKeyMap := publicKeyList[0].(map[string]interface{})
611-
dsRecord.PublicKey = &domain.DSRecordPublicKey{
612-
Key: publicKeyMap["key"].(string),
613-
}
614-
}
615-
616-
return dsRecord
617-
}
618-
619583
func FlattenDSRecord(dsRecords []*domain.DSRecord) []interface{} {
620584
if len(dsRecords) == 0 {
621585
return []interface{}{}

0 commit comments

Comments
 (0)