stackitcloud / terraform-provider-stackit

The official Terraform provider for STACKIT
https://registry.terraform.io/providers/stackitcloud/stackit
Apache License 2.0
42 stars 14 forks source link

stackit_dns_record_set allows ttl of 30 but the DNS API requires >= 60 #292

Closed PeterStolz closed 8 months ago

PeterStolz commented 8 months ago

The validation of the terraform provider allows a TTL of 30 but the StackitAPI requires at least a TTL of 60. With the code below I get this error:

╷
│ Error: Error updating record set
│ 
│   with stackit_dns_record_set.example,
│   on main.tf line 283, in resource "stackit_dns_record_set" "example":
│  283: resource "stackit_dns_record_set" "example" {
│ 
│ 400 Bad Request, status code 400, Body: {"message":"record set  is not valid","error":"Key: 'RRSet.TTL' Error:Field validation for 'TTL' failed on the 'min' tag"}
│ 
╵
resource "stackit_dns_record_set" "example" {
  project_id = var.stackit_project_id
  zone_id    = stackit_dns_zone.domain.zone_id
  name       = "stoffstrom.runs.onstackit.cloud."
  type       = "A"
  records    = ["1.2.3.4"]
  ttl = 30
}
joaopalet commented 8 months ago

Thanks for opening the issue and prompt contribution!