Unity To Steam – Part 4 – AWS S3, EC2 and SES

Introduction

It a well known statement: AWS provide so many services that you can build almost everything you want with. On the other hand, this jungle is pretty hard to grasp and it is complicated to know where to start.

Don’t worry: we will use few services that AWS provide. We will configure, securize and connect them together to create the most performant and costless pipeline for our Steam package/upload process.

This step is the richest and more interesting part of our Git to Steam journey. I decided to go with the essential and if you are familiar with AWS you may think about many other ways to implement this. In this case, feel free to discuss about it on our Discord: https://discord.gg/CfZ5aVXdm8. I’m always happy to improve the process.

We will use the following services:

  • IAM for security
  • EC2 for compute
  • S3 for storage
  • SES for the email notification
  • Lambda for the webservice

We will end up with this architecture:

Prerequisite

You must have:

  • an AWS account with access to the previously mentioned services

You will find a millions of tutorial on the Internet on that topic. You can start with the Youtube Amazon channel that provides a lot of short video about their services. You can start with this one:

Collect information

You must collect important information for the process to work (especially for the scripts).

Click on your account on the top left of the screen:

Note here the AWS organization ID, we will use it later. For this example: 113819842001

S3 configuration

Amazon S3 (for Simple Storage Service) is a cloud service for storing objects. Accessible through a web interface, this service allows to store, protect and restore data and files from “Buckets” (seals).

You can have a look to this short video to understand the basics. I recommend it but it is not required for this tutorial.

Let’s start. Go to the S3 admin page:

Into the right menu, click on Buckets then Create bucket:

Fill the field of the form. Let’s continue with our example:

Bucket name : empire.org

AWS Region: select the one you want. For our example, let’s use eu-west-1

Note the Bucket name and AWS region. We will use them later

Then keep the default option: click on Create.

Your new bucket appear in the list Click on its name to browse its content:

Create now the following tree using the Create folder button:

empire.org
   \----UCB
      \----steam-parameters
      \----steam-sdk
      \----unity-builds

Now download the latest Steamworks SDK from this URL: https://partner.steamgames.com/downloads/steamworks_sdk.zip

Unzip it on your computer and upload the builder_linux folder to the steam-sdk S3 folder. You should then have this structure:

empire.org
   \----UCB
      \----steam-parameters
      \----steam-sdk
         \----builder_linux
      \----unity-builds

This part is weird I know, but I did not find any solution to make the script download the Steamworks executable automatically. Storing them in S3 allow multiple installations (or multiple tries if you want to redo the Ubuntu installation process in part 5)

SES configuration

SES (for Simple Email Service) will permit us to send email notification about the jobs status.

First of all, connect to the SES console:

On the left click on Email Adresses:

Then on the top of the screen, click on Verify A New Email Address:

Type the email you want to verify then click on Verify This Email Address:

The following message should appear:

Now you will receive an email asking you to verify and activate this entry in SES. Once done, your email address should appear as verified, meaning that SES can send you email.

EC2 instance creation

Amazon’s Elastic Compute Cloud (EC2) is a service that allows business subscribers to run application programs in the computing environment. It can serve as a practically unlimited set of virtual machines. 

EC2 provides a variety of types of virtual instances with different configurations of CPU, memory, storage, and networking resources to suit user needs.

You can have a look to this short video to understand the basics. I recommend it but it is not required for this tutorial.

Go to the EC2 admin page:

Go to the instances list by clicking on Instances in the left menu:

Create a new EC2 instance by clicking on Launch Instances on the top right corner:

Use the following parameters:

Auto-assign Public IP: Enable

Shutdown behavior: Stop

Depending of your project size, add disk size. The default disk size is 8GB. For our city builder, we needed 16GB.

Click on Launch:

Associate this instance with a keypair. If you don’t have one, create it (and do not forget to store the private key file somewhere on your hard drive.

Wait the for the instance to be created and started, then click on “View instances”

After a while, your instance should appear in the instance list:

The machine is still in the Initialization step. Wait for the instance to bea ready like this:

Note the EC2 Instance ID. In this example: i-0498da462121cc54b