export const meta = {
  title: `File storage`,
  description: `Get started with Amplify Studio`
};

Amplify Studio File Storage provides a simple mechanism for managing user content for your app in public, protected or private storage folders. In Studio you can specify authorization rules that limit individual user or group access to create, read, update, or delete operations on your files. The File Storage category comes with built-in support for Amazon S3.

![Amplify Studio storage start page](/images/console/storageStart.png)

There are two ways to add file storage to Amplify Studio - import an existing S3 bucket and create a new S3 bucket. Both methods require the authentication category to also be enabled.

## To set the authorization modes on new file storage

When you create new file storage for your app, you can edit authorization rules.

1. [Launch Studio](/console/adminui/start/#log-into-the-amplify-console) for an app.
2. On the **Set up** menu, choose **Storage**.
3. On the **Storage** page, locate the **Authorization settings** on the bottom of the _File storage bucket_ card.
4. Select your desired authorization settings for **Signed-in users**, or **Guest users** _(optional)_.

The authorization modes can always be edited under **Set up**, **Storage**.

<Callout warning>
  To enable local development after setting up guest permissions, you must allow
  unauthenticated logins by updating your auth settings. Run `amplify update
  auth` to update your auth settings.
</Callout>

## To import file storage

For default file access levels to work, your bucket needs to be configured accordingly:

- **private/{user_identity_id}/** - Only accessible for the individual user
- **protected/{user_identity_id}/** - Readable by all users, writable only by the creating user
- **public/** - Accessible by all users of your app

[Learn more about how to import file storage.](https://docs.amplify.aws/cli/storage/import/#connect-to-an-imported-s3-bucket-with-amplify-libraries)

## To set the authorization mode on imported file storage

If you're using an imported S3 bucket with an imported Cognito resource, then you'll need to update the policy of your Cognito Identity Pool's authenticated and unauthenticated role. You'll need to create new managed policies (not inline policies) for these roles.

[Learn more about how to configure IAM roles for imported file storage](https://docs.amplify.aws/cli/storage/import/#configuring-iam-role-to-use-amplify-recommended-policies)
