Quick Start

This walkthrough creates an SQS queue, sends a message, then creates an S3 bucket and uploads a file - all against your local Simfra instance.

Prerequisites

  • Simfra running on localhost:4599 (see Installation)
  • AWS CLI v2 installed

1. Set Environment Variables

export AWS_ENDPOINT_URL=http://localhost:4599
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export AWS_DEFAULT_REGION=us-east-1
export AWS_S3_USE_PATH_STYLE=true

These credentials are Simfra's default root credentials. AWS_S3_USE_PATH_STYLE is required for S3 path-style addressing on localhost. See Credentials for details.

2. Open the Web Console

Open http://localhost:4599 in your browser. You'll see the Simfra web console with a service directory, account switcher, and region selector. See Web Console for a full overview.

3. Create an SQS Queue

aws sqs create-queue --queue-name my-queue
{
    "QueueUrl": "http://localhost:4599/000000000000/my-queue"
}

Send a message

aws sqs send-message \
  --queue-url http://localhost:4599/000000000000/my-queue \
  --message-body "Hello from Simfra"

Receive the message

aws sqs receive-message \
  --queue-url http://localhost:4599/000000000000/my-queue
{
    "Messages": [
        {
            "MessageId": "...",
            "ReceiptHandle": "...",
            "MD5OfBody": "...",
            "Body": "Hello from Simfra"
        }
    ]
}

4. Create an S3 Bucket

aws s3 mb s3://my-bucket

Upload a file

echo "Hello from Simfra" > /tmp/hello.txt
aws s3 cp /tmp/hello.txt s3://my-bucket/hello.txt

List bucket contents

aws s3 ls s3://my-bucket/

Download the file

aws s3 cp s3://my-bucket/hello.txt /tmp/hello-downloaded.txt
cat /tmp/hello-downloaded.txt

Next Steps