terraform-provider-postgresql icon indicating copy to clipboard operation
terraform-provider-postgresql copied to clipboard

Add event trigger resource management

Open Fabianoshz opened this issue 1 year ago • 5 comments

I'm opening this as a draft in case anyone wants to give feedback or test the code.

This should allow us to manage event triggers in this provider, here's how the resource would look like:

resource "postgresql_event_trigger" "event_trigger" {
  name = "event_trigger_test"

  database = postgresql_database.database.name
  schema = postgresql_schema.schema.name

  function = postgresql_function.function.name
  on = "ddl_command_end"

  owner = "postgres"

  status = "enable"

  filter {
    variable = "TAG"
    values = [
      "CREATE TABLE",
      "ALTER TABLE",
    ]
  }
}

Closes #398

Fabianoshz avatar Aug 22 '24 18:08 Fabianoshz

@cyrilgdn I've used this to add a few hundred event triggers where I work, our fork has a few more commits with some fixes of things that we found after opening the PR, I can push the fixes to this branch but it's not clear to me if you're interested in that, let me know either way.

Fabianoshz avatar Oct 15 '24 20:10 Fabianoshz

Hi @Fabianoshz ,

Thanks for your work and for opening this PR, I'm interested yes, I'm just lacking a bit of time to review it properly but will have a look as soon as possible 👍

cyrilgdn avatar Oct 16 '24 07:10 cyrilgdn

Perfect, I take some time this week to push the other fixes we've added on our fork

Fabianoshz avatar Oct 16 '24 12:10 Fabianoshz

@cyrilgdn thanks for throughout review, I will start working on fixing in the next few days

Fabianoshz avatar Oct 22 '24 16:10 Fabianoshz

My organization would also benefit from this feature! @Fabianoshz really appreciate your contribution here. @cyrilgdn please let me know if I can help in any way to get this feature in!

Temurson avatar Jan 24 '25 18:01 Temurson

This would be very nice to have in provider! It would benefit me too.

retrry avatar May 07 '25 12:05 retrry