问题
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