Error: only lowercase alphanumeric characters and hyphens allowed in parameter group "name"

I am creating an rds module and facing an error that is unelectable. terraform behaving unusually here.

rds.tf

resource "aws_db_parameter_group" "parameter_group" {

  name        = "${var.parameter_group_name} parameters"

  family      = "${var.family}"

  description = "Database parameter group for ${var.parameter_group_name}"

  parameter {

    name  = "${var.parameter_name}"

    value = "${var.parameter_value}"

  }

}
Error: only lowercase alphanumeric characters and hyphens allowed in parameter group "name"

  on ..\RDS\rds.tf line 7, in resource "aws_db_parameter_group" "parameter_group":
   7: resource "aws_db_parameter_group" "parameter_group" {

I tried many names but it is showing me the same error. can you plz help me to resolve this issue and why is terraform behaving like this here?

Hi @saurabh-sys,

The name argument you’ve set seems to contain a space, which is not permitted as noted in the error message.

To avoid this error message, remove the space from the value and also make sure that var.parameter_group_name doesn’t contain any characters except lowercase letters and hyphens.

thanks, apparentlymart. it’s working now.