{"action":"created","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/528","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/528/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/528/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/528/events","html_url":"https://github.com/terraform-providers/terraform-provider-aws/issues/528","id":235666070,"number":528,"title":"RDS VPC Read Replica with different subnet group","user":{"login":"hashibot","id":26720499,"avatar_url":"https://avatars1.githubusercontent.com/u/26720499?v=4","gravatar_id":"","url":"https://api.github.com/users/hashibot","html_url":"https://github.com/hashibot","followers_url":"https://api.github.com/users/hashibot/followers","following_url":"https://api.github.com/users/hashibot/following{/other_user}","gists_url":"https://api.github.com/users/hashibot/gists{/gist_id}","starred_url":"https://api.github.com/users/hashibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashibot/subscriptions","organizations_url":"https://api.github.com/users/hashibot/orgs","repos_url":"https://api.github.com/users/hashibot/repos","events_url":"https://api.github.com/users/hashibot/events{/privacy}","received_events_url":"https://api.github.com/users/hashibot/received_events","type":"User","site_admin":false},"labels":[{"id":620316239,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":801370439,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/labels/service/rds","name":"service/rds","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-06-13T19:30:34Z","updated_at":"2018-04-26T21:19:55Z","closed_at":null,"author_association":"NONE","body":"_This issue was originally opened by @phoolish as hashicorp/terraform#11919. It was migrated here as part of the [provider split](https://www.hashicorp.com/blog/upcoming-provider-changes-in-terraform-0-10/). The original body of the issue is below._\r\n\r\n<hr>\r\n\r\nI've gotten this to work from the AWS console, but I can't do it from terraform.\r\n\r\n### Terraform Version\r\nv0.8.5\r\n\r\n### Affected Resource(s)\r\n- aws_db_instance\r\n\r\n### Terraform Configuration Files\r\n```hcl\r\nresource \"aws_db_instance\" \"prod_rds_rep\" {\r\n  identifier = \"prod-rds-rep\"\r\n  replicate_source_db = \"${aws_db_instance.prod_rds.id}\"\r\n  instance_class = \"db.t2.small\"\r\n  backup_retention_period = 0\r\n  publicly_accessible = true\r\n\r\n  apply_immediately = true\r\n  auto_minor_version_upgrade = true\r\n\r\n  db_subnet_group_name = \"${aws_db_subnet_group.prod_rds_rep_sg.id}\"\r\n}\r\n```\r\n\r\n### Expected Behavior\r\nShould create an RDS instance in a different subnet group from the source db. \r\n\r\n### Actual Behavior\r\n```\r\n1 error(s) occurred:\r\n\r\n* aws_db_instance.prod_rds_rep: Error creating DB Instance: DBSubnetGroupNotAllowedFault: DbSubnetGroupName should not be specified for read replicas that are created in the same region as the master\r\n        status code: 400, request id:\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/comments/384792432","html_url":"https://github.com/terraform-providers/terraform-provider-aws/issues/528#issuecomment-384792432","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/528","id":384792432,"user":{"login":"errriclee","id":55437,"avatar_url":"https://avatars0.githubusercontent.com/u/55437?v=4","gravatar_id":"","url":"https://api.github.com/users/errriclee","html_url":"https://github.com/errriclee","followers_url":"https://api.github.com/users/errriclee/followers","following_url":"https://api.github.com/users/errriclee/following{/other_user}","gists_url":"https://api.github.com/users/errriclee/gists{/gist_id}","starred_url":"https://api.github.com/users/errriclee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/errriclee/subscriptions","organizations_url":"https://api.github.com/users/errriclee/orgs","repos_url":"https://api.github.com/users/errriclee/repos","events_url":"https://api.github.com/users/errriclee/events{/privacy}","received_events_url":"https://api.github.com/users/errriclee/received_events","type":"User","site_admin":false},"created_at":"2018-04-26T21:19:55Z","updated_at":"2018-04-26T21:19:55Z","author_association":"CONTRIBUTOR","body":"I can confirm that you can create replicas in another subnet group using the ARN, at least via API.\r\n\r\nHere's a quick test I did in Ruby:\r\n```ruby\r\nrequire 'aws-sdk'\r\nrequire 'pp'\r\n\r\nclient = Aws::RDS::Client.new\r\nsource_db = \"arn:aws:rds:us-west-2:123456789012:db:my-instance\"\r\nsource_db_subnet_group = \"my-subnets\"\r\ntarget_db_subnet_group =  \"other-subnets\"\r\n\r\nresp = client.create_db_instance_read_replica({\r\n  copy_tags_to_snapshot: true,\r\n  db_instance_class: \"db.m4.large\",\r\n  db_subnet_group_name: target_db_subnet_group,\r\n  db_instance_identifier: \"mytest\",\r\n  publicly_accessible: false,\r\n  source_db_instance_identifier: source_db,\r\n  storage_type: \"gp2\"\r\n})\r\n\r\npp resp\r\n```\r\nI have not tried with Terraform yet, but I was getting the same error as I received earlier from Terraform when I only specified the identifier, not the ARN. I was given this resolution by AWS Support."}}
{"actor":{"display_login":"errriclee"}}