Comments (7)
No, to create/register the actual domain you still use the inwx_domain
resource and define contacts with inwx_domain_contact
. However to define dns records for your domain, your first need to create a zone for your domain on a nameserver that will contain those records. Therefore you now have the new inwx_nameserver
resource.
Zones are a separate layer between their domain and its dns records, so you could separate your records on different nameservers (e.g. if you have multiple teams that work on different projects with their own subdomains on the same domain)
An example would look like this:
resource "inwx_domain_contact" "example_person" {
type = "PERSON"
name = "Example Person"
street_address = "Example Street 0"
city = "Example City"
postal_code = 00000
state_province = "Example State"
country_code = "EX"
phone_number = "+00.00000000000"
email = "[email protected]"
}
resource "inwx_domain" "example_com" {
name = "example.com"
nameservers = [
"ns.inwx.de",
"ns2.inwx.de"
]
period = "1Y"
renewal_mode = "AUTOEXPIRE"
transfer_lock = true
contacts {
// references to terraform managed contact "example_person"
registrant = inwx_domain_contact.example_person.id
admin = inwx_domain_contact.example_person.id
tech = inwx_domain_contact.example_person.id
billing = inwx_domain_contact.example_person.id
}
extra_data = {
// Enable e.g. whois protection
"WHOIS-PROTECTION": "1" // 1 == bool true
}
}
resource "inwx_nameserver" "example_com_ns" {
domain = inwx_domain.example_com.name
type = "MASTER"
nameservers = [
"ns.inwx.de",
"ns2.inwx.de"
]
}
resource "inwx_nameserver_record" "example_com_TXT" {
domain =inwx_nameserver.example_com_ns.domain
type = "TXT"
content = "DNS records with terraform"
}
# Using this, all search queries for the subdomain `myproject.example.com`
# (including sub-subdomains: `*.myproject.example.com`) would go to the nameserver of `provider B`
# where another zone for the domain `example.com` exists, that contains all the records for `myproject`
resource "inwx_nameserver_record" "myproject_example_com_NS" {
domain = inwx_nameserver.example_com_ns.domain
name = "myproject.${inwx_nameserver.example_com_ns.domain}"
type = "NS"
content = "ns.providerB.com"
}
from terraform-provider-inwx.
You can create zones with this new ressource without having to go to the web ui and you can also reference that ressource in the domain
field for inwx_nameserver_record
.
from terraform-provider-inwx.
I have been able to import the existing domain into a inwx_domain record but didn't try creating the domain that way.
from terraform-provider-inwx.
Yes, you could go to the web UI to create a domain entry on the nameserver for your external domain and then import it into your terraform state, but that's not really a good way to do that in my opinion.
from terraform-provider-inwx.
Absolutely. I am currently working on building my own platform and as part of that it would be cool to first fetch with the ordinary API if a domain is available and if so add it to the terraform repo and let terraform claim it.
If the normal Domainrobot API can do it, why is the terraform provider not able to do it?
Here the link to the API documentation for the function domain.create: https://www.inwx.de/de/help/apidoc/f/ch02s09.html#domain.create
from terraform-provider-inwx.
Maybe a stupid question but how does the addition of an additional resource type solve this problem?
from terraform-provider-inwx.
I still don't quite understand: the inwx_domain
type contains additional data like contact information, etc. Will inwx_nameserver
now create an actual domain? Because it does not actually represent a nameserver. So far inwx_nameserver_record
expects a string for domain. Do I understand you correctly that the id of one of the new inwx_nameserver
entries would belong in that field?
from terraform-provider-inwx.
Related Issues (11)
- Deletion fails HOT 2
- Plugin crash when trying to refresh a refresh a inwx_nameserver_record that does not exist HOT 2
- Feature request: Enable automated DNSSEC management for a domain HOT 3
- Feature request: support setting DNS entries HOT 7
- Bug: Nameserver records are sometimes deleted in terraform state but still exist on INWX HOT 15
- Terraform Always Plans Changes for Unmodified INWX Record" HOT 2
- Feature request: Read configuration from environment HOT 2
- ACCOUNT_LOCKED when 2FA is enabled HOT 1
- Wrong type for `id` when modifying or destroying a `nameserver_record` resource HOT 1
- docs: add documentation for resource_dnssec_key HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-inwx.