How to convert variable case

hello,
aws S3 naming requires all letters to be lowercase. The S3 name is generated based on the template and input variable.
I wonder, what is the good way to ensure that variable is in lowercase.
//other than applying lower() in the s3 name.

Hi @AZZ,

Using the existing function to convert the string to lowercase is exactly what I would’ve suggested. Can you say more about why that isn’t a suitable solution in your case?

@apparentlymart thank you for the reply.
I’m not saying it is not suitable. I wonder where to apply it? In the var definition as a condition or in the s3. eg.:

variable "client_abbr" {
  default = "TADA"
 condition = lower(var.client_abbr) == var.client_abbr
 error_message = "Must be lwoer case"
}

or

resource "aws_s3_bucket" "this" {
  bucket = lower("${var.S3_type}-${var.S3_basename}-${var.client_abbr}")
...
}

Thank you.