Getting Started with AWS for Unity

Simon Leen
4 min readOct 21, 2021

--

Objective: Set up AWS

The first thing is to set up an AWS account here.

Once set up and logged in, you will land on the above dashboard page but for now, we need to get the AWS Mobile SDK for Unity. The set up page can be found here and the download link for the SDK is here(automatic download provided by AWS).

The SDK will have multiple packages, one for each service such as the aws-unity-sdk-dynamodb-2.1.0.0.unitypackage is used for the AWS DynamoDB service(A Database Service). The download will be an extractable archive so you can choose the service packages you want to use. We will use the S3(Simple Storage Storage) package for this project, highlighted in the image below.

Double click the package which the project open in Unity and Unity will automatically open the importer for the package.

Once imported, you will have folders for the dll and component files, examples and plugins. To keep the asset folder clean, we create a AWS folder and move each of the associated AWS folders inside it. Depending on your Unity version, mine being 2020.3, you may get some errors in the console about missing files etc. Close the project, open the project folder and delete the empty folders of what was the AWS directories and the meta files associated with these and everything will be perfect again when you re-open the project.

The next step is to configure the Amazon Mobile SDK . To get started is very easy and really only needs one line of code added to a script. First we can create an empty GameObject that the script will attach to called AWS_Manager. Then crete a script called AWSManager and attach it. Open the script and we need to use the Amazon namespace so add that at the top shown below.

We don’t need Start or Update at the moment just the Awake method to remove the first two and create the Awake method. By using the Amazon namespace we can now use the following shown line of code in the Awake method.

If you select the AWS_Manager object and look at the inspector while the app is not running you will see the following.

If you keep looking at the inspector while running the app, because of the line of code in the Awake method we end up with the following attached required components.

The next step is to set up and obtain an Identity Pool ID(AWS reference below and link)

You will be met with the following dashboard when you follow the link (this will be region specific to your account which is changable depending on what location you prefer).

Click on Manage Identity Pools.

Create your pool name. we will enable access for unauthenticated identities as we won’t be requiring log in with the app. Create pool and move to the next page. You will be given two roles, one for authenticated and one for unauthenticated. Click allow to proceed(Page not shown for security).

You will be taken to the final screen. For now we don’t need these but it wouldn’t hurt to copy and paste the code for the Platforms you may be using later.

--

--

No responses yet