Helper method for legacy audit event destinations to create stream destinations
What does this MR do and why?
This MR adds a helper module for our audit events destinations graphql create APIs:
- When a legacy audit event destination is created -> it creates a stream destination model and associates them via their
stream_destination_id
andlegacy_destination_ref
columns- When a new streaming model is created, then a legacy audit event destination model is created in the same fashion. - This is all under the feature flag:
audit_events_external_destination_streamer_consolidation_refactor
via http://localhost:3000/rails/features/ or rails console. -
❗ Once the stream destinations tables (new) are all migrated and fully in use, all of this code will be removed along with the legacy API routes.
Going to separate Create / Updates / Delete into separate MRs
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Models:
- HTTP: AuditEvents::InstanceExternalAuditEventDestination, AuditEvents::ExternalAuditEventDestination
- AWS: AuditEvents::Instance::AmazonS3Configuration, AuditEvents::AmazonS3Configuration
- GCP: AuditEvents::Instance::GoogleCloudLoggingConfiguration, AuditEvents:GoogleCloudLoggingConfiguration
New models:
AuditEvents::Group::ExternalStreamingDestination & AuditEvents::Instance::ExternalStreamingDestination
which have a category column of http
, gcp
, or aws
; and a json column called config
that stores category specific attributes.
FYI: There is no UI component to create the 'new' streaming models yet, as such, we can only use the GraphQL API.
How to set up and validate locally
There is no caller for the helper method but you can create the models through gdk rails c
and call the methods.
The creation is handled through !175753