Tutorial: Setting up your AWS Account to make use of MTurk’s API
We’ve previously published tutorials showing how to use the SDKs and CLI. In today’s tutorial, we are going to show you how to register for AWS, link your account to your MTurk Requester account, then secure and retrieve your AWS Security Credentials with the AWS Identity and Access Management (IAM). At the end of the tutorial, you’ll will have:
- An AWS Access Key ID (e.g., AKIAIOSFODNN7EXAMPLE)
- An AWS Secret Access Key (e.g., wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY)
Let’s get started.
I. Register for Amazon Web Services
In this step, we will setup an Amazon Web Services (AWS) account. Simply follow the steps below:
- Visit http://aws.amazon.com/
- Click the button to “Create an AWS Account”
- On the next page, provide your Email Address, Password, and AWS Account Name (you can change this name in your account settings after sign up).
- Click “Continue” to proceed
Next, you’ll provide your contact information. If you’re registering as an individual, select “Personal” and if you’re using MTurk as part of your business, select “Professional”
Complete the remaining fields with your information. Then click “Create Account and Continue” to proceed.
Next, you’ll be asked to provide a credit card for your AWS Account. This is separate from any payment instruments you may have on-file with your MTurk Requester account. Once you’ve completed this information, click the “Secure Submit” button to proceed.
Next, you’ll be asked to complete a brief phone verification step. Here, you are asked to provide a phone number where you can be reached, and to click the “Call Me Now” button to receive an automated phone call.
Once you’ve successfully verified your identity, click “Continue” to proceed.
In the last step before you’ve finished registration, select your AWS Support plan. For this tutorial, and unless you plan to use other AWS Services, simply select “Basic Plan” by clicking the “Free” button. You can change this selection at any time in the future.
Congratulations! You’ve now completed registration for your Amazon Web Services account. Next, click “Sign in to the Console” for the next part of this tutorial.
II. Configure your AWS Account to use MTurk
Next we’ll configure your AWS Account using Identity and Access Management (IAM). If you haven’t already, click “Sign in to the Console” to proceed. You’ll be asked to enter the e-mail address and password you setup in Step 1.
In this step, we are going to configure an IAM account (think of this like a “child” account of your parent AWS Account). IAM allows you to limit the services and capabilities of these “child” accounts, to help keep things more secure. In our case, we’ll limit our IAM account to only access MTurk.
To start, select “Users” on the left navigation menu, and click the “Add User” button at the top of the screen.
On the next screen, provide a name for your user (in our tutorial, we used ‘mturk-user’) and be sure to check the box for “Programmatic Access” since that will make sure we receive an AWS Access Key ID and AWS Secret Access Key for this IAM account. These are the keys we will use to make requests to the MTurk Requester API. Once complete, click “Next: Permissions” to proceed.
On the next page, select to “Attach existing policies directly” then type “AmazonMechanicalTurkFullAccess” in the search field. This should result in one search result for the AmazonMechanicalTurkFullAccess policy. Click the Checkbox next to that row, then click the “Next: Review” button to proceed.
Click “Create User” on the next screen to proceed.
This final screen is important. Here you’re shown your AWS Access Key ID and your Secret Access Key. This is the only time you’ll be provided your AWS Secret Access Key, so it’s important that you store it somewhere secure. Don’t worry: if you ever lose this, you can regenerate another pair of AWS Access Key ID and Secret Access key in the AWS Console. To view your Secret Access Key, you’ll need to click the “Show” link.
Once you’ve stored these values somewhere secure, click “Close” to proceed.
III. Link your AWS Account to your MTurk Requester Account
Now, in the final step, we’re going to link your AWS Account with your MTurk Requester account.
Begin by visiting http://requester.mturk.com/developer. This page lists a series of steps similar to what you’ve just followed. In fact, you already completed Step 1 by following this tutorial. Nice work!
Now, we’re going to complete Step 2 from the MTurk Getting Started guide. In this step, you will “Link Your AWS Account with Your MTurk Requester Account” in order to make sure the AWS Access Key ID and AWS Secret Access Key know which MTurk Requester account you’re accessing when you use the MTurk API.
Now if you’ve followed this tutorial straight through, you’re probably still logged in to your AWS Account. If so, you’ll see a screen like the one below:
You’ll simply click “Link This Account” to complete the linking of your MTurk Requester account with the AWS Account you just created.
IV. Wrapping up and Next Steps
That’s it. Congratulations! You’ve just registered for Amazon Web Services, configured an IAM Account to securely access MTurk, and linked your MTurk Requester Account with your AWS Account.
At this point, you should have an AWS Access Key ID and AWS Secret Access Key ID that can be used to make calls to the MTurk API using the AWS SDKs or the AWS CLI.
If you’re simply looking to manage your HITs and perform simple API operations like ListHITs, SendBonus, or NotifyWorker, check out this tutorial on using the AWS CLI.