Skip to content
A terraform plugin for managing godaddy domain records
Branch: master
Clone or download


Terraform plugin for managing domain records

Codeship Status for n3integration/terraform-godaddy

Terraform v0.11.x
Terraform v0.10.x
Terraform v0.9.x
Terraform v0.8.x
Terraform v0.7.x


bash <(curl -s


In order to leverage the GoDaddy APIs, an API key is required. The key pair can be optionally stored in environment variables.

export GODADDY_API_KEY=abc


If key and secret aren't provided under the godaddy provider, they are expected to be exposed as environment variables: GODADDY_API_KEY and GODADDY_API_SECRET.

provider "godaddy" {
  key = "abc"
  secret = "123"

Domain Record Resource

A godaddy_domain_record resource requires a domain. If the domain is not registered under the account that owns the key, an optional customer number can be specified. Additionally, one or more record instances are required. For each record, the name, type, and data attributes are required. MX records can optionally specify priority or will default to 0. Address and NameServer records can be defined using shorthand-notation as addresses = [""] or nameservers = [""], respectively unless you need to override the default time-to-live (3600). The available record types include:

  • A
  • AAAA
  • MX
  • NS
  • SOA
  • TXT
resource "godaddy_domain_record" "gd-fancy-domain" {
  domain   = ""

  // required if provider key does not belong to customer
  customer = "1234"

  // specify zero or more record blocks
  // a record block allows you to configure A, or NS records with a custom time-to-live value
  // a record block also allow you to configure AAAA, CNAME, TXT, or MX records
  record {
    name = "www"
    type = "CNAME"
    data = ""
    ttl = 3600

  record {
    name = "@"
    type = "MX"
    data = ""
    ttl = 600
    priority = 1

  // specify any A records associated with the domain
  addresses   = ["", ""]

  // specify any custom nameservers for your domain
  // note: godaddy now requires that the 'custom' nameservers are first supplied through the ui
  nameservers = ["", ""]

Additional Information

If your zone contains existing data, please ensure that your Terraform resource configuration includes all existing records, otherwise they will be removed.

This plugin also supports Terraform's import feature. This will at least allow you to determine the changes introduced through terraform plan and update the resource configuration accordingly to preserve existing data. The supplied resource id to the terraform import command should be the name of the domain that you would like to import. Although this is currently a manual workaround, this plugin will be updated when Terraform includes support for fully automated imports.


Copyright 2019

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

You can’t perform that action at this time.