<aside> ⚠️ DEPRECATED!!! This guide migrated to our docs. Please view the current version at: https://docs.streamlit.io/en/stable/tutorial/aws_s3.html

</aside>

Introduction

This guide explains how to securely access files on AWS S3 from Streamlit sharing or Streamlit for Teams. It uses the s3fs library and Streamlit's secrets management (requires streamlit v0.80.0 or higher).

Step 1: Create an S3 bucket and add a file

<aside> 🏃 If you already have a bucket that you want to use, feel free to skip this step.

</aside>

First, sign up for AWS or log in. Go to the S3 console and create a new bucket (click on the screenshots to enlarge):

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/00c88634-8fe8-415d-be36-012b2b917d59/Screenshot_2021-04-14_at_23.39.25.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1bd0b465-a530-4906-b495-6839d5d0c9f0/Screenshot_2021-04-14_at_23.41.21.png

Navigate to the upload section of your new bucket:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5ac29d8e-8447-42c1-b8d9-ec54584f7f94/Screenshot_2021-04-14_at_23.43.22.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1d9a2a04-bdd8-4579-806b-ffdd5289ded2/Screenshot_2021-04-14_at_23.44.29.png

And upload the following CSV file, which contains some example data:

myfile.csv

Step 2: Create access keys

Go to the AWS console, create access keys as shown below and copy the "Access Key ID" and "Secret Access Key":

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e411121d-2669-41b9-a427-9461167618d2/Screenshot_2021-04-15_at_21.58.40.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ca5ac039-cffc-410f-9b7b-2cebe9282a5c/Screenshot_2021-04-15_at_22.02.19.png

<aside> 🤫 Store the key in a safe location and don't share it with anyone.

</aside>

<aside> ☝ Access keys created as a root user have wide-ranging permissions. In order to make your AWS account more secure, you should consider creating an IAM account with restricted permissions and using its access keys. More information here.

</aside>

Step 3: Add the key to your local app secrets

Your local Streamlit app will read secrets from a file .streamlit/secrets.toml in your app's root dir. Create this file if it doesn't exist yet and add the access key to it as shown below: