cloudposse / terraform-aws-rds-replica

Terraform module that provisions an RDS replica
https://cloudposse.com/accelerate
Apache License 2.0
30 stars 28 forks source link

Passing subnet-ids dynamically is failing. #11

Open akshaysgithub opened 4 years ago

akshaysgithub commented 4 years ago

Hello friends,

I am trying to create a vpc, and replicate an existing RDS instance. It's failing with error below :

Error: Incorrect attribute value type

  on .terraform/modules/rds_replica/main.tf line 68, in resource "aws_db_subnet_group" "default":
  68:   subnet_ids = ["${var.subnet_ids}"]

Inappropriate value for attribute "subnet_ids": element 0: string required.

What am I doing wrong?

COde :


module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "2.6.0"

  name                 = "terraform-vpc"
  cidr                 = "13.0.0.0/16"
  azs                  = data.aws_availability_zones.available.names
  private_subnets      = ["13.0.1.0/24", "13.0.2.0/24", "13.0.3.0/24"]
  public_subnets       = ["13.0.4.0/24", "13.0.5.0/24", "13.0.6.0/24"]
}

module "rds_replica" {
  source                      = "git::https://github.com/cloudposse/terraform-aws-rds-replica.git?ref=master"
  subnet_ids                  = ["${element(module.vpc.public_subnets, 0)}", "${element(module.vpc.public_subnets, 1)}"]
}

)
akshaysgithub commented 4 years ago

I am also facing this issue :


Error: Incorrect attribute value type

  on .terraform/modules/rds_replica.dns_host_name/main.tf line 7, in resource "aws_route53_record" "default":
   7:   records = ["${var.records}"]

Inappropriate value for attribute "records": element 0: string required.

I am using public subnet's manually now, just till the problem I first mentioned is solved. I have these values for zoneid and hostname : 

dns_zone_id = "OUR_ZONE_ID" host_name = "terraform_host"

Whats the DNS hostname here? Our subnets have public IP enabled. and dnssupport as well.

jross-ai commented 3 years ago

I am also facing this issue. Has anyone come up with a work around or is there a plan to fix this in the near future? @akshaysgithub have you fixed the problem for yourself?