logo

Amazon S3 Usage and Programmatic Access

Amazon S3 Overview

Amazon S3 (Simple Storage Service) is a scalable object storage service that provides high durability, availability, and security for storing and retrieving data. It is commonly used for backup, archival, big data analytics, and content storage.

Amazon S3 can be accessed programmatically using various AWS SDKs, the AWS CLI, or REST APIs. This enables applications to interact with S3 to perform operations such as uploading, downloading, and deleting files from S3 buckets.

S3 Connection Fields Explained:

DonkeyApp uses the following S3 connection fields to set up an AWS S3 storage connection.

S3 Bucket Name

The S3 bucket is where your data is stored. The bucket name must be globally unique within AWS.

Example: my-unique-bucket-name

Access Key

This is the public part of your AWS credentials, identifying the AWS IAM user or role making the request.

Example: AKIAYEXAMPLEKEY

Secret Key

This is the private part of your AWS credentials. It authenticates your requests to AWS services.

Example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

AWS Region

Specify the region where your S3 bucket is hosted to ensure requests are routed correctly.

Example: us-west-2

CORS Configuration for S3 Bucket

To upload files to your S3 bucket using DonkeyApp, you need to configure CORS (Cross-origin resource sharing) for your S3 bucket. Follow the steps below:

  1. Go to your S3 bucket in the AWS Console.
  2. Click on the Permissions tab.
  3. Under the Cross-origin resource sharing (CORS) section, click Edit.
  4. Copy and paste the following JSON configuration:
[
  {
    "AllowedHeaders": ["*"],
    "AllowedMethods": ["GET", "HEAD", "POST", "PUT"],
    "AllowedOrigins": ["*"],
    "ExposeHeaders": []
  }
]

Once you've pasted the JSON, click Save Changes.

How to Obtain AWS S3 Access Key and Secret Key

AWS access keys are associated with an IAM (Identity and Access Management) user. Follow these steps to create an IAM user and obtain your keys.

Creating an IAM User:

  1. Sign in to the AWS Management Console and go to the IAM service.
  2. Click on Users, then Add users.
  3. Enter a User name.
  4. Under Access type, select Programmatic access.
  5. Click Next: Permissions and assign appropriate permissions. You can attach the AmazonS3FullAccess policy.
  6. Complete the steps to create the user.

Download Access Key and Secret Key:

Once the user is created, on the User summary page, you will see Access key ID and Secret access key. Download or copy the keys securely. The secret key will only be displayed once.