Amazon Mobile Analytics
User Guide

Part 3: Create and Configure an Amazon EC2 Loader Instance


After April 30, 2018, Amazon Mobile Analytics features will be provided only by Amazon Pinpoint. If you're new to Mobile Analytics, use Amazon Pinpoint instead. If you're currently using Mobile Analytics, see Migrating from Amazon Mobile Analytics to Amazon Pinpoint.

After gathering the details on your Amazon Redshift cluster, you must create and configure your Amazon EC2 loader instance.

  1. Open the Amazon EC2 console at

  2. Ensure that you have created a key pair.

							Creating a key pair from the Amazon EC2 console.
  3. Name the key pair.

							Naming a key pair in the Amazon EC2 console.
  4. Download the credentials for the key pair.

							Signature of a key pair in the Amazon EC2 console.
  5. Choose Instances from the Amazon EC2 console navigation. Then choose Launch Instance and choose Amazon Linux AMI from the list of available AMIs.

							Launching an Amazon Linux AMI in the Amazon EC2 console.
  6. Choose the t2.micro instance type.

							Selecting the t2micro instance type in the Amazon EC2 console.
  7. Configure your new Amazon EC2 loader instance. Choose a VPC, ideally the VPC you set up in Part 2: Gather Details About the Amazon Redshift Cluster. Choose Enable from the Auto-assign Public IP list. Choose the IAM role you created in Part 1: Configure Security Roles for Auto Export to Amazon Redshift.

							Configuring a new Amazon EC2 loader instance in the Amazon EC2 console.
  8. Expand Advanced Details and then copy and paste the following text into the User data section:

    #!/bin/bash # Log data to: /var/log/syslog, /var/log/user-data.log, and console output exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 DataExportDir=/home/ec2-user/DataExport yum -y update yum -y install python-pip yum -y install python27 pip install virtualenv virtualenv --python=/usr/bin/python27 $DataExportDir chown -R ec2-user:ec2-user $DataExportDir/ $DataExportDir/bin/pip install -r mkdir $DataExportDir/logs chown -R ec2-user:ec2-user $DataExportDir/ # Get the CloudWatch Logs agent wget
							Configuring a new Amazon EC2 loader instance in the Amazon EC2 console.
  9. On Add Storage and Tag Instance tabs, choose Next, accepting their default settings.

  10. On the Configure Security Group tab, configure the Security Group CIDR rule to let your IP addresses connect to the Amazon EC2 instance on port 22. You can use an existing security group instead or change the Source to permit your IP address only.

							Configuring the Security Group CIDR rule in the Amazon EC2 console.
  11. Choose Review and Launch the Amazon EC2 instance.

  12. For Select a key pair, choose the key pair you created previously.

							Selecting the key pair to use in the Amazon EC2 console for launching a loader for Amazon Redshift.
  13. Choose Launch Instances.

  14. After the Amazon EC2 instance is created, make note of the value for Public DNS, which is required to access the Amazon EC2 instance using SSH or similar tools.

							Noting the public DNS value in the Amazon EC2 console for a loader instance used by Amazon Redshift.