Setup

AWS Account

In order to complete this workshop, you’ll need an AWS account and access to create AWS Identity and Access Management (IAM), Amazon Cognito, Amazon Kinesis, Amazon S3, Amazon Athena, Amazon DynamoDB, and AWS Cloud9 resources within that account.

The code and instructions in this workshop assume only one participant is using a given AWS account at a time. If you attempt sharing an account with another participant, you will encounter naming conflicts for certain resources. You can work around this by either using a suffix in your resource names or using distinct Regions, but the instructions do not provide details on the changes required to make this work.

You can start the workshop by following the below, depending on whether you are… at an AWS event or self paced on your own using your own account

When selecting the region to start resources, use one of the US East (N. Virginia), US West (Oregon), EU* (Ireland, London, Frankfurt) regions if using your own AWS account. If using a hosted AWS account please use the region as recommended by your host as this will be pre-determined.

Resources

  1. At an AWS Event using EventBox
  2. At an AWS Event using EventEngine
  3. Self Paced On Your Own
  4. Cloud9 IDE

1. At an AWS Event using EventBox


Only complete this section if you are at an AWS hosted event (such as re:Invent, Loft, Immersion Day, or any other event hosted by an AWS employee).

Ensure you have logged out of your own AWS account first before completing the sign-in using an event account.

The event team have created an AWS account and the development environment that is used throughout the workshop.

Connect to the portal by accessing the URL given by the AWS team. The URL starts with https://eventbox.dev.

  1. Click on the launch button

  2. Click on “Click here to access” to hyperlink setup-eventbox

  3. “Accept terms & Login” in the next screen

  4. Then, provide your email address to receive an one-time-passcode which you can enter to gain access to the dashboard.

  5. Once you enter the OTP, You will see the following screen setup-EEConsole

  6. Click on “AWS Console” In the AWS Console Login pop-up, copy the Credentials/CLI Snippets under Mac or Linux using the blue copy icon and paste them in your favorite notepad app, you will need them later. Click on the Open AWS Console button.

    Note: The red banner in the below screenshot may have a different region in your screen. Please use that region after you logged in to the account.

setup-EEConsole-popup.png

Once you are signed in, you can move to AWS Cloud9 IDE section below.


2. At an AWS Event using EventEngine


Only complete this section if you are at an AWS hosted event (such as re:Invent, Loft, Immersion Day, or any other event hosted by an AWS employee).

Ensure you have logged out of your own AWS account first before completing the sign-in using an event account.

The event team have created an AWS account and the development environment that is used throughout the workshop.

Connect to the portal by clicking the button or browsing to https://dashboard.eventengine.run/ and then enter the Participant Hash provided by the event team.

setup-EEHash.png

Then provide your email address to receive a one-time-passcode which you can enter to gain access to the dashboard. Set a team name (your name) and then select AWS Console.

setup-EEConsole.png

In the AWS Console Login pop-up, copy the Credentials/CLI Snippets under Mac or Linux using the blue copy icon and paste them in your favourite notepad app, you will need them later. Click on the Open AWS Console button.

Note: The red banner in the below screenshot may have a different region in your screen. Please use that region after you logged in to the account.

setup-EEConsole-popup.png

Once you are signed in, you can move to AWS Cloud9 IDE section below.


3. Self Paced On Your Own


Only complete this section if you are running the workshop on your own and not at an AWS hosted event (such as re:Invent, Loft, Immersion Day, or any other event hosted by an AWS employee).

Ensure you do not leave behind any resources from the workshop by following the Cleanup step at the end of the workshop.

Use a personal account or create a new AWS account for this workshop rather than using an organization’s account to ensure you have full access to the necessary services.

Once you are signed you can move to AWS Cloud9 IDE section below.



4. AWS Cloud9 IDE


AWS Cloud9 is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code with just a browser. It includes a code editor, debugger, and terminal. Cloud9 comes pre-packaged with essential tools for popular programming languages and the AWS Command Line Interface (CLI) pre-installed so you don’t need to install files or configure your laptop for this workshop. Your Cloud9 environment will have access to the same AWS resources as the user with which you logged into the AWS Management Console.

Take a moment now and setup your Cloud9 development environment.

Step-by-step Instructions

  1. Go to the AWS Management Console, click Services then select Cloud9 under Developer Tools.

  2. Click Create environment.

  3. Enter Development into Name and optionally provide a Description.

  4. Click Next step.

  5. You may leave Environment settings at their defaults of launching a new t2.micro EC2 instance which will be paused after 30 minutes of inactivity.

  6. Click Next step.

  7. Review the environment settings and click Create environment. It will take several minutes for your environment to be provisioned and prepared.

  8. Once ready, your IDE will open to a welcome screen. Below that, you should see a terminal prompt similar to:

setup-cloud9-terminal.png

  1. Paste here the Credentials/CLI Snippets you copied before to configure your environment with your credentials.

setup-cloud9-credentials.png

Now you can run AWS CLI commands in here just like you would on your local computer. Verify that your user is logged in by running aws sts get-caller-identity.

aws sts get-caller-identity

You’ll see output indicating your account and user information:

Admin:~/environment $ aws sts get-caller-identity
{
  "Account": "123456789012",
  "UserId": "AKIAI44QH8DHBEXAMPLE",
  "Arn": "arn:aws:iam::123456789012:user/Alice"
}

Keep your AWS Cloud9 IDE opened in a tab throughout this workshop as you’ll use it for activities like building and running a sample app in a Docker container and using the AWS CLI.

Command Line Clients

The modules utilize two command-line clients to simulate and display sensor data from the unicorns in the fleet. These are small programs written in the Go Programming Language. The below instructions in the Installation section walks through downloading pre-built binaries, but you can also download the source and build it manually:

Producer

The producer generates sensor data from a unicorn taking a passenger on a Wild Ryde. Each second, it emits the location of the unicorn as a latitude and longitude point, the distance traveled in meters in the previous second, and the unicorn’s current level of magic and health points.

Consumer

The consumer reads and displays formatted JSON messages from an Amazon Kinesis stream which allow us to monitor in real-time what’s being sent to the stream. Using the consumer, you can monitor the data the producer and your applications are sending.

Installation

  1. Switch to the tab where you have your Cloud9 environment opened.

  2. Download and unpack the command line clients by running the following command in the Cloud9 terminal:

    curl -s https://data-processing.serverlessworkshops.io/client/client.tar | tar -xv
    

This will unpack the consumer and producer files to your Cloud9 environment.

⭐ Tips

💡 Keep an open scratch pad in Cloud9 or a text editor on your local computer for notes. When the step-by-step directions tell you to note something such as an ID or Amazon Resource Name (ARN), copy and paste that into the scratch pad.

⭐ Recap

🔑 Use a unique personal, development or event AWS account

🔑 Use one of the US East (N. Virginia), US West (Oregon), EU* (Ireland, London, Frankfurt) Regions if using your own AWS account.

🔑 Keep your AWS Cloud9 IDE opened in a tab

Next

✅ Proceed to the first module, Streaming Data, wherein you’ll create a Kinesis stream, send unicorn data to that stream, and visualize unicorn positions on a live map.