_This issue was originally opened by @jflammia as hashicorp/terraform#15259. It was migrated here as part of the provider split. The original body of the issue is below._
Terraform v0.9.6
database_allocated_storage = "240"
database_storage_type = "standard"
database_engine = "postgres"
database_engine_version = "9.6.2-R1"
database_instance_class = "db.t2.large"
database_username = "user"
database_password = "password"
variable "database_allocated_storage" {
type = "string"
description = "The allocated storage in gigabytes."
}
variable "database_storage_type" {
type = "string"
description = "The AWS volume type. Options: 'standard', 'gp2' (General Purpose SSD), or 'io1' (Provisioned IOPS)."
}
variable "database_instance_class" {
type = "string"
description = "The instance type of the RDS instance."
}
variable "database_engine" {
type = "string"
description = "The database engine to use."
}
variable "database_engine_version" {
type = "string"
description = "The engine version to use."
}
variable "database_username" {
type = "string"
description = "Username for the master DB user."
}
variable "database_password" {
type = "string"
description = "Password for the master DB user."
}
resource "aws_db_instance" "tv" {
identifier = "tv-database"
vpc_security_group_ids = ["${data.terraform_remote_state.db_sg.sg_id}"]
db_subnet_group_name = "tv_database_sng"
publicly_accessible = false
allocated_storage = "${var.database_allocated_storage}"
storage_type = "${var.database_storage_type}"
instance_class = "${var.database_instance_class}"
engine = "${var.database_engine}"
engine_version = "${var.database_engine_version}"
username = "${var.database_username}"
password = "${var.database_password}"
tags {
Name = "TV-Database"
ManagedByTerraform = "true"
Environment = "${terraform.env}"
}
}
Error applying plan:
1 error(s) occurred:
* aws_db_instance.tv: 1 error(s) occurred:
* aws_db_instance.tv: Error creating DB Instance: InvalidParameterCombination: Cannot find version 9.6.2-r1 for postgres
status code: 400, request id:
Should be able to select any of the engine versions that AWS makes available for AWS RDS, specificially PostgreSQL
Terraform runs a tolower() method on the argument passed in to the AWS API. In other words, "9.6.2-R1" gets transmitted as "9.6.2-r1". AWS cannot locate the correct engine version since it seems to be case sensitive.
Please list the steps required to reproduce the issue, for example:
aws_db_instance resource with the engine_version set to a value that has an uppercase alpha character in itengine_version string represented correctly. However, the terraform apply transmits it differently.Definitely running into this as well. Provisioning postgresql instances is a bit weird since all of the versions include '-R1' in their name.
Turns out R1 is not needed in engine version afterall. Just drop the R1 from the engine version and it works fine. So for 9.6.3-R1 just this would work engine_version = "9.6.3"
@suneeta-mall thanks for the help on this old issue. I am going to close this as the solution is to specify the version as documented at https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.DBVersions
Sorry for any confusion or problems this may have presented for users.
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
Turns out R1 is not needed in engine version afterall. Just drop the R1 from the engine version and it works fine. So for
9.6.3-R1just this would workengine_version = "9.6.3"