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

`task` configurable logs via hooks via heredoc

Open DavidGOrtega opened this issue 2 years ago • 4 comments

Once #392 is achieved we should be able to freely configure the logs output via hooks. The could have a logging property that would allow us the register the hooks using heredoc.

logging {
  hooks {
   ...
}
}

DavidGOrtega avatar Feb 10 '22 15:02 DavidGOrtega

Did you mean a nested block instead of heredoc by chance?

0x2b3bfa0 avatar Feb 11 '22 11:02 0x2b3bfa0

Hooks can't be added dynamically; they have to be present at compile time. I guess that you want to let users selectively enable and configure some of the hooks we choose to ship with our binaries? E.g. Amazon Web Services CloudWatch, Microsoft Azure Monitor, or Google Cloud Logging as suggested on this thread.

0x2b3bfa0 avatar Feb 11 '22 11:02 0x2b3bfa0

Yes, adding a bunch of preferred hooks

Did you mean a nested block instead of heredoc by chance?

Depends, if there is already a way to to write a config file for the hook we could avoid doing the mapping. I.E. lest suppose that the hook Elasticsearch is like this:

config file

nodes:
192.168.1.1

we could add this as heredoc

DavidGOrtega avatar Feb 14 '22 15:02 DavidGOrtega

It's probaby going to look like this:

resource "iterative_task" example {
  ···
  logs {
    syslog = {
      protocol = "udp",
      address = "127.0.0.1",
      priority = "info"
      tag = "test",
    }
  }
}

Anyway, let's focus on #392 first.

0x2b3bfa0 avatar Feb 15 '22 00:02 0x2b3bfa0