# Connect an S3 bucket to LabelEngine

> Set up AWS in four steps - an IAM group, a programmatic user, the bucket and CORS - so LabelEngine can read images straight from your own S3 bucket.

Source: https://docs.maxusai.com/docs/core-features/setting-up-your-s3-bucket

Using an S3 bucket with the MAXUSAI annotator allows you to seamlessly collaborate on the same images as your team members, whilst maintaining a closed loop network.

> Heads up — the LabelEngine interface has been updated since these screenshots were taken. The steps are still correct; the buttons may have moved. [Something out of date? Tell us.](https://www.maxusai.com/contact)

Setting up your S3 Bucket so that a connection can be made from the annotator is comprised of 4 simple steps:

- Creating the group

- Creating the user

- Creating the S3 Bucket (optional)

- Configuring the S3 Bucket

### 1. Creating the group

An IAM group allows you to specify the permissions each user has in regards to the AWS services. In this case, the annotator only requires S3 bucket read permissions.

To create a group that allows this, navigate to the “IAM Management Console”. Then click on “Groups” below “Access Management” and create a new group. Enter the name of your group – which can be anything – and remember the name of this group for step 2. Then hit “Next Step” and attach the “**AmazonS3ReadOnlyAccess**” policy to the group by ticking the checkbox to the left of it and hitting “Next Step”. When given the panel to review the group you are about to create, hit “Create Group”.

![The IAM console Groups page with the Create New Group button highlighted](https://docs.maxusai.com/wp-content/uploads/2020/02/create-group-1024x666.png)

### 2. Creating the user

An IAM user allows you to give specific permissions to either an external application or person based on the linked group.

To create the user for the annotator to use, click on “Users”, below “Groups” in the “IAM Management Console” and add a new user. Type in a username for the new user, then check “**Programmatic access**” under the “Select AWS access type” heading and hit “Next: Permissions” button. Then, in the permissions panel, check the group that you created in step 1 and hit “Next: Tags”. We can skip the tags part of creating a user so hit “Next: Review” and then “Create user”.

The last panel that AWS will show you is the success panel. Copy down the “**Access key ID**” and the “**Secret access key**” as these will be used in the annotator when you need to connect. You can now close the panel and proceed to step 3.

![The IAM console Users page with the Add user button highlighted](https://docs.maxusai.com/wp-content/uploads/2020/02/create-user-1024x603.png)

### 3. Creating the S3 Bucket

If you have already created an S3 Bucket that you would like to use for the annotator, take note of the bucket region and name and proceed to step 4.

To create an S3 Bucket, navigate to the “S3 Management Console” and create a bucket. Enter your bucket name, region and take note of these for when you connect in the annotator. Then hit “Next” 3 times, and then hit “Create Bucket”.

![The S3 console Buckets page with the Create bucket button highlighted](https://docs.maxusai.com/wp-content/uploads/2020/02/create-bucket-1024x484.png)

### 4. Configuring the S3 Bucket

Configuring the S3 Bucket allows the annotator to connect to it and read the bucket’s files from your local machine’s address.

To configure the S3 Bucket, navigate to the “S3 Management Console” and click on the desired bucket. Then click on the “Permissions” tab, then on “Block Public Access”. Click on the “Edit” button, then untick “Block all public access” and hit “Save”.

![The bucket Permissions tab, Block public access settings, with Block all public access unticked and the Save button](https://docs.maxusai.com/wp-content/uploads/2020/02/public-access-1024x484.png)

Then confirm the changes. Now, still on the “Permissions” tab, find “Cross-origin resource sharing (CORS)”, click “Edit” and paste this configuration into the code window. It allows `GET` requests from any origin, with any header:

```json
[
  {
    "AllowedHeaders": ["*"],
    "AllowedMethods": ["GET"],
    "AllowedOrigins": ["*"],
    "ExposeHeaders": []
  }
]
```

Then hit “Save changes”. The S3 console takes this configuration as JSON. The screenshot below is from the older console, which took the same rule as XML (`AllowedOrigin *`, `AllowedMethod GET`, `AllowedHeader *`).

![The CORS configuration editor with one rule: AllowedOrigin *, AllowedMethod GET, AllowedHeader *](https://docs.maxusai.com/wp-content/uploads/2020/02/cors-config-1-1024x689.png)

You’re Done! With the Key, Secret access key, Bucket name and Bucket region you can now connect to your bucket via the annotator!
