AC Legacy Log Synchronization
Following diagram summarizes the process synchronizing AC access log from COMPANY AC system to WorksAudit central bucket:
Referring to the diagram above, the process can be explained as follows:
- There is an EventBridge rule
wap-audit-lambda-data-ec2-scheduler-cw-event-rule-{env}
that will trigger a lambdawap-audit-lambda-data-ec2-scheduler-{env}
every hour. This lambda source code is here. - The lambda checks following environment variables to query EC2 instances that should be started (if any):
target_ec2_instances_tag_key
target_ec2_instances_tag_value
- For example, if
target_ec2_instances_tag_key=group
andtarget_ec2_instances_tag_value=ac-log-sync-instances
, all EC2 instances that is has taggroup=ac-log-sync-instances
will be started. - The EC2 instances for this operation will have some other tags for specifying how the synchronizer should behave (e.g. which AC server to use).
- Once the EC2 instance is started a local NodeJS script will be started with the logic as shown above.
- This script invokes two Ruby scripts provided by AC team to access AC service.