Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b075c64
feat(domain): add support for buying and registar domains
jremy42 Nov 8, 2024
15b67cf
feat(domain): add helpers for expand contact
jremy42 Nov 22, 2024
b739d54
feat(domain): add test for create and read
jremy42 Nov 25, 2024
f940b11
feat(domain): add chore of new resource order domain
jremy42 Dec 19, 2024
84afc25
feat(domain): add chore of new resource order domain
jremy42 Dec 19, 2024
cd171c5
feat: resource can order a list of domains
jremy42 Jan 30, 2025
d8e406b
chore: add test
jremy42 Feb 5, 2025
1a77743
add print for debug
jremy42 Feb 5, 2025
c1bccd2
remove comments
jremy42 Feb 6, 2025
b96bb11
change datastructure
jremy42 Feb 7, 2025
15f564f
add data source for domain
jremy42 Feb 7, 2025
2817577
add doc
jremy42 Feb 11, 2025
ea31122
add data_source for domains_registration
jremy42 Feb 11, 2025
16047a8
test: add cassettes
jremy42 Feb 12, 2025
6c52cd3
test: add multiple test
jremy42 Feb 13, 2025
df13a4c
bump sdk go
jremy42 Feb 14, 2025
fdad7e3
bump sdk go
jremy42 Feb 24, 2025
3e6601a
fix lint
jremy42 Feb 24, 2025
a29570f
fix lint
jremy42 Feb 24, 2025
a8104f7
fix error
jremy42 Feb 24, 2025
27737a5
fix skipped test
jremy42 Mar 12, 2025
8ce92f7
fix(domain): remove ds records option
jremy42 Mar 11, 2025
500e738
purge(cockpit): remove plan from cockpit (#2968)
jremy42 Mar 10, 2025
885f6a2
feat(mongodb): vpc support (#2967)
jremy42 Mar 10, 2025
3ac7a4c
feat(container): add support for local_storage_limit (#2969)
remyleone Mar 10, 2025
e798d2a
fix(container): add support for putting region in the state after imp…
remyleone Mar 10, 2025
12ea31e
fix(apple-silicon): add username and password (#2971)
Laure-di Mar 11, 2025
166b25b
feat(edge_services): add resources (#2637)
yfodil Mar 12, 2025
0605442
Merge branch 'master' into feat/add_support_for_registar_domain
jremy42 Mar 12, 2025
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
148 changes: 148 additions & 0 deletions docs/resources/domain_registration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
---
subcategory: "Domains and DNS"
page_title: "Scaleway: scaleway_domain_registration"
---

# Resource: scaleway_domain_registration

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.

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.

## Example Usage

### Purchase a Single Domain

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.

```terraform
resource "scaleway_domain_registration" "test" {
domain_names = ["example.com"]
duration_in_years = 1

owner_contact {
legal_form = "individual"
firstname = "John"
lastname = "DOE"
email = "[email protected]"
phone_number = "+1.23456789"
address_line_1 = "123 Main Street"
city = "Paris"
zip = "75001"
country = "FR"
vat_identification_code = "FR12345678901"
company_identification_code = "123456789"
}
}
```

### Update Domain Settings

You can update the resource to enable auto-renewal and DNSSEC:

```terraform
resource "scaleway_domain_registration" "test" {
domain_names = ["example.com"]
duration_in_years = 1

owner_contact {
legal_form = "individual"
firstname = "John"
lastname = "DOE"
email = "[email protected]"
phone_number = "+1.23456789"
address_line_1 = "123 Main Street"
city = "Paris"
zip = "75001"
country = "FR"
vat_identification_code = "FR12345678901"
company_identification_code = "123456789"
}

auto_renew = true
dnssec = true
}
```

### Purchase Multiple Domains

The following example registers several domains in one go:

```terraform
resource "scaleway_domain_registration" "multi" {
domain_names = ["domain1.com", "domain2.com", "domain3.com"]
duration_in_years = 1

owner_contact {
legal_form = "individual"
firstname = "John"
lastname = "DOE"
email = "[email protected]"
phone_number = "+1.23456789"
address_line_1 = "123 Main Street"
city = "Paris"
zip = "75001"
country = "FR"
vat_identification_code = "FR12345678901"
company_identification_code = "123456789"
}
}
```

## Argument Reference

The following arguments are supported:

- `domain_names` (Required, List of String): A list of domain names to be registered.
- `duration_in_years` (Optional, Integer, Default: 1): The registration period in years.
- `project_id` (Optional, String): The Scaleway project ID.
- `owner_contact_id` (Optional, String): The ID of an existing owner contact.
- `owner_contact` (Optional, List): Details of the owner contact.
- `administrative_contact` (Computed, List): Administrative contact information.
- `technical_contact` (Computed, List): Technical contact information.
- `auto_renew` (Optional, Boolean, Default: false): Enables or disables auto-renewal.
- `dnssec` (Optional, Boolean, Default: false): Enables or disables DNSSEC.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

- `id`: The ID of the domain registration.
- `updated_at`: Timestamp of the last update.
- `expired_at`: Expiration date/time of the domain registration.
- `epp_code`: EPP code(s) associated with the domain.
- `registrar`: Name of the registrar.
- `status`: Status of the domain registration.
- `dns_zones`: List of DNS zones associated with the domain.
- `ds_record`: DNSSEC DS record configuration.
- `task_id`: ID of the task that created the domain.



## Contact Blocks

Each contact block supports the following attributes:

- `legal_form` (Required, String): Legal form of the contact.
- `firstname` (Required, String): First name.
- `lastname` (Required, String): Last name.
- `company_name` (Optional, String): Company name.
- `email` (Required, String): Primary email.
- `phone_number` (Required, String): Primary phone number.
- `address_line_1` (Required, String): Primary address.
- `zip` (Required, String): Postal code.
- `city` (Required, String): City.
- `country` (Required, String): Country code (ISO format).
- `vat_identification_code` (Required, String): VAT identification code.
- `company_identification_code` (Required, String): Company identification code.

## Import

To import an existing domain registration, use:

```bash
terraform import scaleway_domain_registration.test <project_id>/<task_id>
```



1 change: 1 addition & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func Provider(config *Config) plugin.ProviderFunc {
"scaleway_container_token": container.ResourceToken(),
"scaleway_container_trigger": container.ResourceTrigger(),
"scaleway_domain_record": domain.ResourceRecord(),
"scaleway_domain_registration": domain.ResourceRegistration(),
"scaleway_domain_zone": domain.ResourceZone(),
"scaleway_edge_services_backend_stage": edgeservices.ResourceBackendStage(),
"scaleway_edge_services_cache_stage": edgeservices.ResourceCacheStage(),
Expand Down
Loading
Loading