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 to the system.
Before you begin
- You must have downloaded and installed the AWS CLI from aws.amazon.com/cli.
- You must have created an S3 tenant account in the StorageGRID system.
Procedure
-
Configure the Amazon Web Services settings to use the account you created in the StorageGRID system:
- Enter configuration mode:aws configure
- Enter the AWS Access Key ID for the account you created.
- Enter the AWS 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.
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