Step 1: Prepare
In this section you do the following:
Sign up for an AWS account and set up the AWS CLI.
Turn on CloudTrail in your account.
Create an SNS topic and subscribe to it.
Follow the steps in the following sections to walk through the setup process.
In this tutorial, we assume that you are setting the resources in the
Step 1.1: Sign Up for AWS and Set Up the AWS CLI
Make sure you have completed the following steps:
Signed up for an AWS account and created an administrator user in the account (called adminuser).
Installed and set up the AWS CLI.
For instructions, see Step 1: Set Up an AWS Account and the AWS CLI.
Step 1.2: Turn on CloudTrail
In the AWS CloudTrail console, turn on the trail in your account by specifying
examplebucket in the
region for CloudTrail to save logs. When configuring the trail, do not enable SNS
For instructions, see Creating and Updating Your Trail in the AWS CloudTrail User Guide.
Although you turn CloudTrail on now, you do not perform any additional configuration for your Lambda function to process the real CloudTrail logs in the first half of this exercise. Instead, you will use sample CloudTrail log objects (that you will upload) and sample S3 events to manually invoke and test your Lambda function. In the second half of this tutorial, you perform additional configuration steps that enable your Lambda function to process the CloudTrail logs.
Step 1.3: Create an SNS Topic and Subscribe to the Topic
Follow the procedure to create an SNS topic in the
region and subscribe to it by providing an email address as the endpoint.
To create and subscribe to a topic
Create an SNS topic.
For instructions, see Create a Topic in the Amazon Simple Notification Service Developer Guide.
Subscribe to the topic by providing an email address as the endpoint.
For instructions, see Subscribe to a Topic in the Amazon Simple Notification Service Developer Guide.
Note down the topic ARN. You will need the value in the following sections.