Closed hashibot closed 5 years ago
We've added some additional validation here to make it clear that, like the API itself, priority is required if the domain record type is MX or SRV. We error out early to avoid the failed API request. Now on apply you would receive:
Error: `priority` is required for when type is `MX`
on terraform-testing.tf line 29, in resource "digitalocean_record" "mx":
29: resource "digitalocean_record" "mx" {
This issue was originally opened by @tvaughan as hashicorp/terraform#2561. It was migrated here as part of the provider split. The original body of the issue is below.
Terraform's DigitialOcean domain_record documentation says that priority is optional. DigitalOcean's API documentation says that priority is required if the domain record type is MX or SRV. When priority is not provided in a terraform plan and it is required by the DigitalOcean API, this is the error:
Tested on:
To reproduce:
I'd like to submit a pull-request to resolve this. Should the DigitalOcean provider require priority, or provide a default value, like 10, when type is MX or SRV? FWIW - I assumed terraform would provide a default.