Tutorial

ACS Setup Examples

Examples using the S3 compatible API to help users get onboard and start using ACS

S3 Examples (boto3)

These examples demonstrate S3-compatible operations using boto3, the AWS SDK for Python. They showcase essential S3 operations including bucket management, object CRUD operations, copying, and multipart uploads with proper error handling and resource cleanup.

Prerequisites

  • Python 3.9+
  • Network access to your S3 endpoint

1) Create virtual environment and install dependencies with UV

setup_env.sh
cd /home/ec2-user/ACSExamples/examples/python
# Create virtual environment with UV
uv venv
# Activate virtual environment
source .venv/bin/activate # On macOS/Linux
# or
.venv\Scripts\activate # On Windows
# Install boto3 using UV
uv pip install boto3

2) Configure your environment for an S3-compatible endpoint

Set the endpoint, region, addressing style, and credentials so boto3 targets ACS S3-compatible store:

env_config.sh
export S3_ENDPOINT="https://acceleratedprod.com" # ACS S3-compatible endpoint URL
export AWS_REGION="global" # Or set AWS_DEFAULT_REGION
export S3_ADDRESSING_STYLE="virtual" # ACS supports virtual addressing only
# S3-compatible credentials (standard AWS env vars)
export AWS_ACCESS_KEY_ID="<YOUR_ACCESS_KEY_ID>"
export AWS_SECRET_ACCESS_KEY="<YOUR_SECRET_ACCESS_KEY>"

3) Run the examples

Run the Python sample scripts to try bucket and object workflows. They handle setup and cleanup for you.

Want to understand how the client setup works? Each example includes detailed comments explaining endpoint configuration, credential handling, and addressing styles. Check out the Python examples in our GitHub repository.

# To deactivate the virtual environment, run:
deactivate

S3 Examples (Go, AWS SDK v2)

These examples demonstrate S3-compatible operations using the AWS SDK for Go v2. They showcase essential S3 operations including bucket management, object CRUD operations, copying, and multipart uploads with proper error handling and resource cleanup.

Prerequisites

  • Go 1.20+
  • Network access to your S3 endpoint

1) Initialize module and download deps

setup.sh
cd /home/ec2-user/ACSExamples/examples/go
go mod tidy

2) Configure your environment for an S3-compatible endpoint

Set these variables so the Go SDK targets your S3-compatible store:

go_env.sh
export S3_ENDPOINT="https://acceleratedprod.com" # ACS S3-compatible endpoint URL
export AWS_REGION="global" # Or set AWS_DEFAULT_REGION
export S3_ADDRESSING_STYLE="virtual" # ACS supports virtual addressing only
# S3-compatible credentials (standard AWS env vars)
export AWS_ACCESS_KEY_ID="<YOUR_ACCESS_KEY_ID>"
export AWS_SECRET_ACCESS_KEY="<YOUR_SECRET_ACCESS_KEY>"

3) Run the examples

Run the Go sample programs to confirm the same workflows with ACS.

Curious about the Go SDK configuration? The examples show how to set up the AWS SDK for Go v2 with custom endpoints and configuration. View the complete Go examples in our GitHub repository.

S3 Examples (AWS CLI)

These examples demonstrate S3-compatible operations using the AWS CLI. They showcase essential S3 operations including bucket management, object CRUD operations, copying, and multipart uploads with proper configuration, error handling, and resource cleanup.

Prerequisites

  • AWS CLI v2 (recommended) or v1
  • Network access to your S3 endpoint
  • bash shell

1) Install required tools

These examples require aws (CLI), jq, and openssl. If you don't have them installed:

install_tools.sh
# For Amazon Linux 2023 / RHEL / CentOS
sudo yum install -y awscli jq openssl
# Or install AWS CLI v2 (recommended)
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

2) Configure your environment for an S3-compatible endpoint

To use these examples with your S3-compatible object store, set the following standard AWS variables and one ACS-specific variable for the endpoint:

cli_env.sh
# Required: S3-compatible endpoint URL and region
export S3_ENDPOINT="https://acceleratedprod.com" # ACS endpoint
export AWS_REGION="global"
# Required: S3-compatible credentials (standard AWS env vars)
export AWS_ACCESS_KEY_ID="<YOUR_ACCESS_KEY_ID>"
export AWS_SECRET_ACCESS_KEY="<YOUR_SECRET_ACCESS_KEY>"
export S3_ADDRESSING_STYLE="virtual" # Note: this env var alone does NOT change AWS CLI behavior unless applied via configure.sh or written to ~/.aws/config

Configuration Options

You can configure the AWS CLI to work with ACS in several ways:

Option A: Using AWS CLI configure command

Configure your default AWS CLI profile for ACS:

aws configure
# When prompted, enter:
# AWS Access Key ID: Your ACS access key
# AWS Secret Access Key: Your ACS secret key
# Default region name: global
# Default output format: json
# Then configure S3-specific settings:
aws configure set s3.addressing_style virtual
Option B: Manual credentials file setup

Create or edit ~/.aws/credentials:

[default]
aws_access_key_id = YourActualAccessKey
aws_secret_access_key = YourActualSecretKey

Create or edit ~/.aws/config:

[default]
region = global
s3 =
addressing_style = virtual
Option C: Using the configuration helper (creates custom profile)

Set your credentials and run the helper script:

export AWS_ACCESS_KEY_ID="YourActualAccessKey"
export AWS_SECRET_ACCESS_KEY="YourActualSecretKey"
source ./configure.sh

Note: This option creates a custom acs-examples profile without affecting your default AWS configuration.

3) Run the examples

Use the shell scripts to test the workflows with your chosen AWS CLI profile.

Need help with AWS CLI configuration? The examples include several configuration approaches with detailed explanations. Find complete CLI setup guides and troubleshooting tips in our GitHub repository.

Notes

  • Default Profile (Options A & B): Uses your default AWS CLI configuration
  • Custom Profile (Option C): Creates acs-examples profile without affecting your default AWS settings
  • Addressing: Virtual-hosted-style addressing is configured for optimal compatibility

Complete Code Examples

Find detailed client initialization guides, complete working examples, and additional language integrations in our GitHub repository.

View on GitHub