Hi,
Terraform v0.9.11
data "aws_availability_zones" "available" {}
resource "aws_vpc" "main" {
cidr_block = "10.10.0.0/16"
}
resource "aws_subnet" "main" {
count = "2"
cidr_block = "${cidrsubnet(aws_vpc.main.cidr_block, 8, count.index)}"
availability_zone = "${data.aws_availability_zones.available.names[count.index]}"
vpc_id = "${aws_vpc.main.id}"
}
resource "aws_db_subnet_group" "main" {
name = "tf-db-main-${terraform.env}"
subnet_ids = ["${aws_subnet.main.*.id}"]
}
resource "aws_db_instance" "main" {
allocated_storage = 10
storage_type = "gp2"
engine = "postgres"
engine_version = "9.6.2"
instance_class = "${terraform.env == "production" ? "db.t2.medium" : "db.t2.small"}"
name = "mydatabase-${terraform.env}"
username = "mydatabase_user"
password = "mydatabase_user"
db_subnet_group_name = "${aws_db_subnet_group.main.name}"
}
I should have the ability to create an aws db instance with a name containing non alphanumeric characters such as -
or _
.
I tried manually through aws console and it went well.
* aws_db_instance.main: 1 error(s) occurred:
* aws_db_instance.main: Error creating DB Instance: InvalidParameterValue: DBName must begin with a letter and contain only alphanumeric characters.
Please list the steps required to reproduce the issue, for example:
terraform plan
terraform apply
Thanks !
Keep going ! You are doing a great job 😃 !
I stumbled on this too. But turned out that what I was looking for was the identifier argument.
identifier - The name of the RDS instance
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
I stumbled on this too. But turned out that what I was looking for was the identifier argument.
identifier - The name of the RDS instance