Skip to content

Commit 4d51524

Browse files
committed
More Gandi records after zone creation
Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
1 parent e2c8bb2 commit 4d51524

File tree

2 files changed

+143
-3
lines changed

2 files changed

+143
-3
lines changed

terraform/core/dns_tl-org.tf

+31
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Manage the domain
12
resource "gandi_domain" "tl-org" {
23
name = "tahoe-lafs.org"
34
owner {
@@ -21,3 +22,33 @@ resource "gandi_domain" "tl-org" {
2122
zip = "12345"
2223
}
2324
}
25+
26+
# Accessing domain data
27+
data "gandi_domain" "tl-org" {
28+
name = gandi_domain.tl-org.name
29+
}
30+
31+
# Managing DNS zone
32+
resource "gandi_livedns_domain" "tl-org" {
33+
name = data.gandi_domain.tl-org.name
34+
timeouts {
35+
default = "3600s"
36+
}
37+
}
38+
39+
# Managing the NS records of the zone
40+
resource "gandi_nameservers" "tl-org" {
41+
domain = data.gandi_domain.tl-org.name
42+
nameservers = data.gandi_domain.tl-org.nameservers
43+
}
44+
45+
# Managing other records of the zone
46+
resource "gandi_livedns_record" "tl-org_A" {
47+
name = "@"
48+
type = "A"
49+
values = [
50+
"1.2.3.4"
51+
]
52+
ttl = 3600
53+
zone = data.gandi_domain.tl-org.name
54+
}

terraform/core/terraform.tfstate

+112-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
{
22
"version": 4,
33
"terraform_version": "1.7.5",
4-
"serial": 1,
4+
"serial": 2,
55
"lineage": "44b8ddf2-df81-a93d-5caf-89dd4fab333a",
66
"outputs": {},
77
"resources": [
8+
{
9+
"mode": "data",
10+
"type": "gandi_domain",
11+
"name": "tl-org",
12+
"provider": "provider[\"registry.terraform.io/go-gandi/gandi\"]",
13+
"instances": [
14+
{
15+
"schema_version": 0,
16+
"attributes": {
17+
"id": "tahoe-lafs.org",
18+
"name": "tahoe-lafs.org",
19+
"nameservers": [
20+
"ns-29-a.gnadi.net",
21+
"ns-70-b.gnadi.net",
22+
"ns-153-c.gnadi.net"
23+
]
24+
},
25+
"sensitive_attributes": []
26+
}
27+
]
28+
},
829
{
930
"mode": "managed",
1031
"type": "gandi_domain",
@@ -70,12 +91,17 @@
7091
"country": "US",
7192
"data_obfuscated": true,
7293
"email": "contact@example.com",
73-
"extra_parameters": null,
94+
"extra_parameters": {
95+
"birth_city": "",
96+
"birth_country": "",
97+
"birth_date": "",
98+
"birth_department": ""
99+
},
74100
"family_name": "LAFS",
75101
"given_name": "Terlog",
76102
"mail_obfuscated": true,
77103
"organisation": "Tahoe-LAFS",
78-
"phone": "+31234567890",
104+
"phone": "+31.234567890",
79105
"state": "",
80106
"street_addr": "The place to be, 1",
81107
"type": "association",
@@ -112,6 +138,89 @@
112138
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMCwiZGVmYXVsdCI6NjAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwfX0="
113139
}
114140
]
141+
},
142+
{
143+
"mode": "managed",
144+
"type": "gandi_livedns_domain",
145+
"name": "tl-org",
146+
"provider": "provider[\"registry.terraform.io/go-gandi/gandi\"]",
147+
"instances": [
148+
{
149+
"schema_version": 0,
150+
"attributes": {
151+
"automatic_snapshots": true,
152+
"id": "tahoe-lafs.org",
153+
"name": "tahoe-lafs.org",
154+
"timeouts": {
155+
"default": null
156+
},
157+
"ttl": null
158+
},
159+
"sensitive_attributes": [],
160+
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMCwiZGVmYXVsdCI6NjAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIwIn0=",
161+
"dependencies": [
162+
"data.gandi_domain.tl-org",
163+
"gandi_domain.tl-org"
164+
]
165+
}
166+
]
167+
},
168+
{
169+
"mode": "managed",
170+
"type": "gandi_livedns_record",
171+
"name": "tl-org_A",
172+
"provider": "provider[\"registry.terraform.io/go-gandi/gandi\"]",
173+
"instances": [
174+
{
175+
"schema_version": 0,
176+
"attributes": {
177+
"href": "https://api.sandbox.gandi.net/v5/livedns/domains/tahoe-lafs.org/records/@/A/api/v5/domains/tahoe-lafs.org/records/@/A",
178+
"id": "tahoe-lafs.org/@/A",
179+
"mutable": null,
180+
"name": "@",
181+
"timeouts": null,
182+
"ttl": 3600,
183+
"type": "A",
184+
"values": [
185+
"1.2.3.4"
186+
],
187+
"zone": "tahoe-lafs.org"
188+
},
189+
"sensitive_attributes": [],
190+
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMCwiZGVmYXVsdCI6NjAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwfX0=",
191+
"dependencies": [
192+
"data.gandi_domain.tl-org",
193+
"gandi_domain.tl-org"
194+
]
195+
}
196+
]
197+
},
198+
{
199+
"mode": "managed",
200+
"type": "gandi_nameservers",
201+
"name": "tl-org",
202+
"provider": "provider[\"registry.terraform.io/go-gandi/gandi\"]",
203+
"instances": [
204+
{
205+
"schema_version": 0,
206+
"attributes": {
207+
"domain": "tahoe-lafs.org",
208+
"id": "tahoe-lafs.org",
209+
"nameservers": [
210+
"ns-29-a.gnadi.net",
211+
"ns-70-b.gnadi.net",
212+
"ns-153-c.gnadi.net"
213+
],
214+
"timeouts": null
215+
},
216+
"sensitive_attributes": [],
217+
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMCwiZGVmYXVsdCI6NjAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwfX0=",
218+
"dependencies": [
219+
"data.gandi_domain.tl-org",
220+
"gandi_domain.tl-org"
221+
]
222+
}
223+
]
115224
}
116225
],
117226
"check_results": null

0 commit comments

Comments
 (0)