terraform-aws-rds-cluster
terraform-aws-rds-cluster copied to clipboard
Creating Postgres Multi A-Z RDS cluster running into error InvalidParameterValue: CreateDBInstance
Found a bug? Maybe our Slack Community can help.
Describe the Bug
When trying to create a Multi A-Z postgres cluster, it runs into the following error:
Error: error creating RDS Cluster (eg-test-rds-cluster) Instance: 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: xxx-xxxx-xxxxx-xxxxx
│
│ with module.rds_cluster.aws_rds_cluster_instance.default[0],
│ on ../../main.tf line 240, in resource "aws_rds_cluster_instance" "default":
The resource aws_rds_cluster_instance is specifically used for Aurora engine types like aurora, aurora-mysql, aurora-postgresql Check here.
Expected Behavior
When trying to setup other non-aurora engine types, the resource aws_rds_cluster_instance creation should be skipped.
Steps to Reproduce
Steps to reproduce the behavior:
- Create non-aurora multi a-z rds-cluster with following vars:
availability_zones = ["us-east-2a", "us-east-2b", "us-east-2c"]
engine = "postgres"
engine_mode = "provisioned"
engine_version = "13.4"
db_cluster_instance_class = "db.m5d.large"
allocated_storage = 100
storage_type = "io1"
iops = 1000
- Do a terraform apply
- See error
Additional Context
Add any other context about the problem here.