centralize logging related terraform config
The current state is that the logging related infra is managed in many different parts of the terraform codebase, e.g.:
- https://ops.gitlab.net/gitlab-com/gl-infra/terraform-modules/google/pubsubbeat/-/blob/master/topics.tf#L11
- https://ops.gitlab.net/gitlab-com/gitlab-com-infrastructure/-/blob/master/environments/gstg/main.tf#L65
- https://ops.gitlab.net/gitlab-com/gitlab-com-infrastructure/-/blob/master/environments/gstg/main.tf#L1434
- https://ops.gitlab.net/gitlab-com/gl-infra/terraform-modules/google/storage-buckets/blob/master/main.tf#L14
- https://ops.gitlab.net/gitlab-com/gl-infra/terraform-modules/google/stackdriver/-/blob/master/log-exclusions.tf#L10
and part of the config is either deprecated or was never needed, e.g.:
It seems that the initial intention was to split this code by cloud provider component, but it has organically grown since then and this division has faded away over time, for example IAM config or Stackdrivers sinks are defined and configured in multiple different places.
The purpose of this issue is to:
- think about how this approach fits with the larger tf codebase (do we want to continue to structure our code this way?)
- consider sticking with the current approach (splitting the code by GCP component) and clean up logging related code
- consider switching to "infrastructure service" centric division (e.g. tf module for logging which would contain stackdriver sinks, pubsub topics, workload identity service accounts for accessing pubsub)