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

Database flags in the secondary cluster getting removed by Terraform #97

Open
shubhamoli opened this issue Aug 14, 2024 · 6 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@shubhamoli
Copy link

Hi Team,

We're using this module to provision a primary and a secondary AlloyDB cluster. Everything works well but we're facing a weird issue with DB flags in the secondary cluster. These flags are replicated into secondary from the primary but a subsequent Terraform apply is trying to remove them from the secondary cluster. I believe this is expected from the Terraform's side because DB flags were never part of the its state for the secondary cluster.

Here is the plan

// us-west1 is our secondary cluster

# module.alloydb["us-west1"].module.this.google_alloydb_instance.primary will be updated in-place
  ~ resource "google_alloydb_instance" "primary" {
      ~ database_flags        = {
          - "alloydb.enable_pgaudit"     = "on" -> null
          - "alloydb.iam_authentication" = "on" -> null
          - "log_connections"            = "on" -> null
          - "log_disconnections"         = "on" -> null
          - "log_replication_commands"   = "on" -> null
          - "log_statement"              = "all" -> null
          - "log_timezone"               = "CET" -> null
          - "pgaudit.log"                = "ddl,write" -> null
        }
        # (20 unchanged attributes hidden)
        # (3 unchanged blocks hidden)
    }

TF version - Terraform v1.9.0
Module version - ~> 2.0

Are we doing something wrong here? Any help or pointers will be highly appreciated. Thanks in advance.

@sophomeric
Copy link

Bueller? Bueller? Anyone?

@imrannayer
Copy link
Member

@shubhamoli have u tried adding those flags in your secondary cluster code?

@shubhamoli
Copy link
Author

Hi @imrannayer Yes we tried setting those flags in our secondary cluster but then terraform apply failed with something like.

Setting database flags in the secondary cluster is not allowed (It's not the exact error message)

@imrannayer
Copy link
Member

@shubhamoli I will investigate

@imrannayer imrannayer self-assigned this Oct 4, 2024
@imrannayer imrannayer added the bug Something isn't working label Oct 4, 2024
@sophomeric
Copy link

@shubhamoli I will investigate

Any findings to share?

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants