gmichels / terraform-provider-adguard

Terraform provider for AdGuard
https://registry.terraform.io/providers/gmichels/adguard/latest/docs
MIT License
9 stars 4 forks source link

DNS rewrites not accepting all possible options #60

Closed yenoromm closed 12 months ago

yenoromm commented 1 year ago

Adguard also supports the values 'A' and 'AAA'. These values work well if you have a wildcard such as *.example.com in Adguard but you want another.exmaple.com to be resolved upstream.

Unfortunately, this provider does not support these, here is the error I receive when I try use one of these values:

Attribute answer must be an IP address/CIDR, MAC address, or only contain numbers, lowercase letters, and hyphens, got: A

gmichels commented 1 year ago

Can you please provide the HCL you are trying?

yenoromm commented 1 year ago

Here is an example of where I would use an A record in conjunction with a wildcard rewrite:

resource "adguard_rewrite" "wildcard-example" {
  domain = "*.example.com"
  answer = "10.10.10.10"
}

The resource that creates the error:

resource "adguard_rewrite" "blog-example" {
  domain = "blog.example.com"
  answer = "A"
}

As you can see here this should be a valid option for Adguard:

Screenshot 2023-07-06 at 21 43 03
gmichels commented 12 months ago

Fixed, thanks for reporting.

yenoromm commented 12 months ago

Thanks maintaining a great provider!