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

aws_db_instance db_subnet_group attribute does not work #1135

Closed
ryan-dyer-sp opened this issue Jul 12, 2017 · 3 comments · Fixed by #1141
Closed

aws_db_instance db_subnet_group attribute does not work #1135

ryan-dyer-sp opened this issue Jul 12, 2017 · 3 comments · Fixed by #1141
Labels
bug Addresses a defect in current functionality.

Comments

@ryan-dyer-sp
Copy link
Contributor

ryan-dyer-sp commented Jul 12, 2017

Terraform Version

0.9.11

Affected Resource(s)

Please list the resources as a list, for example:

  • data_aws_db_instance

Terraform Configuration Files

data "aws_db_instance" "source_db" {
  db_instance_identifier = "${var.source_db_name}"
}

resource "aws_rds_cluster" "default" {
  provider = "aws.dev_us-east-1"
  cluster_identifier = "${var.cluster_id}"
  availability_zones = [ "${data.aws_subnet.available.*.availability_zone}" ]
  database_name = "${var.db_name}"
  master_username = "${var.username}"
  master_password = "${var.password}"
  vpc_security_group_ids = [ "${data.aws_security_group.db_sg.id}" ]
  apply_immediately = false
  #db_subnet_group_name = "${var.db_subnet_group_name}"
  db_subnet_group_name = "${data.aws_db_instance.source_db.db_subnet_group}"
  db_cluster_parameter_group_name = "sp-aurora-56-cpg"
  storage_encrypted = true
  skip_final_snapshot = true
}

Debug Output

https://gist.github.com/ryan-dyer-sp/d1e1c668b0ad34fc1ce5c96a6e6ca18f
Not debug output as i dont think it helps for this.

Panic Output

NA

Expected Behavior

The attribute works according to documentation: https://www.terraform.io/docs/providers/aws/d/db_instance.html#db_subnet_group

Actual Behavior

Claims the attribute is invalid. Tried multiple other attributes within this data resource and they work. I believe the issue is in the code

d.Set("db_subnet_group", dbInstance.DBSubnetGroup)

I believe this should be db.Instance.DBSubnetGroup.DBSubnetGroupName

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan

Important Factoids

NA

References

NA

@stack72 stack72 added the bug Addresses a defect in current functionality. label Jul 13, 2017
@stack72
Copy link
Contributor

stack72 commented Jul 13, 2017

Hi @ryan-dyer-sp

You are indeed correct - sorry for the issue here! I just opened a PR that fixes it

Paul

@ryan-dyer-sp
Copy link
Contributor Author

Thanks! Any chance I can get a dev build with this fix in it? I tried checking out the code and fixing and building myself, but the build fails for me.

@ghost
Copy link

ghost commented Apr 11, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants