labd / terraform-provider-commercetools

Terraform provider for commercetools
https://registry.terraform.io/providers/labd/commercetools/latest/docs
Mozilla Public License 2.0
64 stars 68 forks source link

Error when using es-419 language code on localized_value (does not allow numbers) #464

Closed chubaquelo closed 5 months ago

chubaquelo commented 6 months ago

In the project I'm working, we are using es-419 language code for all LATAM countries as the code for spanish. When trying to update fields, we get this error:

│ Error: Invalid map key
│ 
│   with commercetools_shipping_method.digital-products-only,
│   on [shipping_methods.tf](*****/shipping_methods.tf) line 2xx, in resource "commercetools_shipping_method" "digital-products-only":
│  2xx:     es-419 = "Método de envío para digitales"
│ 
│ Locale keys must match pattern ^[a-z]{2}(-[A-Z]{2})?$: es-419

It seems it only expect something like es-AR / es-ES , but in this case we need the es-419 code.

demeyerthom commented 6 months ago

Hi @chubaquelo looks like we are to restrictive with our validation indeed. I will see if I can improve the validation to better reflect what commercetools allows