Wanting to use 2 variable inputs for a name in a resource

I want to use 2 variables join them so that I can use them to create the name of this resource.

locals {
   param_group = join("",[var.db_param_group_name, var.db_engine_ver])
}

resource "aws_db_parameter_group" "rds_postgresql_instance_parameter_group" {
  name        = local.param_group
}

but the above code gives me the following

the only thing I can think of it is trying to use the . instead of referencing the locals.tf file I created.

Hi @shadow1928,

Based on the configuration you shared and the values you entered at the prompts in your screenshot, I would expect local.param_group to have the following value:

"dbparam-guardium-postgresql15.3"

This string contains a dot . and so this error message seems to be correct: the string you’ve provided is not valid for the requirements of the Amazon RDS API.

I’m not sure what you meant by your closing comment, since you’ve not mentioned a locals.tf file anywhere else in your question or showed its content. Your local value refers directly to the two input variables, so you’ll either need to make sure both of those input variables contain strings that are valid for the RDS rules described in the error message, or use a different naming scheme that doesn’t include the version number as part of the name.