### Example Usage of inwx_nameserver_record Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_nameserver_record.md This snippet demonstrates how to create a TXT nameserver record for a domain using the `inwx_nameserver_record` resource. ```terraform resource "inwx_nameserver_record" "example_com_txt_1" { domain = "example.com" type = "TXT" content = "DNS records with terraform" } ``` -------------------------------- ### INWX Domain Resource Example Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_domain.md Example usage of the inwx_domain resource to create a new domain registration with specified nameservers, period, renewal mode, transfer lock, contacts, and extra data. ```APIDOC ## Resource: inwx_domain Provides a INWX domain resource. ### Argument Reference * `name` - (Required) Name of the domain * `nameservers` - (Required) Set of nameservers of the domain. Min Items: 1 * `period` - (Required) Registration period of the domain. Valid types: https://account.inwx.de/en/help/apidoc/f/ch03.html#type.period * `renewal_mode` - (Optional) Renewal mode of the domain. One of: `AUTORENEW`, `AUTODELETE`, `AUTOEXPIRE`. Default: `AUTORENEW` * `transfer_lock` - (Optional) Whether the domain transfer lock should be enabled. Default: `true` * `contacts` - (Required) Contacts of the domain * `extra_data` - (Optional) Extra data, needed for some jurisdictions. Valid extra data types: https://account.inwx.de/en/help/apidoc/f/ch03.html#type.extdata ### Nested Fields Depending on the TLD, the following can be optional and will thus not be shown in the api after creation. Registrant will always be required. `contacts` * `registrant` - (Required) Id of the registrant contact * `admin` - (Optional) Id of the admin contact * `tech` - (Optional) Id of the tech contact * `billing` - (Optional) Id of the billing contact ### Attribute Reference * `id` - Name of the domain ### Import INWX Domains can be imported using the domain name, e.g., ``` $ terraform import inwx_domain.example_com "example.com" ``` ### Caveats #### Extra Data When extra data is set, e.g. `WHOIS-PROTECTION`, our system sometimes adds other readonly extra data to the domain. In this example `WHOIS-CURRENCY` is added to the domain. Terraform cannot manage this extra data, so it is recommended to ignore these side effects explicitly as they occur: ```terraform resource "inwx_domain" "example_com" { // ... extra_data = { "WHOIS-PROTECTION": "1" } lifecycle { ignore_changes = [ extra_data["WHOIS-CURRENCY"], ] } } ``` ``` -------------------------------- ### Configure INWX Provider and Manage Resources Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/index.md This example demonstrates the basic configuration of the INWX Terraform provider, including API endpoint, credentials, and TAN. It then shows how to manage a domain contact, register a domain with specific nameservers and renewal settings, configure an Anycast DNS zone, add a nameserver record, enable automated DNSSEC for INWX nameservers, configure DNSSEC for external nameservers, and create a glue record. ```terraform terraform { required_providers { inwx = { source = "inwx/inwx" version = ">= 1.0.0" } } } // API configuration provider "inwx" { api_url = "https://api.ote.domrobot.com/jsonrpc/" username = "example-user" password = "redacted" tan = "000000" } // contact used for domains 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 = "person@example.invalid" } // manage domains resource "inwx_domain" "example_com" { name = "example.com" nameservers = [ // if you want to use inwx ns, create a zone with inwx_nameserver "ns.inwx.de", "ns2.inwx.de" ] period = "1Y" renewal_mode = "AUTORENEW" 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 whois proxy, trustee or provide data like company number if needed //"WHOIS-PROTECTION": "1", //"ACCEPT-TRUSTEE-TAC": "1", //"COMPANY-NUMBER": "123", } } // zone in anycast dns resource "inwx_nameserver" "example_com_nameserver" { domain = "example.com" type = "MASTER" nameservers = [ "ns.inwx.de", "ns2.inwx.de" ] } // nameserver record for a zone from above resource "inwx_nameserver_record" "example_com_txt_1" { domain = "example.com" type = "TXT" content = "DNS records with terraform" } // dnssec when inwx nameservers are used resource "inwx_automated_dnssec" "example_com" { domain = "example.com" } // dnssec for external nameservers resource "inwx_dnssec_key" "example_com" { domain = "example.com" public_key = "ac12c2..." algorithm = "SHA256" } // glue record resource "inwx_glue_record" "example_com_glue_1" { hostname = "example.com" ip = [ "192.168.0.1" ] } ``` -------------------------------- ### Example Usage of inwx_domain_contact Data Source Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/data-sources/inwx_domain_contact.md Demonstrates how to fetch a domain contact by its ID and type, and then output the retrieved contact details. Ensure all required fields are provided for successful data retrieval. ```terraform data "inwx_domain_contact" "example_person" { id = 1 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 = "person@example.invalid" } output "inwx_domain_contact" { value = data.inwx_domain_contact.example_person } ``` -------------------------------- ### Importing an INWX Nameserver Record Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_nameserver_record.md This example shows the command to import an existing INWX nameserver record into Terraform state. Ensure the domain and record ID are correctly specified. ```bash $ terraform import inwx_nameserver_record example.com:2147483647 ``` -------------------------------- ### Example Usage of inwx_dnssec_key Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_dnssec_key.md Configure a DNSSEC key for a domain. Ensure the domain is managed by INWX and you are not using INWX nameservers for automated management. ```terraform resource "inwx_dnssec_key" "example_com" { domain = "example.com" public_key = "ac12c2..." algorithm = "SHA256" } ``` -------------------------------- ### Basic Automated DNSSEC Configuration Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_automated_dnssec.md Example of how to configure automated DNSSEC management for a domain. Ensure you are using INWX nameservers for this resource. ```terraform resource "inwx_automated_dnssec" "example_com" { domain = "example.com" } ``` -------------------------------- ### Basic INWX Domain Resource Creation Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_domain.md Example of creating a basic domain resource with INWX nameservers and manually specified contact IDs. Ensure INWX nameservers are configured separately if used. ```terraform resource "inwx_domain" "example_com" { name = "example.com" nameservers = [ // if you want to use inwx ns, create a zone with inwx_nameserver "ns.inwx.de", "ns2.inwx.de" ] period = "1Y" renewal_mode = "AUTORENEW" transfer_lock = true contacts { registrant = 2147483647 // id of contact admin = 2147483647 // id of contact tech = 2147483647 // id of contact billing = 2147483647 // id of contact } extra_data = { // Enable whois proxy, trustee or provide data like company number if needed //"WHOIS-PROTECTION": "1", //"ACCEPT-TRUSTEE-TAC": "1", //"COMPANY-NUMBER": "123", } } ``` -------------------------------- ### Create INWX Glue Record Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_glue_record.md Example of how to define an INWX glue record resource using Terraform. Requires hostname and IP address. ```terraform resource "inwx_glue_record" "example_com_glue_1" { hostname = "example.com" ip = [ "192.168.0.1" ] } ``` -------------------------------- ### Create an INWX Domain Contact Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_domain_contact.md Example of how to create a PERSON type domain contact using the INWX Terraform resource. Ensure all required arguments are provided. ```terraform 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 = "person@example.invalid" } ``` -------------------------------- ### INWX Domain Resource with Terraform Managed Contacts Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_domain.md Example demonstrating how to create an INWX domain resource while referencing Terraform-managed contact resources. This approach centralizes contact management within your Terraform configuration. ```terraform 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 = "person@example.invalid" } resource "inwx_domain" "example_com" { name = "example.com" nameservers = [ // if you want to use inwx ns, create a zone with inwx_nameserver "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 whois proxy, trustee or provide data like company number if needed //"WHOIS-PROTECTION": "1", //"ACCEPT-TRUSTEE-TAC": "1", //"COMPANY-NUMBER": "123", } } ``` -------------------------------- ### Enable Automated DNSSEC Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Enables automated DNSSEC management for a domain when using INWX nameservers. This simplifies DNSSEC setup and maintenance. ```hcl # 5. Enable automated DNSSEC (requires INWX nameservers) resource "inwx_automated_dnssec" "example_com" { domain = inwx_nameserver.example_com.domain } ``` -------------------------------- ### Handling Extra Data Side Effects Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_domain.md Example of using `lifecycle.ignore_changes` to manage extra data attributes that are automatically added by the INWX system and cannot be controlled by Terraform. This prevents unnecessary diffs. ```terraform resource "inwx_domain" "example_com" { // ... extra_data = { "WHOIS-PROTECTION": "1" } lifecycle { ignore_changes = [ extra_data["WHOIS-CURRENCY"], ] } } ``` -------------------------------- ### Create a SLAVE Nameserver Zone Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Configures a SLAVE DNS zone for 'example.com' that replicates from a specified master IP. The 'nameservers' attribute should list the authoritative nameservers for this slave zone. ```hcl resource "inwx_nameserver" "example_com_slave" { domain = "example.com" type = "SLAVE" master_ip = "192.0.2.1" nameservers = [ "ns4.example.com", ] } ``` -------------------------------- ### Create a MASTER Nameserver Zone Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Defines a MASTER DNS zone for 'example.com' on the INWX nameserver network. Ensure the 'nameservers' list includes valid INWX nameservers. ```hcl resource "inwx_nameserver" "example_com" { domain = "example.com" type = "MASTER" nameservers = [ "ns.inwx.de", "ns2.inwx.de", "ns3.inwx.eu", ] soa_mail = "hostmaster@example.com" } ``` -------------------------------- ### Create an MX Record with Priority Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Sets up an 'MX' record for 'example.com' with a priority of 10, directing mail to 'mail.example.com'. The TTL is 3600 seconds. ```hcl # MX record with priority resource "inwx_nameserver_record" "mx_primary" { domain = "example.com" type = "MX" content = "mail.example.com" prio = 10 ttl = 3600 } ``` -------------------------------- ### Create a URL Redirect Record Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Sets up a URL redirect for the 'shop' subdomain of 'example.com' using the 'URL' pseudo-type, with an HTTP 301 status code. The redirect points to 'https://shop.example.com'. TTL is 3600 seconds. ```hcl # URL redirect (HTTP 301) using the URL pseudo-type resource "inwx_nameserver_record" "redirect_shop" { domain = "example.com" type = "URL" name = "shop" content = "https://shop.example.com" url_redirect_type = "HEADER301" ttl = 3600 } ``` -------------------------------- ### Create an A Record Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Defines an 'A' record for 'example.com' pointing to an IPv4 address. The TTL is set to 3600 seconds. ```hcl # A record resource "inwx_nameserver_record" "a_root" { domain = "example.com" type = "A" content = "203.0.113.10" ttl = 3600 } ``` -------------------------------- ### Create a CNAME Record for www Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Establishes a 'CNAME' record for the 'www' subdomain of 'example.com', aliasing it to 'example.com'. The TTL is 3600 seconds. ```hcl # CNAME for www resource "inwx_nameserver_record" "cname_www" { domain = "example.com" type = "CNAME" name = "www" content = "example.com" ttl = 3600 } ``` -------------------------------- ### Create a CAA Record Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Configures a 'CAA' record for 'example.com' to specify which Certificate Authorities are allowed to issue certificates for the domain. The TTL is 3600 seconds. ```hcl # CAA record resource "inwx_nameserver_record" "caa" { domain = "example.com" type = "CAA" content = "0 issue \"letsencrypt.org\"" ttl = 3600 } ``` -------------------------------- ### Configure INWX Provider with Arguments Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Declare the INWX provider and authenticate against the JSON-RPC API using arguments. The `api_url` defaults to the production endpoint; use the OTE URL for testing. The `tan` argument is only required when the account has mobile TAN (2FA) enabled and returns response code `2200`. ```hcl terraform { required_providers { inwx = { source = "inwx/inwx" version = ">= 1.0.0" } } } # Credentials via arguments (prefer environment variables in CI) provider "inwx" { api_url = "https://api.ote.domrobot.com/jsonrpc/" # OTE test environment username = "testuser" password = "s3cr3t" tan = "123456" # only when account.info returns code 2200 } ``` -------------------------------- ### Create an AAAA Record for a Subdomain Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Configures an 'AAAA' record for the 'www' subdomain of 'example.com', pointing to an IPv6 address. The TTL is set to 3600 seconds. ```hcl # AAAA record for a subdomain resource "inwx_nameserver_record" "aaaa_www" { domain = "example.com" type = "AAAA" name = "www" content = "2001:db8::1" ttl = 3600 } ``` -------------------------------- ### Set up INWX Nameserver Zone Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Creates a master nameserver zone for a domain within INWX. This is a prerequisite for managing DNS records through the provider. ```hcl # 3. Create the DNS zone resource "inwx_nameserver" "example_com" { domain = inwx_domain.example_com.name type = "MASTER" nameservers = ["ns.inwx.de", "ns2.inwx.de"] } ``` -------------------------------- ### Configure INWX Provider and Domain Contact Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Sets up the INWX provider, typically using environment variables for credentials. Also defines a domain contact resource with personal and address details. ```hcl terraform { required_providers { inwx = { source = "inwx/inwx" version = ">= 1.0.0" } } } provider "inwx" { # Uses INWX_USERNAME, INWX_PASSWORD, INWX_API_URL env vars } # 1. Create domain contact resource "inwx_domain_contact" "owner" { type = "PERSON" name = "Jane Doe" street_address = "Main Street 1" city = "Berlin" postal_code = "10115" country_code = "DE" phone_number = "+49.3000000000" email = "jane@example.com" } ``` -------------------------------- ### Configure INWX Provider with Environment Variables Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Configure the INWX provider using environment variables for sensitive credentials. This is the preferred method in CI/CD environments to avoid hardcoding secrets. ```hcl # Equivalent using environment variables (no sensitive values in .tf files) # export INWX_API_URL=https://api.domrobot.com/jsonrpc/ # export INWX_USERNAME=myuser # export INWX_PASSWORD=mypassword # export INWX_TAN=000000 provider "inwx" {} ``` -------------------------------- ### Create a TXT Record (SPF) Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Defines a 'TXT' record for 'example.com', commonly used for SPF records. The TTL is 3600 seconds. ```hcl # TXT record (SPF) resource "inwx_nameserver_record" "spf" { domain = "example.com" type = "TXT" content = "v=spf1 include:_spf.example.com ~all" ttl = 3600 } ``` -------------------------------- ### Output Contact Name and Email Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Outputs the name and email address of an existing domain contact retrieved via the `inwx_domain_contact` data source. ```hcl output "contact_name" { value = data.inwx_domain_contact.existing.name } output "contact_email" { value = data.inwx_domain_contact.existing.email } ``` -------------------------------- ### Create INWX Nameserver Zone (MASTER) Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_nameserver.md Use this configuration to create a primary (MASTER) nameserver zone for a domain. Ensure the `nameservers` list is populated with valid INWX nameserver hostnames. ```terraform resource "inwx_nameserver" "example_com_nameserver" { domain = "example.com" type = "MASTER" nameservers = [ "ns.inwx.de", "ns2.inwx.de" ] } ``` -------------------------------- ### Import an INWX Domain Contact Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_domain_contact.md Demonstrates how to import an existing INWX domain contact into Terraform management. Use the contact's ID for the import command. ```bash $ terraform import inwx_domain_contact 2147483647 ``` -------------------------------- ### Import INWX Glue Record Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_glue_record.md Command to import an existing INWX glue record into Terraform state. The ID format is 'hostname:id'. ```bash $ terraform import inwx_glue_record example.com:2147483647 ``` -------------------------------- ### Import Existing Glue Record Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Shows the command format for importing an existing glue record into Terraform state. Requires the hostname and the record's internal ID (`roId`). ```hcl # Import an existing glue record: # terraform import inwx_glue_record.ns1_example_com ns1.example.com: ``` -------------------------------- ### Import INWX Nameserver Zone Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_nameserver.md Import an existing INWX nameserver zone into Terraform management. The ID format requires the domain name followed by a colon and the zone ID. ```bash $ terraform import inwx_nameserver example.com:2147483647 ``` -------------------------------- ### Create INWX Nameserver Zone (SLAVE) Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_nameserver.md Configure a secondary (SLAVE) nameserver zone by specifying the `master_ip` address. This is used when INWX acts as a secondary DNS provider for a domain. ```terraform resource "inwx_nameserver" "example_com_nameserver" { domain = "example.com" type = "SLAVE" master_ip = "1.2.3.4" } ``` -------------------------------- ### Importing an INWX Domain Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_domain.md Command to import an existing INWX domain into Terraform management. Ensure the domain name matches the resource configuration. ```bash $ terraform import inwx_domain.example_com "example.com" ``` -------------------------------- ### inwx_nameserver Resource Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Manages DNS zones on the INWX Anycast nameserver network. Supports MASTER and SLAVE zone types, and URL redirect settings. ```APIDOC ## Resource: `inwx_nameserver` Creates and manages a DNS zone on the INWX Anycast nameserver network (50+ global locations). Supports `MASTER` and `SLAVE` zone types. The `domain` attribute forces recreation if changed. URL redirect settings (`url_redirect_type`, `url_redirect_title`, etc.) are available for frame/HTTP redirect zones. Import format: `:`. ### Example (MASTER Zone) ```hcl resource "inwx_nameserver" "example_com" { domain = "example.com" type = "MASTER" nameservers = [ "ns.inwx.de", "ns2.inwx.de", "ns3.inwx.eu", ] soa_mail = "hostmaster@example.com" } ``` ### Example (SLAVE Zone) ```hcl resource "inwx_nameserver" "example_com_slave" { domain = "example.com" type = "SLAVE" master_ip = "192.0.2.1" nameservers = [ "ns4.example.com", ] } ``` ### Import ```hcl # Import an existing nameserver zone: terraform import inwx_nameserver.example_com example.com: ``` ``` -------------------------------- ### Provider Configuration Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Configures the INWX provider, including authentication details and API endpoint. Supports environment variables for sensitive information. ```APIDOC ## Provider Configuration Declares the INWX provider and authenticates against the JSON-RPC API. `api_url` defaults to the production endpoint; use the OTE URL for testing. The `tan` argument is only required when the account has mobile TAN (2FA) enabled and returns response code `2200`. ```hcl terraform { required_providers { inwx = { source = "inwx/inwx" version = ">= 1.0.0" } } } # Credentials via arguments (prefer environment variables in CI) provider "inwx" { api_url = "https://api.ote.domrobot.com/jsonrpc/" # OTE test environment username = "testuser" password = "s3cr3t" tan = "123456" # only when account.info returns code 2200 } # Equivalent using environment variables (no sensitive values in .tf files) # export INWX_API_URL=https://api.domrobot.com/jsonrpc/ # export INWX_USERNAME=myuser # export INWX_PASSWORD=mypassword # export INWX_TAN=000000 provider "inwx" {} ``` ``` -------------------------------- ### Enable Automated DNSSEC Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Enables fully automated DNSSEC signing for a domain managed by INWX nameservers. This resource handles key generation and DS record submission. It requires a pre-existing 'inwx_nameserver' resource. ```hcl resource "inwx_nameserver" "example_com" { domain = "example.com" type = "MASTER" nameservers = ["ns.inwx.de", "ns2.inwx.de"] } resource "inwx_automated_dnssec" "example_com" { domain = inwx_nameserver.example_com.domain # Enabling this resource calls dnssec.enablednssec; # destroying it calls dnssec.disablednssec } ``` -------------------------------- ### Import Domain into Terraform State Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Use this command to import an existing domain into your Terraform state. ```bash terraform import inwx_domain.example_com example.com ``` -------------------------------- ### Importing an INWX DNSSEC Key Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_dnssec_key.md Import an existing DNSSEC key into Terraform management using the domain name and its digest. ```bash $ terraform import inwx_dnssec_key.example_com example.com/4E1243BD22C66E76C2BA9EDDC1F91394E57F9F83 ``` -------------------------------- ### Create Glue Records for a Domain Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Defines glue records for a domain, associating hostnames with IP addresses. Use when a domain's nameservers are subdomains of itself. The `hostname` must be fully qualified. ```hcl resource "inwx_glue_record" "ns1_example_com" { hostname = "ns1.example.com" ip = [ "203.0.113.1", "2001:db8::1", ] } resource "inwx_glue_record" "ns2_example_com" { hostname = "ns2.example.com" ip = [ "203.0.113.2", ] } ``` -------------------------------- ### Resource: `inwx_domain` Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Registers and manages a domain. Requires at least a `registrant` contact ID. `renewal_mode` accepts `AUTORENEW`, `AUTODELETE`, or `AUTOEXPIRE`. The `name` attribute is immutable. ```APIDOC ## Resource: `inwx_domain` Registers and manages a domain. Requires at least a `registrant` contact ID. `renewal_mode` accepts `AUTORENEW`, `AUTODELETE`, or `AUTOEXPIRE`. The `name` attribute is immutable. `extra_data` passes jurisdiction-specific key/value pairs (e.g., WHOIS protection, trustee acceptance). Import is supported using the domain name as the ID. ```hcl resource "inwx_domain" "example_com" { name = "example.com" period = "1Y" renewal_mode = "AUTORENEW" transfer_lock = true nameservers = [ "ns.inwx.de", "ns2.inwx.de", "ns3.inwx.eu", ] contacts { registrant = inwx_domain_contact.registrant.id admin = inwx_domain_contact.registrant.id tech = inwx_domain_contact.registrant.id billing = inwx_domain_contact.registrant.id } extra_data = { # "WHOIS-PROTECTION" = "1" # "ACCEPT-TRUSTEE-TAC" = "1" } } ``` ``` -------------------------------- ### Add DNS Records to a Zone Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Manages various DNS record types (A, CNAME, MX, TXT) within a specified domain zone. Ensure the `inwx_nameserver` resource for the domain is configured first. ```hcl # 4. Add DNS records resource "inwx_nameserver_record" "root_a" { domain = inwx_nameserver.example_com.domain type = "A" content = "203.0.113.10" } resource "inwx_nameserver_record" "www_cname" { domain = inwx_nameserver.example_com.domain type = "CNAME" name = "www" content = "example.com" } resource "inwx_nameserver_record" "mx" { domain = inwx_nameserver.example_com.domain type = "MX" content = "mail.example.com" prio = 10 } resource "inwx_nameserver_record" "txt_spf" { domain = inwx_nameserver.example_com.domain type = "TXT" content = "v=spf1 mx ~all" } ``` -------------------------------- ### inwx_nameserver_record Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/resources/inwx_nameserver_record.md Manages an INWX nameserver record. A zone must exist for the domain. ```APIDOC ## Resource: inwx_nameserver_record Provides a INWX nameserver record resource. A zone has to exist to add records to it. The zone can be created with [inwx_nameserver](inwx_nameserver.md). ### Argument Reference * `domain` - (Required) Name of the domain * `type` - (Required) Type of the nameserver record. One of: `A`, `AAAA`, `AFSDB`, `ALIAS`, `CAA`, `CERT`, `CNAME`, `HINFO`, `HTTPS`, `IPSECKEY`, `LOC`, `MX`, `NAPTR`, `NS`, `OPENPGPKEY`, `PTR`, `RP`, `SMIMEA`, `SOA`, `SRV`, `SSHFP`, `SVCB`, `TLSA`, `TXT`, `URI`, `URL` * `ro_id` - (Optional) DNS domain id * `content` - (Required) Content of the nameserver record * `name` - (Optional) Name of the nameserver record * `ttl` - (Optional) TTL (time to live) of the nameserver record. Default: `3600` * `prio` - (Optional) Priority of the nameserver record. Default: `0` * `url_redirect_type` - (Optional) Type of the url redirection. One of: `HEADER301`, `HEADER302`, `FRAME` * `url_redirect_title` - (Optional) Title of the frame redirection * `url_redirect_description` - (Optional) Description of the frame redirection * `url_redirect_fav_icon` - (Optional) FavIcon of the frame redirection * `url_redirect_keywords` - (Optional) Keywords of the frame redirection * `url_append` - (Optional) Append the path for redirection. Default: `false` * `testing` - (Optional) Execute command in testing mode. Default: `false` ### Attribute Reference In addition to all arguments above, the following attributes are exported: * `id` - Id of the nameserver record ### Import INWX nameserver records can be imported using the `id`, e.g., ``` $ terraform import inwx_nameserver_record example.com:2147483647 ``` ``` -------------------------------- ### Resource: `inwx_domain_contact` Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Creates and manages a registrant, admin, tech, or billing contact. The `type` field is immutable after creation. `country_code` must be ISO 3166-1 alpha-2. ```APIDOC ## Resource: `inwx_domain_contact` Creates and manages a registrant, admin, tech, or billing contact. Contact IDs returned by this resource are referenced by `inwx_domain`. The `type` field is immutable after creation; changing it forces a new resource. `country_code` must be exactly two characters (ISO 3166-1 alpha-2). `remarks` is optional and limited to 255 characters. ```hcl resource "inwx_domain_contact" "registrant" { type = "PERSON" name = "Jane Doe" street_address = "Example Street 42" city = "Berlin" postal_code = "10115" state_province = "Berlin" country_code = "DE" phone_number = "+49.3012345678" email = "jane.doe@example.com" remarks = "Primary registrant contact" } resource "inwx_domain_contact" "org_contact" { type = "ORG" name = "John Admin" organization = "Example GmbH" street_address = "Business Park 1" city = "Hamburg" postal_code = "20095" country_code = "DE" phone_number = "+49.4098765432" fax = "+49.4098765433" email = "admin@example-gmbh.de" } output "registrant_id" { value = inwx_domain_contact.registrant.id # Example output: 1234567 } ``` ``` -------------------------------- ### Create an ORG Domain Contact Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Creates a new domain contact of type ORG (organization). Ensure all required fields like `name`, `organization`, `street_address`, `city`, `postal_code`, `country_code`, `phone_number`, and `email` are provided. ```hcl resource "inwx_domain_contact" "org_contact" { type = "ORG" name = "John Admin" organization = "Example GmbH" street_address = "Business Park 1" city = "Hamburg" postal_code = "20095" country_code = "DE" phone_number = "+49.4098765432" fax = "+49.4098765433" email = "admin@example-gmbh.de" } ``` -------------------------------- ### Import Nameserver Zone into Terraform State Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Use this command to import an existing nameserver zone into your Terraform state, specifying the domain and its internal resource ID. ```bash terraform import inwx_nameserver.example_com example.com: ``` -------------------------------- ### Reference Contact in Domain Resource Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Demonstrates referencing a looked-up contact (using `data.inwx_domain_contact.existing.id`) within an `inwx_domain` resource. ```hcl # Reference the looked-up contact in a domain resource resource "inwx_domain" "example_com" { name = "example.com" period = "1Y" renewal_mode = "AUTORENEW" contacts { registrant = data.inwx_domain_contact.existing.id } } ``` -------------------------------- ### inwx_automated_dnssec Resource Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Enables fully automated DNSSEC signing for a domain using INWX nameservers. INWX handles key generation, signing, and DS record submission. ```APIDOC ## Resource: `inwx_automated_dnssec` Enables fully automated DNSSEC signing for a domain that uses INWX nameservers. INWX handles key generation, signing, and DS record submission automatically. The resource has only one attribute (`domain`) and is immutable — any change to `domain` destroys and recreates it. Supports state import using the domain name. ### Example ```hcl resource "inwx_nameserver" "example_com" { domain = "example.com" type = "MASTER" nameservers = ["ns.inwx.de", "ns2.inwx.de"] } resource "inwx_automated_dnssec" "example_com" { domain = inwx_nameserver.example_com.domain # Enabling this resource calls dnssec.enablednssec; # destroying it calls dnssec.disablednssec } ``` ### Import ```hcl # Import existing automated DNSSEC: terraform import inwx_automated_dnssec.example_com example.com ``` ``` -------------------------------- ### inwx_nameserver_record Resource Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Manages individual DNS records within a zone. Supports all standard record types including A, AAAA, CNAME, MX, TXT, SRV, TLSA, CAA, NS, PTR, ALIAS, and URL. ```APIDOC ## Resource: `inwx_nameserver_record` Creates and manages individual DNS records within a zone managed by `inwx_nameserver`. Supports all standard record types: `A`, `AAAA`, `CNAME`, `MX`, `TXT`, `SRV`, `TLSA`, `CAA`, `NS`, `PTR`, `ALIAS`, `URL`, and more. TTL minimum is 300 seconds (default 3600). Import format: `:`. ### Example (A Record) ```hcl # A record resource "inwx_nameserver_record" "a_root" { domain = "example.com" type = "A" content = "203.0.113.10" ttl = 3600 } ``` ### Example (AAAA Record) ```hcl # AAAA record for a subdomain resource "inwx_nameserver_record" "aaaa_www" { domain = "example.com" type = "AAAA" name = "www" content = "2001:db8::1" ttl = 3600 } ``` ### Example (MX Record) ```hcl # MX record with priority resource "inwx_nameserver_record" "mx_primary" { domain = "example.com" type = "MX" content = "mail.example.com" prio = 10 ttl = 3600 } ``` ### Example (TXT Record) ```hcl # TXT record (SPF) resource "inwx_nameserver_record" "spf" { domain = "example.com" type = "TXT" content = "v=spf1 include:_spf.example.com ~all" ttl = 3600 } ``` ### Example (CNAME Record) ```hcl # CNAME for www resource "inwx_nameserver_record" "cname_www" { domain = "example.com" type = "CNAME" name = "www" content = "example.com" ttl = 3600 } ``` ### Example (CAA Record) ```hcl # CAA record resource "inwx_nameserver_record" "caa" { domain = "example.com" type = "CAA" content = "0 issue \"letsencrypt.org\"" ttl = 3600 } ``` ### Example (URL Redirect Record) ```hcl # URL redirect (HTTP 301) using the URL pseudo-type resource "inwx_nameserver_record" "redirect_shop" { domain = "example.com" type = "URL" name = "shop" content = "https://shop.example.com" url_redirect_type = "HEADER301" ttl = 3600 } ``` ### Import ```hcl # Import an existing record: terraform import inwx_nameserver_record.a_root example.com:987654 ``` ``` -------------------------------- ### Import DNS Record into Terraform State Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Use this command to import an existing DNS record into your Terraform state, specifying the domain and the record's internal ID. ```bash terraform import inwx_nameserver_record.a_root example.com:987654 ``` -------------------------------- ### Create a PERSON Domain Contact Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Creates a new domain contact of type PERSON. The `country_code` must be a two-character ISO 3166-1 alpha-2 code. The `remarks` field is optional and limited to 255 characters. ```hcl resource "inwx_domain_contact" "registrant" { type = "PERSON" name = "Jane Doe" street_address = "Example Street 42" city = "Berlin" postal_code = "10115" state_province = "Berlin" country_code = "DE" phone_number = "+49.3012345678" email = "jane.doe@example.com" remarks = "Primary registrant contact" } ``` -------------------------------- ### Import DNSSEC Key into Terraform State Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Use this command to import an existing DNSSEC key configuration into your Terraform state, specifying the domain and the digest. ```bash terraform import inwx_dnssec_key.example_com example.com/ ``` -------------------------------- ### Register a Domain with INWX Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Registers a new domain with specified renewal mode and transfer lock. It also configures contact information and nameservers for the domain. ```hcl resource "inwx_domain" "example_com" { name = "example.com" period = "1Y" renewal_mode = "AUTORENEW" transfer_lock = true nameservers = ["ns.inwx.de", "ns2.inwx.de"] contacts { registrant = inwx_domain_contact.owner.id admin = inwx_domain_contact.owner.id tech = inwx_domain_contact.owner.id billing = inwx_domain_contact.owner.id } } ``` -------------------------------- ### inwx_dnssec_key Resource Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Adds an external DNSKEY record for a domain using third-party nameservers. The provider submits the public key to the INWX registry and retrieves the computed DS record. ```APIDOC ## Resource: `inwx_dnssec_key` Adds an external DNSKEY record for a domain that uses third-party nameservers. The provider submits the public key to the INWX registry and retrieves the computed DS record. All attributes except `domain` are immutable (force new). The digest is computed by the API. Import format: `/`. ### Example ```hcl resource "inwx_dnssec_key" "example_com" { domain = "example.com" public_key = "AwEAAb3...base64encodedkey...==" algorithm = 13 # ECDSAP256SHA256 } output "dnssec_digest" { value = inwx_dnssec_key.example_com.digest } output "dnssec_key_tag" { value = inwx_dnssec_key.example_com.key_tag } output "dnssec_flag" { value = inwx_dnssec_key.example_com.flag # 256 = ZSK, 257 = KSK } ``` ### Import ```hcl # Import an existing DNSKEY: terraform import inwx_dnssec_key.example_com example.com/ ``` ``` -------------------------------- ### Import Automated DNSSEC into Terraform State Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Use this command to import an existing automated DNSSEC configuration into your Terraform state using the domain name. ```bash terraform import inwx_automated_dnssec.example_com example.com ``` -------------------------------- ### Register and Manage a Domain Source: https://context7.com/inwx/terraform-provider-inwx/llms.txt Registers and manages a domain, requiring at least a `registrant` contact ID. `renewal_mode` accepts `AUTORENEW`, `AUTODELETE`, or `AUTOEXPIRE`. The `name` attribute is immutable. `extra_data` can pass jurisdiction-specific key/value pairs. ```hcl resource "inwx_domain" "example_com" { name = "example.com" period = "1Y" renewal_mode = "AUTORENEW" transfer_lock = true nameservers = [ "ns.inwx.de", "ns2.inwx.de", "ns3.inwx.eu", ] contacts { registrant = inwx_domain_contact.registrant.id admin = inwx_domain_contact.registrant.id tech = inwx_domain_contact.registrant.id billing = inwx_domain_contact.registrant.id } extra_data = { # "WHOIS-PROTECTION" = "1" # "ACCEPT-TRUSTEE-TAC" = "1" } } ``` -------------------------------- ### inwx_domain_contact Data Source Source: https://github.com/inwx/terraform-provider-inwx/blob/main/docs/data-sources/inwx_domain_contact.md The `inwx_domain_contact` data source allows you to retrieve details of a specific domain contact from INWX. This is useful for referencing existing contacts when creating or managing domain resources. ```APIDOC ## Data Source: inwx_domain_contact Provides a INWX domain contact resource. Needed for [inwx_domain](inwx_domain.md). ### Argument Reference * `id` - (Required) Numerical id of domain contact resource * `type` - (Optional) Type of contact. One of: `ORG`, `PERSON`, `ROLE` * `name` - (Optional) First and lastname of the contact * `organization` - (Optional) The legal name of the organization. Required for types other than person * `street_address` - (Optional) Street Address of the contact * `city` - (Optional) City of the contact * `postal_code` - (Optional) Postal Code/Zipcode of the contact * `state_province` - (Optional) State/Province name of the contact * `country_code` - (Optional) Country code of the contact. Must be two characters * `phone_number` - (Optional) Phone number of the contact * `fax` - (Optional) Fax number of the contact * `email` - (Optional) Contact email address * `remarks` - (Optional) Custom description of the contact ### Example Usage ```terraform data "inwx_domain_contact" "example_person" { id = 1 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 = "person@example.invalid" } output "inwx_domain_contact" { value = data.inwx_domain_contact.example_person } ``` ```