-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
RDS cross-region read replica placed in wrong VPC (MySQL 5.6) #4192
Comments
Hey @nTraum thanks for writing in – I don't think I need any more information, I can see the issue(s) in the code now that you point this out. I'll see about getting a patch in... |
Fwiw, the patch for this should be as simple as adding It's not well documented on the AWS API Documentation on the web (that I found), but the SDK explains it like so: // Specifies a DB subnet group for the DB instance. The new DB instance will
// be created in the VPC associated with the DB subnet group. If no DB subnet
// group is specified, then the new DB instance is not created in a VPC.
//
// Constraints:
//
// Can only be specified if the source DB instance identifier specifies a
// DB instance in another region. The specified DB subnet group must be in the
// same region in which the operation is running. All Read Replicas in one
// region that are created from the same source DB instance must either: Specify
// DB subnet groups from the same VPC. All these Read Replicas will be created
// in the same VPC.Not specify a DB subnet group. All these Read Replicas will
// be created outside of any VPC. |
Thanks for the quick reply and the detailed explanation @catsby, appreciate it! |
Fixes hashicorp#4192 by honouringthe `db_subnet_group_name` parameter when creating a cross-region read replica.
Fixes hashicorp#4192 by honouring the `db_subnet_group_name` parameter when creating a cross-region read replica.
Fixes hashicorp#4192 by honouring the `db_subnet_group_name` parameter when creating a cross-region read replica.
I can confirm that adding |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I'm currently trying to set up a cross-region read replica for a MySQL 5.6 RDS cluster via terraform v0.8.6.
As stated in the AWS docs, this can be done by specifying the ARN of the source database:
Running
terraform plan
shows the desired output (correct security groups etc).Terraform does create the read replica successfully when applying, but always places it in the default VPC (instead of the one specified).
Interestingly enough, this only happens when the
replicate_source_db
parameter is set. Without, the resource gets placed in the correct VPC (incl. correct security groups).A consecutive
terraform plan
afterwards shows a recreation of that read replica to assign the correctdb_subnet_group_name
to it (default ones are chosen instead).I'm fairly (TM) certain this is a bug in terraform. If I create the read replica via AWS' web console, it works.
What would be the most useful information for you / us to debug this? Providing a minimum 'failing' example would be quite some work as this is read replica is part of a reasonably sized stack. Would running it with
TF_DEBUG
produce useful output? If so, at which level?The text was updated successfully, but these errors were encountered: