AWS-Logo_White-Color
1.
Introduction
2.
Preparation Steps
2.1
Create VPC and Network Components
2.1.1
Create VPC
2.1.2
Create Public Subnet
2.1.3
Create Internet Gateway & Route Table
2.1.4
Create Security Groups
2.2
Create Key Pair and Launch EC2 Instance
2.2.1
Key Pair
2.2.2
EC2
3.
Set Up Audit Automation
3.1.
IAM Role for Lambda
3.3.
Deploy Lambda via AWS CLI or Console
4.
Implementing Immutable Logging with (AWS S3)
5.
Analyze Trail with Amazon OpenSearch Service
6.
Compliance Reporting with Athena
7.
Investigation Tools with Amazon QuickSight
8.
Monitoring & Alerts with Amazon CloudWatch
9.
Operational Procedures
10.
Legal Coordination with AWS Artifact
11.
Clean Resources
More
AWS Study Group
English
Tiếng Việt
Clear History
Workshop
Cloud Journey
Last Updated
08-08-2025
Team
Hiếu Minh
Audit Trail Management
>
Set Up Audit Automation
> Deploy Lambda via AWS CLI or Console
Deploy Lambda via AWS CLI or Console
Create an AWS Lambda Function
Via Console:
AWS Console
: navigate to
Lambda
→
Functions
→
Create function
.
Function name:
AuditLoggerDemo
Runtime:
Python 3.9
Architecture:
x86_64
Permissions: Open
Change default execution role
→ Select
Use an existing role
->
AuditLoggerLambdaRole
.
Click
Create function
.
On the new function page:
Code Source:
Select
Upload from
→
.zip file.
Upload the
function.zip
file (containing audit_logger.py).
Deploy the code.
Test event
In the
Test
tab
Set
Event name
:
TestLogin
Paste the JSON: {“user”:“hocsinh1”,“action”:“login”,“timestamp”:“2025-07-27T12:00:00Z”}
Run the Function
With the
TestLogin
event selected, click Test.
The execution result will be displayed below:
Configure CloudWatch Logs
Check the Log Group.
Console > CloudWatch > Logs > Log groups >
/aws/lambda/AuditLoggerDemo
.
Each invocation will create a new log stream.
Create Metric Filter (…)