1
votes

I am currently working on deploying a Aurora postgres instance in AWS thanks to Terraform.

Here is my declaration

resource "aws_db_instance" "postgreDatabase" {
  name = "validName"
  storage_type = "gp2"
  allocated_storage = "25"
  engine = "aurora-postgresql"
  engine_version = "10.5"
  instance_class = "db.r4.large"
  username = "validUsername"
  password = "validPassword"

}

Using this declaration throws the following error:

aws_db_instance.postgreDatabase: Error creating DB Instance: StorageTypeNotSupported: Invalid storage type: gp2

If i change the engine to

engine = "postgres"

, it works fine but i need an aurora instance.

Any idea on what is wrong with my declaration here ?

Thank you very much.

2
The error message seems to imply that gp2 storage is incompatible with Arurora Postgres.Matt Schuchard

2 Answers

3
votes

Thank you for the help.

I found the solution. Indeed the storage type is not needed for an aurora instance. But it must be created inside a DB cluster. So you first have to create the cluster then create the db instance with the proper cluster identifier.

2
votes

aurora-postgresql is an AWS managed DB and does not offer storage_type as a configuration parameter.

If storage_type is a required configuration, using AWS RDS postgres is probably best.

If Aurora management is desired, the DB instance type can be configured for maximum performance.