Difference between revisions of "Create script for AWS Lambda to migrate old VPC flow logs"

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
(Created page with "__TOC__ = Create the AWS Lambda function = = Configure the AWS Lambda function =")
 
Line 1: Line 1:
 
__TOC__
 
__TOC__
 +
 +
This procedure makes use of a JS script and the AWS Lambdas to automatically migrate data from your live bucket (the one that collects your VPC flow logs) to an archive bucket (a bucket that will receive the old flow files using the script).
 +
This script will let you move or delete old VPC flow logs as required by your organization. To do this, you will use an AWS Lambda script with the Node.js 16 JavaScript engine.
 +
You will then set this script to run every hour using the instructions below. If you have more than 1000 new flow logs pre hour, then you may want to increase this execution rate, as only 1000 files will be processed in each run.
 +
Before you proceed make sure that you have the correct AWS permissions to perform the following actions:
 +
* Create Lambdas.
 +
* Access S3 buckets.
 +
* Change the Lambda execution policies.
 +
You will also need to create an S3 bucket to receive the archived flow logs.
 
= Create the AWS Lambda function =
 
= Create the AWS Lambda function =
  

Revision as of 18:21, 17 April 2024

Contents


This procedure makes use of a JS script and the AWS Lambdas to automatically migrate data from your live bucket (the one that collects your VPC flow logs) to an archive bucket (a bucket that will receive the old flow files using the script). This script will let you move or delete old VPC flow logs as required by your organization. To do this, you will use an AWS Lambda script with the Node.js 16 JavaScript engine. You will then set this script to run every hour using the instructions below. If you have more than 1000 new flow logs pre hour, then you may want to increase this execution rate, as only 1000 files will be processed in each run. Before you proceed make sure that you have the correct AWS permissions to perform the following actions:

  • Create Lambdas.
  • Access S3 buckets.
  • Change the Lambda execution policies.

You will also need to create an S3 bucket to receive the archived flow logs.

Create the AWS Lambda function

Configure the AWS Lambda function