Tutorial: Getting Started with OOS Using AWS CLI

The aim of this tutorial is to present the main operations possible with OUTSCALE Object Storage (OOS) using AWS CLI.

These operations are not presented in their comprehensive form. For more information, see the linked complete procedures.

Creating a Bucket

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

To create a bucket, use the create-bucket command following this syntax:

Request sample
$ aws s3api create-bucket \
    --profile YOUR_PROFILE \
    --bucket BUCKET \
    --endpoint https://oos.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • bucket: The name you want to give to your bucket, according to the corresponding naming rules.

    As a reminder, the name of a bucket must:

    • Be unique for the whole Region

    • Contain between 3 and 63 characters

    • Contain only lowercase characters, numbers and hyphens (-)

    • Start with an alphanumeric character

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The bucket is created.

For more information, see Creating a Bucket.

Uploading an Object to a Bucket

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

Objects are not limited in size. The maximum size for one upload is 5 GiB, but you can also upload files in multiple parts. For optimal upload performance, it is recommended that files larger than 100 MiB be uploaded in multiple parts. For more information, see Using Multipart Upload.

To upload a local object in a bucket, use the put-object command following this syntax:

Request sample
$ aws s3api put-object \
    --profile YOUR_PROFILE \
    --bucket BUCKET \
    --key OBJECT \
    --body usr/bin/OBJECT \
    --endpoint https://oos.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • bucket: The bucket in which you want to upload the object.

  • key: The name you want to give to the object in the bucket.

  • body: The path to the object on your machine.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The object is uploaded to the bucket.

For more information, see Uploading an Object to a Bucket.

Configuring a Bucket ACL

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

To configure the ACL of a bucket, use the put-bucket-acl command following this syntax:

Request sample
$ aws s3api put-bucket-acl \
    --profile YOUR_PROFILE \
    --bucket BUCKET \
    --grant-read id=S3_USER_ID \
    --endpoint https://oos.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • bucket: The bucket in which you want to upload the object.

  • grant-read: The S3 ID of the user to which you grant the read permission.

    To retrieve S3 user IDs, you need to use the Listing Your Buckets or Listing the Objects of a Bucket methods.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The ACL is configured for the bucket.

For more information, see Configuring a Bucket ACL.

Configuring an Object ACL

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

To set the ACL for an object, use the put-object-acl command following this syntax:

Request sample
$ aws s3api put-object-acl \
    --profile YOUR_PROFILE \
    --bucket BUCKET \
    --key OBJECT \
    --grant-read id=S3_USER_ID \
    --endpoint https://oos.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • bucket: The bucket in which you want to upload the object.

  • key: The name of the object in the bucket.

  • grant-read: The S3 ID of the user to which you grant the read permission.

    To retrieve S3 user IDs, you need to use the Listing Your Buckets or Listing the Objects of a Bucket methods.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The ACL is configured for the object.

For more information, see Configuring an Object ACL.

Configuring a Pre-Signed URL

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

To configure a pre-signed URL, use the presign command following this syntax:

Request sample
$ aws s3 presign s3://BUCKET/OBJECT \
    --profile YOUR_PROFILE \
    --expires-in 3600 \
    --endpoint https://oos.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • s3://BUCKET/OBJECT: The path to the object you want to share in the bucket.

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • expires-in: The time before the URL expires, in seconds.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

For more information, see Creating a Pre-Signed URL.

Creating a Bucket Website

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

To create a bucket website, use the website command following this syntax:

Request Sample
$ aws s3 website s3://BUCKET/ \
    --profile YOUR_PROFILE \
    --index-document index.html \
    --error-document error.html \
    --endpoint https://oos.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • s3://BUCKET/OBJECT: The path to the object you want to share in the bucket.

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • index-document: The path to an index file you have uploaded to the bucket.

  • error-document: The path to an error file you have uploaded to the bucket.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

Your website is created and accessible using the following URL format: https://<BUCKET>.oos-website.<REGION>.outscale.com

For more information, see Managing a Bucket Website.

Related Pages

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.