Terraform-provider-aws: aws_rds_cluster_instance: Cannot find version 9.6.6 for aurora

Created on 7 Jun 2018  ยท  4Comments  ยท  Source: hashicorp/terraform-provider-aws

terraform --version
Terraform v0.11.7
+ provider.aws v1.22.0
resource "aws_rds_cluster_instance" "postgres-instance" {
  identifier         = "postgres"
  cluster_identifier = "${aws_rds_cluster.postgres.id}"
  instance_class     = "db.r4.large"
  engine_version     = "9.6.6"
}

resource "aws_rds_cluster" "postgres" {
  cluster_identifier      = "postgres-cluster"
  engine                  = "aurora-postgresql"
  availability_zones      = ["us-east-1a", "us-east-1b"]
  database_name           = "mydb"
  master_username         = "foo"
  master_password         = "barbarbar"
  backup_retention_period = 5
  preferred_backup_window = "07:00-09:00"
  skip_final_snapshot     = "true"
  engine_version     = "9.6.6"
}

ERROR:

Error: Error applying plan:

1 error(s) occurred:

* aws_rds_cluster_instance.postgres-instance: 1 error(s) occurred:

* aws_rds_cluster_instance.postgres-instance: error creating RDS DB Instance: InvalidParameterCombination: Cannot find version 9.6.6 for aurora
    status code: 400, request id: 350a8ea7-4b94-4e10-95fb-b84016b49132
question servicrds waiting-response

Most helpful comment

Yes, the trick here is to use the same engine and engine_version parameters on both rds_cluster and rds_cluster_instance.

resource "aws_rds_cluster_instance" "postgres-instance" {
  identifier         = "postgres"
  cluster_identifier = "${aws_rds_cluster.postgres.id}"
  instance_class     = "db.r4.large"
  engine             = "${aws_rds_cluster.postgres.engine}"
  engine_version     = "${aws_rds_cluster.postgres.engine_version}"
}

Default engine is aurora. People will run into similar issues with MySQL as well if they define aws_rds_cluster to use engine = "aurora-mysql" and leave the engine undefined in the aws_rds_cluster_instance. Then cluster is configured to use MySQL 5.7 and the instance will default to MySQL 5.6. Did not try and see if it's actually willing to create such setup.

All 4 comments

Have you tried setting the "engine" argument to "aurora-postgresql" on the aws_rds_cluster_instance resource?

The docs imply that it defaults to "aurora" if unset which I'd suspect would be the aurora mysql variant as that was the first one.

It may be worth having it inherit these values from the cluster itself somehow, but I have no idea if that's possible.

https://www.terraform.io/docs/providers/aws/r/rds_cluster_instance.html#engine

Yes, the trick here is to use the same engine and engine_version parameters on both rds_cluster and rds_cluster_instance.

resource "aws_rds_cluster_instance" "postgres-instance" {
  identifier         = "postgres"
  cluster_identifier = "${aws_rds_cluster.postgres.id}"
  instance_class     = "db.r4.large"
  engine             = "${aws_rds_cluster.postgres.engine}"
  engine_version     = "${aws_rds_cluster.postgres.engine_version}"
}

Default engine is aurora. People will run into similar issues with MySQL as well if they define aws_rds_cluster to use engine = "aurora-mysql" and leave the engine undefined in the aws_rds_cluster_instance. Then cluster is configured to use MySQL 5.7 and the instance will default to MySQL 5.6. Did not try and see if it's actually willing to create such setup.

Thanks @ImperialXT and @vtorhonen. This helped!

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!

Was this page helpful?
0 / 5 - 0 ratings