- Lab
- A Cloud Guru
Working with VPC Flow Logs for Network Monitoring in AWS
This hands-on lab gives you the opportunity to work with VPC Flow Logs. It will teach various ways to review VPC Flow Logs and monitor networks. A common way people evaluate VPC Flow Logs is by sending them to CloudWatch. Once they're in CloudWatch, people can create metrics, then set alarms based on those metrics. Additionally, it's possible to export CloudWatch Logs to S3. In fact, it's possible to export VPC Flow Logs directly to S3. The advantages of this are cost savings and ease of use. In this hands-on lab, we will go through the process of exporting VPC Flow Logs to S3, as well as use Amazon Athena to query those Flow Logs.
Path Info
Table of Contents
-
Challenge
Create an S3 Bucket
- Navigate to S3.
- Click Create Bucket.
- Give the bucket a unique name (e.g., "vpcflow4learningactivity" and a series of numbers at the end, like the account ID of the AWS account provisioned with the lab, to make it globally unique).
- Click Next three times.
- Click Create Bucket.
- Click to open your newly created bucket.
- Click Create folder.
- In the box next to the folder, enter "AWSLogs".
- Click Save.
- Click Create folder.
- In the box next to the folder, enter "QueryResults".
- Click Save.
-
Challenge
Configure VPC Flow Logs
- Navigate to VPC > Your VPCs.
- Select the
LinuxAcademy
VPC. - Click Actions > Create flow log.
- Set the following values:
- Filter: All
- Destination: Send to an S3 bucket
- S3 bucket ARN:
arn:aws:s3:::<YOUR_BUCKET_NAME>
- Click Create.
- Click the Flow Logs tab to verify the flow log exists.
-
Challenge
Create and Query a Sample Table in Amazon Athena
- In Athena, specify the QueryResults folder in the S3 bucket as the query results location.
- Use the Athena tutorial to create a sample table.
- Run a
select * from
query on the table. - Edit the query by replacing
*
withrequest_ip
and run it again.
-
Challenge
Configure and Query the VPC Flow Logs
- In S3, verify that logs have populated the AWSLogs folder in the vpcflow4learningactivity bucket.
- In Athena, run the scripts provided on the lab page.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.