Describe the bug
When setting the description fíeld on tailscale_tailnet_key_ the provider does not do validation on the length, or at least does not validate it according to the API rules, causing a long (above 50) character description to be accepted into the state.
This, in turn, causes a permadiff situation where the resource keeps being recreated (causing a new key to be created) on each apply.
To Reproduce
Steps to reproduce the behaviour:
resource "tailscale_tailnet_key" "foobar" {
expiry = 123456
description = "This description is too long and will be cut to 50 chars by the Tailscale API"
}
On initial terraform plan (and then apply):
# tailscale_tailnet_key.foobar will be created
+ resource "tailscale_tailnet_key" "foobar" {
+ created_at = (known after apply)
+ description = "This description is too long and will be cut to 50 chars by the Tailscale API"
.... snip....
}
On next run of terraform plan
# tailscale_tailnet_key.foobar must be replaced
-/+ resource "tailscale_tailnet_key" "foobar" {
~ description = "This description is too long and will be cut to 50" -> "This description is too long and will be cut to 50 chars by the Tailscale API" # forces replacement
... snip ...
}
Expected behaviour
The provider should not accept a description which violates the max length and should fail at the plan stage.
Desktop (please complete the following information):
Describe the bug When setting the
description
fíeld ontailscale_tailnet_key_
the provider does not do validation on the length, or at least does not validate it according to the API rules, causing a long (above 50) character description to be accepted into the state.This, in turn, causes a permadiff situation where the resource keeps being recreated (causing a new key to be created) on each apply.
To Reproduce Steps to reproduce the behaviour:
On initial
terraform plan
(and then apply):On next run of
terraform plan
Expected behaviour The provider should not accept a description which violates the max length and should fail at the
plan
stage.Desktop (please complete the following information):
1.4.7
0.13.13