cloudposse/terraform-aws-rds-cluster

CreateDBInstance can't be used to create a DB instance in a Multi-AZ DB cluster. Use CreateDBCluster instead.

shivakumarlb opened this issue · 1 comments

Describe the Bug

i am using minimal config to provision the db cluster, the cluster on console works properly but the terraform scripts fails in the end with the error message

│ Error: creating RDS Cluster (prod-mysql) Instance (prod-mysql-1): InvalidParameterValue: CreateDBInstance can't be used to create a DB instance in a Multi-AZ DB cluster. Use CreateDBCluster instead. │ status code: 400, request id: 7ec7b266-62c3-46b0-89f3-8ad0782e73ef │ │ with module.rds_mysql_idp.aws_rds_cluster_instance.default[0], │ on .terraform/modules/rds_mysql/main.tf line 251, in resource "aws_rds_cluster_instance" "default": │ 251: resource "aws_rds_cluster_instance" "default" {

Expected Behavior

script should not fail as cluster is up and running

Steps to Reproduce

` source = "cloudposse/rds-cluster/aws"
version = "1.9.0"

name = "name"
cluster_family = "mysql8.0"
engine = "mysql"
engine_mode = "provisioned"
engine_version = "8.0"
cluster_size = 1
namespace = var.namespace
stage = var.environment
admin_user = var.db_admin_username
admin_password = var.db_admin_password
db_name = "db_name"
db_port = 3306
db_cluster_instance_class = var.db_instance_type
vpc_id = var.vpc_id
security_groups = []
subnets = var.subnets
zone_id = var.zone_id
storage_type = "io1"
iops = 1000
allocated_storage = 100`

the tf script used

│ Error: creating RDS Cluster (bloom-prod-idpmysql) Instance (bloom-prod-idpmysql-1): InvalidParameterValue: CreateDBInstance can't be used to create a DB instance in a Multi-AZ DB cluster. Use CreateDBCluster instead. │ status code: 400, request id: 7ec7b266-62c3-46b0-89f3-8ad0782e73ef │ │ with module.rds_mysql_idp.aws_rds_cluster_instance.default[0], │ on .terraform/modules/rds_mysql_idp/main.tf line 251, in resource "aws_rds_cluster_instance" "default": │ 251: resource "aws_rds_cluster_instance" "default" {

Screenshots

No response

Environment

module version : 1.9.0
Terraform v1.5.0
on darwin_amd64

  • provider registry.terraform.io/hashicorp/aws v4.67.0
  • provider registry.terraform.io/hashicorp/local v2.5.1
  • provider registry.terraform.io/hashicorp/null v3.2.2
  • provider registry.terraform.io/hashicorp/random v3.6.0
  • provider registry.terraform.io/hashicorp/tls v4.0.5

Additional Context

No response