Day 143 — Getting Started With AWS for Unity

Hey and welcome!

In this one we’re going to look into getting set up with AWS (Amazon Web Services) and getting it to work with Unity. We’re doing this so that we can make use of the cloud services offered by Amazon for use in our app that we’re building. If you’re wanting to gloss over this article you can also follow the documentation provided for Amazon for this:

To get things started you will first need to create yourself an AWS account at the following link, they will ask for your card details and take 1$(USD) for authorization but on the last step of the registration you can choose the free option and you won’t need to pay for anything for this article.

Once you’ve finished all that it should direct you over to your management console for AWS which will come back to later, for now you can click on the following link to download a zip folder of some AWS packages for Unity:

http://sdk-for-net.amazonwebservices.com/latest/aws-sdk-unity.zip

Double click or drag into the Unity project your AWSSDK.S3 package and get that imported. When that’s done you’ll have a AWSSDK, Examples and a Plugins folder, I recommend checking out the Examples folder for the time being as it has some code showing how to get and post objects to S3 bucket.

Speaking of code, let’s go ahead and create a new script called AWSManager and create an empty game object to attach to it with the same name. Next add in this code to your script:

using Amazon;public class AWSManager : MonoBehaviour
{
private void Awake()
{
UnityInitializer.AttachToGameObject(this.gameObject);
}
}

This bit of code gets the AWS Mobile SDK usable with our Unity project! Last bit we need to do is obtain an Identity Pool ID which will allow us to access the AWS services without having to use our personal credentials in the project.

To get started with this you will need to head over to the following link:

https://console.aws.amazon.com/cognito/home

On this page go ahead and click on the Manage Identity Pools options and give this pool the name of “Service Adjustment App”. Next you can check the box to enable access to unauthenticated identities and then click on the create pool option which will lead you to a page about IAM roles which is fine to allow as is.

With that done our project has now been set up with AWS and we’re now ready to get started with building the app!

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.