terraform 和 aurora postgresql 的存储类型错误 [英] storage type error with terraform and aurora postgresql

查看:22
本文介绍了terraform 和 aurora postgresql 的存储类型错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢 Terraform,我目前正致力于在 AWS 中部署 Aurora postgres 实例.

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

这是我的声明

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:创建数据库实例时出错:StorageTypeNotSupported:无效的存储类型:gp2

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

如果我把引擎改成

引擎 = "postgres"

engine = "postgres"

,它工作正常,但我需要一个极光实例.

, it works fine but i need an aurora instance.

知道我在这里的声明有什么问题吗?

Any idea on what is wrong with my declaration here ?

非常感谢.

推荐答案

感谢您的帮助.

我找到了解决方案.实际上,aurora 实例不需要存储类型.但它必须在数据库集群内创建.因此,您首先必须创建集群,然后使用正确的集群标识符创建数据库实例.

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.

这篇关于terraform 和 aurora postgresql 的存储类型错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆