AWS - VPC Flow Logs

 

In this post, We will see what is a VPC flow log and how to capture the same for an EC2 instance.

VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. 

Flow log data can be published to the following locations: Amazon CloudWatch Logs, Amazon S3, or Amazon Kinesis Data Firehose. After you create a flow log, you can retrieve and view the flow log records in the log group, bucket, or delivery stream that you configured.

I have an EC2 instance running HTTP delivering static content on port 80.


Next, I am going to create a cloud watch log group which will be the destination for VPC flow logs.



Next, we need to create an IAM role to allow the VPC flow log service to create log stream and we attach that IAM role to the flow log service while capturing VPC flow logs.




We are done with creating an IAM role with the required policy. Let’s proceed with VPC flow log capture. Select the EC2 network interface -> Create Flow Log.




We are capturing ALL TRAFFIC with intervals of 10 mins. So, We need to wait for 10 minutes for data to populate in the Cloudwatch.

After 10 mins you should see the VPC flow logs under Cloudwatch -> log group.








Comments

Post a Comment

Popular posts from this blog

SRE/DevOps Syllabus

AWS Code Commit - CI/CD Series Part 1

Docker - Preventing IP overlapping