Skip to main content

Test S3 REST API configuration

Contributors netapp-lhalbert netapp-madkat

You can use the Amazon Web Services Command Line Interface (AWS CLI) to test your connection to the system and to verify that you can read and write objects.

Before you begin

For details on these steps, see Configure client connections.

Steps
  1. Configure the AWS CLI settings to use the account you created in the StorageGRID system:

    1. Enter configuration mode: aws configure

    2. Enter the access key ID for the account you created.

    3. Enter the secret access key for the account you created.

    4. Enter the default region to use. For example, us-east-1.

    5. Enter the default output format to use, or press Enter to select JSON.

  2. Create a bucket.

    This example assumes you configured a load balancer endpoint to use IP address 10.96.101.17 and port 10443.

    aws s3api --endpoint-url https://10.96.101.17:10443
    --no-verify-ssl create-bucket --bucket testbucket

    If the bucket is created successfully, the location of the bucket is returned, as seen in the following example:

    "Location": "/testbucket"
  3. Upload an object.

    aws s3api --endpoint-url https://10.96.101.17:10443 --no-verify-ssl
    put-object --bucket testbucket --key s3.pdf --body C:\s3-test\upload\s3.pdf

    If the object is uploaded successfully, an Etag is returned which is a hash of the object data.

  4. List the contents of the bucket to verify that the object was uploaded.

    aws s3api --endpoint-url https://10.96.101.17:10443 --no-verify-ssl
    list-objects --bucket testbucket
  5. Delete the object.

    aws s3api --endpoint-url https://10.96.101.17:10443 --no-verify-ssl
    delete-object --bucket testbucket --key s3.pdf
  6. Delete the bucket.

    aws s3api --endpoint-url https://10.96.101.17:10443 --no-verify-ssl
    delete-bucket --bucket testbucket