Skip to content

Commit

Permalink
More Gandi records after zone creation
Browse files Browse the repository at this point in the history
Signed-off-by: Benoit Donneaux <[email protected]>
  • Loading branch information
btlogy committed Oct 30, 2024
1 parent e2c8bb2 commit 4d51524
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 3 deletions.
31 changes: 31 additions & 0 deletions terraform/core/dns_tl-org.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Manage the domain
resource "gandi_domain" "tl-org" {
name = "tahoe-lafs.org"
owner {
Expand All @@ -21,3 +22,33 @@ resource "gandi_domain" "tl-org" {
zip = "12345"
}
}

# Accessing domain data
data "gandi_domain" "tl-org" {
name = gandi_domain.tl-org.name
}

# Managing DNS zone
resource "gandi_livedns_domain" "tl-org" {
name = data.gandi_domain.tl-org.name
timeouts {
default = "3600s"
}
}

# Managing the NS records of the zone
resource "gandi_nameservers" "tl-org" {
domain = data.gandi_domain.tl-org.name
nameservers = data.gandi_domain.tl-org.nameservers
}

# Managing other records of the zone
resource "gandi_livedns_record" "tl-org_A" {
name = "@"
type = "A"
values = [
"1.2.3.4"
]
ttl = 3600
zone = data.gandi_domain.tl-org.name
}
115 changes: 112 additions & 3 deletions terraform/core/terraform.tfstate
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
{
"version": 4,
"terraform_version": "1.7.5",
"serial": 1,
"serial": 2,
"lineage": "44b8ddf2-df81-a93d-5caf-89dd4fab333a",
"outputs": {},
"resources": [
{
"mode": "data",
"type": "gandi_domain",
"name": "tl-org",
"provider": "provider[\"registry.terraform.io/go-gandi/gandi\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "tahoe-lafs.org",
"name": "tahoe-lafs.org",
"nameservers": [
"ns-29-a.gnadi.net",
"ns-70-b.gnadi.net",
"ns-153-c.gnadi.net"
]
},
"sensitive_attributes": []
}
]
},
{
"mode": "managed",
"type": "gandi_domain",
Expand Down Expand Up @@ -70,12 +91,17 @@
"country": "US",
"data_obfuscated": true,
"email": "[email protected]",
"extra_parameters": null,
"extra_parameters": {
"birth_city": "",
"birth_country": "",
"birth_date": "",
"birth_department": ""
},
"family_name": "LAFS",
"given_name": "Terlog",
"mail_obfuscated": true,
"organisation": "Tahoe-LAFS",
"phone": "+31234567890",
"phone": "+31.234567890",
"state": "",
"street_addr": "The place to be, 1",
"type": "association",
Expand Down Expand Up @@ -112,6 +138,89 @@
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMCwiZGVmYXVsdCI6NjAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwfX0="
}
]
},
{
"mode": "managed",
"type": "gandi_livedns_domain",
"name": "tl-org",
"provider": "provider[\"registry.terraform.io/go-gandi/gandi\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"automatic_snapshots": true,
"id": "tahoe-lafs.org",
"name": "tahoe-lafs.org",
"timeouts": {
"default": null
},
"ttl": null
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMCwiZGVmYXVsdCI6NjAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwfSwic2NoZW1hX3ZlcnNpb24iOiIwIn0=",
"dependencies": [
"data.gandi_domain.tl-org",
"gandi_domain.tl-org"
]
}
]
},
{
"mode": "managed",
"type": "gandi_livedns_record",
"name": "tl-org_A",
"provider": "provider[\"registry.terraform.io/go-gandi/gandi\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"href": "https://api.sandbox.gandi.net/v5/livedns/domains/tahoe-lafs.org/records/@/A/api/v5/domains/tahoe-lafs.org/records/@/A",
"id": "tahoe-lafs.org/@/A",
"mutable": null,
"name": "@",
"timeouts": null,
"ttl": 3600,
"type": "A",
"values": [
"1.2.3.4"
],
"zone": "tahoe-lafs.org"
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMCwiZGVmYXVsdCI6NjAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwfX0=",
"dependencies": [
"data.gandi_domain.tl-org",
"gandi_domain.tl-org"
]
}
]
},
{
"mode": "managed",
"type": "gandi_nameservers",
"name": "tl-org",
"provider": "provider[\"registry.terraform.io/go-gandi/gandi\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"domain": "tahoe-lafs.org",
"id": "tahoe-lafs.org",
"nameservers": [
"ns-29-a.gnadi.net",
"ns-70-b.gnadi.net",
"ns-153-c.gnadi.net"
],
"timeouts": null
},
"sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMCwiZGVmYXVsdCI6NjAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwfX0=",
"dependencies": [
"data.gandi_domain.tl-org",
"gandi_domain.tl-org"
]
}
]
}
],
"check_results": null
Expand Down

0 comments on commit 4d51524

Please sign in to comment.