Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing subnet-ids dynamically is failing. #11

Open
akshaysgithub opened this issue Apr 11, 2020 · 2 comments
Open

Passing subnet-ids dynamically is failing. #11

akshaysgithub opened this issue Apr 11, 2020 · 2 comments

Comments

@akshaysgithub
Copy link

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
Copy link
Author

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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants