Error: Error creating DB Instance: InvalidParameterValue: The input isn't valid. Input can't contain control characters. │

Viewed 298

Failing to # terraform apply (on rds creation tf)

resource "aws_db_instance" "default" {
  allocated_storage    = 5
  storage_type         = "gp2"
  engine               = "mysql"
  engine_version       = "5.7"
  instance_class       = "db.t2.micro"
  name                 = "mydb"
  username             = "foo"
  password             = file("../rds_pass.txt")
  parameter_group_name = "default.mysql5.7"
  skip_final_snapshot  = "true"
}

Error: Error creating DB Instance: InvalidParameterValue: The input isn't valid. Input can't contain control characters. status code: 400, request id: e4632bae-72fc-4912-9514-d7a8c37550e5,

1 Answers

Most probably you are following the Zeal Voras Lectures, here is what I did to fix this issue.

resource "aws_db_instance" "default" {
  allocated_storage    = 10
  db_name              = "mydb"
  engine               = "mysql"
  engine_version       = "5.7"
  instance_class       = "db.t3.micro"
  username             = "foo"
  password             = "${file("../../../rds_pass.txt")}"
  parameter_group_name = "default.mysql5.7"
  skip_final_snapshot  = true
}

Furthermore, make sure that RDS password is in small letters, capital letters are not allowed.

Wrong Example: MySuperPassword

Correct Example: mysuperpassword

Related