Skip to content

Worker for AWS audit event destination migrations

What does this MR do and why?

Adds a worker helper, and a worker implementation to migrate audit event destinations from legacy tables to new tables.

Legacy tables:

  • audit_events_amazon_s3_configurations
  • audit_events_instance_amazon_s3_configurations

New tables:

  • audit_events_group_external_streaming_destinations
  • audit_events_instance_external_streaming_destinations

The helper is from:

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

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  • Open rails console
  • Create a few rows in audit_events_amazon_s3_configurations and audit_events_instance_amazon_s3_configurations tables
  • Run the worker http://127.0.0.1:3000/admin/sidekiq/cron (search hint: migrate_aws_destinations_worker)
  • Check the audit_events_group_external_streaming_destinations and audit_events_instance_external_streaming_destinations tables; there should be no rows with the equivalent data created
  • Enable feature flag: audit_events_external_destination_streamer_consolidation_refactor
  • Run the worker again
  • Check the tables again; there should be rows with the equivalent data created and mapped by ID (legacy_destination_ref)
  • The old table rows should now have a stream_destination_id that maps to the newly created row.
Edited by SAM FIGUEROA

Merge request reports

Loading