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

Added support for setting transaction_log_retention_days, retained_backups, and retention_unit to backup_configuration. #203

Conversation

tjokimie
Copy link
Contributor

Add support for transaction_log_retention_days and backup_retention_settings.

Closes #199.

@morgante
Copy link
Contributor

Please check the contributing guide and ensure tests pass: https://github.com/terraform-google-modules/terraform-google-sql-db/blob/master/CONTRIBUTING.md

@schirayu
Copy link

schirayu commented Apr 6, 2021

@tjokimie - are you still working on this PR?

@waqas105
Copy link

Anyupdate on this request? i tried the code not wokring for me.

@morgante
Copy link
Contributor

@waqas105 The PR needs to be rebased and edited to make sure tests pass.

@spezam spezam mentioned this pull request May 31, 2021
@tjokimie tjokimie force-pushed the tjokimie/support-retention-fields branch from d6082b6 to 5d4d6e3 Compare June 8, 2021 11:02
@comment-bot-dev
Copy link

comment-bot-dev commented Jun 8, 2021

Thanks for the PR! 🚀
✅ Lint checks have passed.

@tjokimie
Copy link
Contributor Author

tjokimie commented Jun 8, 2021

@waqas105 The PR needs to be rebased and edited to make sure tests pass.

@morgante Sorry, finishing this took quite a bit longer than I anticipated. I fixed the issue, rebased the PR, updated the examples and added some tests.

I run the tests locally but I couldn't figure out what triggered this one to fail. All the other tests are passing.

×  Postgres SQL pubic instance has just one assigned IP address

     expected: 1
          got: 2

     (compared using ==)

The ipAddresses block seems to be [{"ipAddress"=>"34.134.242.179", "type"=>"PRIMARY"}, {"ipAddress"=>"35.239.168.247", "type"=>"OUTGOING"}] so there is additional OUTGOING IP address added. Do you have any ideas what could cause this?

@tjokimie tjokimie force-pushed the tjokimie/support-retention-fields branch from 6c90d99 to 913f003 Compare June 8, 2021 14:39
@morgante
Copy link
Contributor

morgante commented Jun 8, 2021

/gcbrun

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

Thanks for the rebase and apologies for the churn. You can ignore the test failure as it looks unrelated.

@@ -81,6 +81,11 @@ module "pg" {
start_time = "20:55"
location = null
point_in_time_recovery_enabled = false
transaction_log_retention_days = null
backup_retention_settings = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to nest this. Let's just collapse to the backup_configuration level:

backup_configuration = {
    enabled                        = true
    start_time                     = "20:55"
    location                       = null
    point_in_time_recovery_enabled = false
    transaction_log_retention_days = null
    retained_backups = 365
    retention_unit = "COUNT"
}

Copy link
Contributor Author

@tjokimie tjokimie Jun 10, 2021

Choose a reason for hiding this comment

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

@morgante Good idea, updated in e89c589 👍

@tjokimie tjokimie force-pushed the tjokimie/support-retention-fields branch from 8676fba to b28b835 Compare June 10, 2021 08:03
@tjokimie tjokimie requested a review from morgante June 10, 2021 08:40
@tjokimie tjokimie force-pushed the tjokimie/support-retention-fields branch from b28b835 to e89c589 Compare June 10, 2021 08:41
@tjokimie
Copy link
Contributor Author

Rebased with master again.

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

Thanks, test failure is unrelated.

@morgante morgante changed the title Support transaction_log_retention_days and backup_retention_settings fields Added support for setting transaction_log_retention_days, retained_backups, and retention_unit to backup_configuration. Jun 10, 2021
@morgante morgante merged commit 2237a3d into terraform-google-modules:master Jun 10, 2021
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.

Support backup retention fields
5 participants