Skip to content

Commit 0e8a7f1

Browse files
committed
chore: add terraform configuration for NS-type DNS records.
Part of #1000 [skip ci]
1 parent 92b74da commit 0e8a7f1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

infra/terraform/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
$ terraform import digitalocean_domain.site my-stamps.ru
1717
$ terraform import digitalocean_record.www my-stamps.ru,<id>
1818
$ terraform import digitalocean_record.no-www my-stamps.ru,<id>
19+
$ terraform import digitalocean_record.ns1 my-stamps.ru,<id>
20+
$ terraform import digitalocean_record.ns2 my-stamps.ru,<id>
21+
$ terraform import digitalocean_record.ns3 my-stamps.ru,<id>
1922
```
2023
The ids can be obtained by API:
2124
- https://developers.digitalocean.com/documentation/v2/#list-all-droplets

infra/terraform/my-stamps.tf

+18
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,21 @@ resource "digitalocean_record" "www" {
3636
name = "www"
3737
value = digitalocean_droplet.web.ipv4_address
3838
}
39+
resource "digitalocean_record" "ns1" {
40+
domain = digitalocean_domain.site.name
41+
type = "NS"
42+
name = "@" # <-- to match the current settings. It's better to use "ns1" instead
43+
value = "ns1.digitalocean.com."
44+
}
45+
resource "digitalocean_record" "ns2" {
46+
domain = digitalocean_domain.site.name
47+
type = "NS"
48+
name = "@" # <-- to match the current settings. It's better to use "ns2" instead
49+
value = "ns2.digitalocean.com."
50+
}
51+
resource "digitalocean_record" "ns3" {
52+
domain = digitalocean_domain.site.name
53+
type = "NS"
54+
name = "@" # <-- to match the current settings. It's better to use "ns3" instead
55+
value = "ns3.digitalocean.com."
56+
}

0 commit comments

Comments
 (0)