On March 4th, 2025, AWS added support for CloudWatch log live tail for Lambda in VS Code.
Keep in consideration that CloudWatch live tail is not a new feature, however, tailing this log in VS Code for a selected Lambda function is the new feature added!
In this article, I will demonstrate the steps required to configure and use the CloudWatch live tail feature in VS Code.
Let's look at the diagram!
Introduction to Live Tail for Lambda in VS Code
On March 4, 2025, AWS announced support for Live Tail for Lambda in VS Code. This feature allows developers to monitor function execution in real time. Since an IDE is where the code resides, having the ability to view logs without leaving the IDE is a productivity-enhancing capability. This feature improves debugging support and enhances overall development efficiency.
Install AWS Toolkit for VS Code
AWS tool kit is a VS Code extension. This tool kit supports many features like connecting with AWS account and services like S3, Lambda and others. I will first configure this toolkit.
To configure AWS tool kit:
- Start VS Code IDE
- Navigate to the Extension Marketplace
- Look for AWS Toolkit and install it
- Once this extension is installed configure the extension by adding AWS credential
Connect VS Code to AWS
If this is your first time setting up the AWS Toolkit, you need to select a profile to connect to your AWS account.
- Click on the AWS icon and select Connect to AWS.
- Choose your AWS profile.
- Ensure the correct AWS Region is selected for your Lambda function.
Enable Live Log Tail
Let's enable Live Log Tail.
- In VS Code, navigate to the AWS Explorer.
- Locate your AWS Lambda function.
- Right-click the function and select Tail logs.
- Provide a pattern to filter the logs or press Enter to tail all logs.
- This will start streaming logs directly from Amazon CloudWatch into VS Code.
Validate Live Log Tail
Now that we have connectivity and Live Tail streaming enabled, let's validate it by invoking a Lambda function that will publish logs to CloudWatch Logs.
aws lambda invoke --function-name helloworldgb --region us-east-2
Observe the logs in Live Tail and check for logging, errors, and other relevant details to confirm that the function is working as expected.
I will provide a JSON payload so that function invocation is successful.
Conclusion
In this article, I demonstrated how to configure CloudWatch Live Tail Logs for an AWS Lambda function in VS Code.
AWS Lambda's Live Log Tail in VS Code provides an efficient way to monitor and debug Lambda functions in real time, directly from the VS Code IDE. Try setting up Live Log Tail today and experience real-time insights right in VS Code!
I hope you found this article both helpful and informative!
Thank you for reading!
Watch the video here:
https://www.youtube.com/watch?v=Wc1zkn5NnpU
π’πΎππΎππ½ β¬π½πΆππΎπΆ
πππ ππ¦π³π΅πͺπ§πͺπ¦π₯ ππ°ππΆπ΅πͺπ°π― ππ³π€π©πͺπ΅π¦π€π΅ & ππ¦π·π¦ππ°π±π¦π³ ππ΄π΄π°π€πͺπ’π΅π¦
πππ°πΆπ₯ ππ¦π€π©π―π°ππ°π¨πΊ ππ―π΅π©πΆπ΄πͺπ’π΄π΅
Top comments (0)