[Backend] Send namespace-level audit events to S3 destination
Description
Send namespace level audit events for namespaces that have configured audit_events_amazon_s3_configurations
.
Proposal
- Create streamable strategy similar to
GoogleCloudLoggingDestinationStrategy
. - POC code for sending an event to S3.
# Do not use this in production, only for reference
audit_event = JSON.parse(json_event)
credentials = Aws::Credentials.new('<access_key_id>', '<secret_access_key>')
s3 = Aws::S3::Client.new(region: '<region>', credentials: credentials)
key = "#{audit_event['entity_type']}/#{audit_event['id']}-#{Time.now.to_f}.json"
s3.put_object(body: audit_event.to_json, bucket: BUCKET, key: key)
Edited by Huzaifa Iftikhar