terraform-provider-stackit icon indicating copy to clipboard operation
terraform-provider-stackit copied to clipboard

Enforce 32-char Name Limit in stackit_objectstorage_credentials_group During Plan Phase

Open roandudel opened this issue 8 months ago • 1 comments

Problem description

I'm frustrated when working with stackit_objectstorage_credentials_group resource because:

  1. The 32-character limit for the name field is only enforced during terraform 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}}]}
  1. There's no mention of this limitation in the Terraform provider documentation
  2. No client-side validation exists to catch this issue during terraform plan

Proposed solution

  1. Add clear documentation in the Terraform provider about the 32-character limit for the name field
  2. 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.

roandudel avatar Apr 30 '25 12:04 roandudel

Hi @roandudel , thanks for the enhancement request. This seems a sensible extension, we will discuss this internally

bahkauv70 avatar Apr 30 '25 13:04 bahkauv70