Automating EC2 Session Log Analysis Using Amazon Bedrock

Automating EC2 Session Log Analysis Using Amazon Bedrock
Automating EC2 Session Log Analysis Using Amazon Bedrock

CLOUD LABS



Automating EC2 Session Log Analysis Using Amazon Bedrock

In this Cloud Lab, you’ll learn to automate operational visibility in AWS by building an AI-powered system that summarizes Session Manager activity logs with contextual security insights.

10 Tasks

intermediate

1hr 30m

Certificate of Completion

Desktop OnlyDevice is not compatible.
No Setup Required
Amazon Web Services

Learning Objectives

A solid understanding of integrating Session Manager logging with S3 and SNS
Hands-on experience enriching security insights by correlating logs with CloudTrail metadata
The ability to automate operational visibility and detect potentially risky EC2 access behavior
The ability to perform intelligent log analysis using Amazon Bedrock to summarize activity and highlight anomalies

Technologies
Bedrock
EC2 logoEC2
Systems Manager
CloudTrail
Cloud Lab Overview

Managing operational activity across EC2 instances can be challenging, especially when multiple administrators use the AWS Systems Manager Session Manager tool for remote access. While Session Manager provides secure and auditable connections, manually reviewing session logs to identify user actions, detect anomalies, or summarize activity can be time-consuming and prone to error. This is where generative AI (GenAI) can help, by automatically analyzing session activity and turning raw operational data into clear, actionable insights.

In this Cloud Lab, you’ll build a GenAI-powered log analysis pipeline that automatically summarizes AWS Session Manager activity logs. You’ll begin by creating IAM roles and an EC2 instance configured with Session Manager logging, where each session’s logs will be stored in an S3 bucket, forming the foundation of your automated analysis workflow. Next, you’ll create an SNS topic for notifications and a Lambda function triggered whenever a new session log is uploaded to S3.

The function will read the log contents, use a Bedrock model to analyze the session, and publish an AI-generated summary to the SNS topic, providing you with instant insights directly in your inbox. Finally, you’ll enhance the workflow by integrating AWS CloudTrail, allowing the Lambda function to identify which IAM user initiated the session, from which IP address, and on which instance, adding rich, audit-ready context to your AI-powered summaries.

After completing this Cloud Lab, you’ll understand how to build an end-to-end intelligent log analysis system powered by GenAI. You’ll gain hands-on experience in automating operational visibility, providing a practical foundation for creating secure, auditable, and insight-driven workflows in the cloud.

The following is the high-level architecture diagram of the infrastructure you’ll create in this Cloud Lab:

LLM-powered session activity monitoring
LLM-powered session activity monitoring
svg viewer
Cloud Lab Tasks
1.Introduction
Getting Started
2.Setting the Stage
Provision the Required IAM Roles
Configure Session Manager Logging
Launch an EC2 Instance with Session Manager Access
3.Building the Intelligent Pipeline
Create an SNS Topic for AI Notifications
Create and Configure a Lambda Function
Complete and Test the AI-Powered Log Analysis Pipeline
Enhance the Pipeline with CloudTrail Integration
4.Conclusion
Clean Up
Wrap Up
Labs Rules Apply
Stay within resource usage requirements.
Do not engage in cryptocurrency mining.
Do not engage in or encourage activity that is illegal.

Relevant Courses

Use the following content to review prerequisites or explore specific concepts in detail.

Hear what others have to say
Join 1.4 million developers working at companies like