Setting up Amazon S3 Integration
This guide explains how to set up the Amazon S3 integration for DocuElevate.
Required Configuration Parameters
| Variable | Description |
|---|---|
AWS_ACCESS_KEY_ID |
AWS IAM access key ID |
AWS_SECRET_ACCESS_KEY |
AWS IAM secret access key |
AWS_REGION |
AWS region where your S3 bucket is located (default: us-east-1) |
S3_BUCKET_NAME |
Name of your S3 bucket |
S3_FOLDER_PREFIX |
Optional prefix/folder path for uploaded files |
S3_STORAGE_CLASS |
Storage class for uploaded objects (default: STANDARD) |
S3_ACL |
Access control for uploaded files (default: private) |
For a complete list of configuration options, see the Configuration Guide.
Step-by-Step Setup Instructions
1. Create an S3 bucket
- Go to the Amazon S3 Console
- Click "Create bucket"
- Enter a globally unique name for your bucket
- Select your preferred AWS region
- Configure other settings as needed (block public access is recommended)
- Click "Create bucket"
2. Create an IAM User with S3 Access
- Go to the AWS IAM Console
- Navigate to "Users" and click "Add users"
- Enter a name (e.g., "docuelevate-s3-access")
- For access type, select "Programmatic access"
- Click "Next: Permissions"
- Choose "Attach existing policies directly" and search for "AmazonS3FullAccess"
- For more security, you can create a custom policy limiting access to just your bucket
- Click through to review and create the user
- On the final page, you'll see the Access Key ID and Secret Access Key
- Save these credentials securely as they won't be shown again
3. Configure DocuElevate
- Set
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYto the credentials from step 2 - Set
AWS_REGIONto the region where your bucket was created (e.g., "us-east-1") - Set
S3_BUCKET_NAMEto your bucket name - Set
S3_FOLDER_PREFIXto organize files in specific subfolder paths (e.g., "invoices/" or "documents/2023/") - Optionally customize
S3_STORAGE_CLASSandS3_ACLfor your storage needs
4. Optional: Create a Custom IAM Policy (for better security)
- In IAM console, go to "Policies" and click "Create policy"
- Use the JSON editor and paste a policy like this (replace
your-bucket-name):json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::your-bucket-name", "arn:aws:s3:::your-bucket-name/*" ] } ] } - After creating the policy, attach it to your user instead of the broader AmazonS3FullAccess
Storage Class Options
Amazon S3 offers several storage classes to optimize costs:
| Storage Class | Use Case | Retrieval Time |
|---|---|---|
STANDARD |
Default, frequently accessed data | Immediate |
INTELLIGENT_TIERING |
Data with changing or unknown access patterns | Immediate |
STANDARD_IA |
Long-lived, infrequently accessed data | Immediate |
ONEZONE_IA |
Long-lived, infrequently accessed, non-critical data | Immediate |
GLACIER_IR |
Archive data that needs immediate access | Immediate |
GLACIER |
Archive data that rarely needs to be accessed | Minutes to hours |
DEEP_ARCHIVE |
Long-term archive and digital preservation | Hours |
Set your preferred storage class using the S3_STORAGE_CLASS parameter.
Access Control List (ACL) Options
Common ACL values include:
private(default) - Only the bucket owner has accesspublic-read- Anyone can read the file (use cautiously)bucket-owner-full-control- Useful for cross-account uploads
For most document storage scenarios, private is recommended for security.