Skip to content

Commit f38e895

Browse files
committed
add doc
1 parent 39db6d9 commit f38e895

File tree

4 files changed

+367
-219
lines changed

4 files changed

+367
-219
lines changed
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
---
2+
subcategory: "Domains and DNS"
3+
page_title: "Scaleway: scaleway_domain_domains_registration"
4+
---
5+
6+
# Resource: scaleway_domain_domains_registration
7+
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.
9+
10+
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.
11+
12+
## Example Usage
13+
14+
### Purchase a Single Domain
15+
16+
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.
17+
18+
```terraform
19+
resource "scaleway_domain_domains_registration" "test" {
20+
domain_names = ["example.com"]
21+
duration_in_years = 1
22+
23+
owner_contact {
24+
legal_form = "individual"
25+
firstname = "John"
26+
lastname = "DOE"
27+
28+
phone_number = "+1.23456789"
29+
address_line_1 = "123 Main Street"
30+
city = "Paris"
31+
zip = "75001"
32+
country = "FR"
33+
vat_identification_code = "FR12345678901"
34+
company_identification_code = "123456789"
35+
}
36+
}
37+
```
38+
39+
### Update Domain Settings
40+
41+
You can update the resource to enable auto-renewal and DNSSEC:
42+
43+
```terraform
44+
resource "scaleway_domain_domains_registration" "test" {
45+
domain_names = ["example.com"]
46+
duration_in_years = 1
47+
48+
owner_contact {
49+
legal_form = "individual"
50+
firstname = "John"
51+
lastname = "DOE"
52+
53+
phone_number = "+1.23456789"
54+
address_line_1 = "123 Main Street"
55+
city = "Paris"
56+
zip = "75001"
57+
country = "FR"
58+
vat_identification_code = "FR12345678901"
59+
company_identification_code = "123456789"
60+
}
61+
62+
auto_renew = true
63+
dnssec = true
64+
}
65+
```
66+
67+
### Purchase Multiple Domains
68+
69+
The following example registers several domains in one go:
70+
71+
```terraform
72+
resource "scaleway_domain_domains_registration" "multi" {
73+
domain_names = ["domain1.com", "domain2.com", "domain3.com"]
74+
duration_in_years = 1
75+
76+
owner_contact {
77+
legal_form = "individual"
78+
firstname = "John"
79+
lastname = "DOE"
80+
81+
phone_number = "+1.23456789"
82+
address_line_1 = "123 Main Street"
83+
city = "Paris"
84+
zip = "75001"
85+
country = "FR"
86+
vat_identification_code = "FR12345678901"
87+
company_identification_code = "123456789"
88+
}
89+
}
90+
```
91+
92+
## Argument Reference
93+
94+
The following arguments are supported:
95+
96+
- `domain_names` (Required, List of String): A list of domain names to be registered.
97+
- `duration_in_years` (Optional, Integer, Default: 1): The registration period in years.
98+
- `project_id` (Optional, String): The Scaleway project ID.
99+
- `owner_contact_id` (Optional, String): The ID of an existing owner contact.
100+
- `owner_contact` (Optional, List): Details of the owner contact.
101+
- `administrative_contact` (Computed, List): Administrative contact information.
102+
- `technical_contact` (Computed, List): Technical contact information.
103+
- `auto_renew` (Optional, Boolean, Default: false): Enables or disables auto-renewal.
104+
- `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.
107+
108+
## Attributes Reference
109+
110+
- `id`: The ID of the domain registration.
111+
- `updated_at`: Timestamp of the last update.
112+
- `expired_at`: Expiration date/time of the domain registration.
113+
- `epp_code`: EPP code(s) associated with the domain.
114+
- `registrar`: Name of the registrar.
115+
- `status`: Status of the domain registration.
116+
- `dns_zones`: List of DNS zones associated with the domain.
117+
118+
## Contact Blocks
119+
120+
Each contact block supports the following attributes:
121+
122+
- `legal_form` (Required, String): Legal form of the contact.
123+
- `firstname` (Required, String): First name.
124+
- `lastname` (Required, String): Last name.
125+
- `company_name` (Optional, String): Company name.
126+
- `email` (Required, String): Primary email.
127+
- `phone_number` (Required, String): Primary phone number.
128+
- `address_line_1` (Required, String): Primary address.
129+
- `zip` (Required, String): Postal code.
130+
- `city` (Required, String): City.
131+
- `country` (Required, String): Country code (ISO format).
132+
- `vat_identification_code` (Required, String): VAT identification code.
133+
- `company_identification_code` (Required, String): Company identification code.
134+
135+
## Import
136+
137+
To import an existing domain registration, use:
138+
139+
```bash
140+
terraform import scaleway_domain_domains_registration.test <project_id>/<task_id>
141+
```
142+
143+
144+

0 commit comments

Comments
 (0)