terraform-provider-vultr icon indicating copy to clipboard operation
terraform-provider-vultr copied to clipboard

Sensible Defaults

Open grant-veepshosting opened this issue 5 years ago • 1 comments

This plugin is fantastic, but should set sensible defaults appropriate to the wider infrastructure, community and scene in which is adds value.

Eg,

IPv6 should default to = true

PTR (reverse Hostname lookup), should default to == forward hostname

grant-veepshosting avatar Oct 14 '18 05:10 grant-veepshosting

ipv6=true can't easily be implemented in retrospect. Doing so would modify the instances of all the people that have not defined an explicit value. And if the value is modified, the instance resource must be re-created.

The instance must be re-created because there is no way to disable IPv6 once it has been enabled. So in order to disable IPv6 the provider needs to delete the server and re-create it. But it is an all-or-nothing decision: Either a resource must be re-created when a certain value changes or not. It's afaik currently not possible to implement in a provider that a resource needs to be re-created if ipv6=true becomes ipv6=false, but not the other way round.

As for the PTR: This is tricky to implement and has potential side-effects. (For example, how should the provider behave if it was possible to create the instance but not possible set the PTR to the value provided?) At least once #78 is merged you will have to possibility to take care of PTRs yourself in an automated fashion:

// Define reverse name for main IPv4
resource "vultr_reverse_name" "example_v4" {
  instance_id = "${vultr_instance.example.id}"
  ip          = "${vultr_instance.example.ipv4_address}"
  name        = "example.com"
}

cimnine avatar Jun 12 '19 20:06 cimnine