Getting Started with AWS for Unity

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.

--

--

--

Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Creating an embedded hashtag system in Laravel — Part 2

v 3.4.0 | Touch 👉🏼

Electric Vehicles Smart Meter System Design

DevOps / SRE — Top Links Last Week

Cross account S3 object copying with KMS encrypted buckets

Internal & external tables in Hadoop- HIVE (the big data island)

A Lesson in Searching for Solutions

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Simon Leen

Simon Leen

Developer

More from Medium

How to Add Custom Post Processing Files to Individual Cameras in Cinemachine

Creating an Office Den in Unity Part 1: Design and Organization

Adding proximity detection so enemies can ram player

2D Mobile: Setting Up The Player