Not clear whether nameservers parameter is required
Closed this issue · 3 comments
According to the docs:
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).
But if I don't provide nameservers
, will my domain continue to use the default? If I don't provide the parameter, terraform plan
shows:
nameservers.#: "2" => "0"
nameservers.0: "ns43.domaincontrol.com" => ""
nameservers.1: "ns44.domaincontrol.com" => ""
This is worrying enough for me not to run terraform apply
, but it might just be aesthetics, or a consequence of me previously running terraform import
so as not to wipe out my existing domain records (issue #8).
It would be cool to document this, even with a // if not defined, uses default
in the example in README.md
, but before I send a PR, I'd better be sure I know what I'm talking about. ;)
terraform import
allows you to import the state of the remote service (GD in this case) into your .tfstate file. After you run terraform import
, you need to update the contents of your Terraform configuration file in order for the settings to be preserved. Terraform may call this out when you run the import
command.
In the case above, the nameservers would be removed since they appear to be undefined in your configuration, but are present in your state file.
I had run import
. Is it possible that import
doesn't import nameservers?
Interesting....when you runimport
, all settings should be copied into the .tfstate file, but not the .tf configuration file. Terraform uses the .tfstate file as a local cache of the remote state and applies the changes from your .tf configuration file. If the settings aren't manually copied into the Terraform configuration file, they will be removed from the local state file as well as the GD server(s).