Test S3 REST API configuration
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.
-
You have downloaded and installed the AWS CLI from aws.amazon.com/cli.
-
Optionally, you have created a load balancer endpoint. Otherwise, you know the IP address of the Storage Node you want to connect to and the port number to use. See IP addresses and ports for client connections.
-
You have created an S3 tenant account.
-
You have signed in to the tenant and created an access key.
For details on these steps, see Configure client connections.
-
Configure the AWS CLI settings to use the account you created in the StorageGRID system:
-
Enter configuration mode:
aws configure
-
Enter the access key ID for the account you created.
-
Enter the secret access key for the account you created.
-
Enter the default region to use. For example,
us-east-1
. -
Enter the default output format to use, or press Enter to select JSON.
-
-
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"
-
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.
-
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
-
Delete the object.
aws s3api --endpoint-url https://10.96.101.17:10443 --no-verify-ssl delete-object --bucket testbucket --key s3.pdf
-
Delete the bucket.
aws s3api --endpoint-url https://10.96.101.17:10443 --no-verify-ssl delete-bucket --bucket testbucket