storage type error with terraform and aurora postgresql

吃可爱长大的小学妹 提交于 2019-12-11 15:59:17

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/55950105/storage-type-error-with-terraform-and-aurora-postgresql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!