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

Adding replicate_source_db variable to support read_replica #62

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

poornima-krishnasamy
Copy link
Contributor

Related to: ministryofjustice/cloud-platform#1859

Variable db_identifier and skip_final_snapshot can now be changed when using this module

Creating read replica db instance doesnot require several variables to be passed when creating RDS instance such as aws_kms_key, db_subnet_group, DB username and DB password.

For read replica, final_snapshot_identifier has to be null as there are no snapshots created for read replica.
Variable skip_final_snapshot has to be set to true for read replica. For normal RDS instance, it is set to false(default)

ca_cert_identifier is not set explicitly as this causes read replica to reboot and not-ready state. Related to: hashicorp/terraform-provider-aws#11905
All the users of this module have set to default rds-ca-2019. So no users use old certificate.

name = "rds-snapshots-user-${random_id.id.hex}"
path = "/system/rds-snapshots-user/"
}

resource "aws_iam_access_key" "user" {
user = aws_iam_user.user.name
count = var.replicate_source_db != "" ? 0 : 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do it like count = var.replicate_source_db ? 1 : 0, it is more neat.

@poornima-krishnasamy poornima-krishnasamy merged commit 222db38 into master Jun 18, 2020
@poornima-krishnasamy poornima-krishnasamy deleted the read-replica branch June 18, 2020 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants