terraform-provider-stackit
terraform-provider-stackit copied to clipboard
Enforce 32-char Name Limit in stackit_objectstorage_credentials_group During Plan Phase
Problem description
I'm frustrated when working with stackit_objectstorage_credentials_group resource because:
- The 32-character limit for the
namefield is only enforced duringterraform apply
│ Error: Error creating credentials group
│
│ Calling API: 422 Unprocessable Entity
│ (&[{%!s(*[]objectstorage.LocationInner=&[{<nil> 0xc00069c5a0} {<nil>
│ 0xc00069c5b0}]) %!s(*string=0xc00069c5c0) %!s(*string=0xc00069c5d0)}]),
│ status code 422, Body:
│ {"detail":[{"loc":["body","displayName"],"msg":"ensure this value has at
│ most 32
│ characters","type":"value_error.any_str.max_length","ctx":{"limit_value":32}}]}
- There's no mention of this limitation in the Terraform provider documentation
- No client-side validation exists to catch this issue during
terraform plan
Proposed solution
- Add clear documentation in the Terraform provider about the 32-character limit for the
namefield - Implement client-side validation in the Terraform provider to enforce this limit during
terraform plan
Additional information
The OpenAPI Spec already includes information about field limitations.
Hi @roandudel , thanks for the enhancement request. This seems a sensible extension, we will discuss this internally