Enable VPC Flow Logs

Central AWS Account: AWS account which you want to designate for storing VPC Flow Logs centrally. This account will also contain Athena DB, table and QuickSight Dashboard.

Additional Accounts: These are other accounts that you own and has VPCs that you wish to enable Flow Logs and have an ability to push it to Central AWS Account’s S3 bucket.

QuickSight: To manage VPC Flow Logs and QuickSight dashboard in central account please make sure you create resources for the central account in the region supported by QuickSight. Refer to this link to see supported regions.

VPC

If you already have VPC and other resources running your AWS account continue with next section “Enable VPC Flow Logs” otherwise click on below link to deploy VPC and a toy webapp into your account.

Click here for instructions how to deploy a VPC to your AWS account:

Enable VPC Flow Logs

QuickSight dashboard provided in this lab requires all the fields mentioned in the Introduction section are required. If you already have enabled VPC Flow logs with those fields (with CSV format, Hive partition enabled and delivered to S3) then you can skip this section and proceed to "Create Athena resources, Lambda function and CloudWatch rule" section to continue. If you do not have VPC flow logs enabled or existing VPC Flow logs does not have all the required fields then this section will help you in enabling vpc flow logs for existing VPC(s) in your account. Repeat all the steps from this section for each VPC in case you want to enable VPC Flow logs in respective account to visualize them in QuickSight dashboard under central account.

Parquet file format

Click here for the instructions for enabling VPC Flow Logs in Parquet format
   

CSV file format

Click here for the instructions for enabling VPC Flow Logs in CSV format
  • To verify, navigate to VPC service, click on vpc link and then click on Flow Logs tab at the bottom part of the screen. You will see a line with flow logs you just created now. Images/quicksight_dashboard_dt-7.png

Delete older VPC Flow Logs from S3 bucket (Optional)

We recommend you to create a life cycle policy to delete logs older than 90 days or lesser as per your requirement to save cost. All the steps from this section are required to execute one time in central account.

  • Click here to see the steps to Delete older VPC Flow Logs from S3 bucket

Enable VPC Flow Logs in additional accounts and store it in central bucket (Optional)

  • Click here to see the steps to enable VPC Flow logs in additional accounts