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.

For more information on AWS CLI commands, see the AWS s3api and s3 documentations.

Before You Begin

  • Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.
  • The requests presented in this guide require the following attributes:
    • profile: The named profile you want to use, created when configuring AWS CLI.
    • endpoint: The endpoint corresponding to the service (in this case oos) and Region you want to send the request to.



Creating a Bucket

  • 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.<REGION>.outscale.com

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

  • 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

The bucket is created.

For more information, see the complete Creating a Bucket procedure, or the AWS create-bucket documentation.

Uploading an Object to a Bucket

  • 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.<REGION>.outscale.com

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

  • 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 access path to the object on your machine.

The object is uploaded to the bucket.

For more information, see the complete Uploading an Object to a Bucket procedure, or the AWS put-object documentation.

Configuring a Bucket ACL

  • 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.<REGION>.outscale.com

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

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

  • (optional) grant-read id=: 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.

The ACL is configured for the bucket.

For more information, see the complete Configuring a Bucket ACL procedure, or the AWS put-bucket-acl documentation.

Configuring an Object ACL

  • 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.<REGION>.outscale.com

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

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

  • key The name of the object in the bucket.
  • grant-read id= : 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.

 The ACL is configured for the object.

For more information, see the complete Configuring an Object ACL procedure, or the AWS put-object-acl documentation.

Configuring a Pre-signed URL

  • 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 ENDPOINT 

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.

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

For more information, see the complete Configuring a Pre-signed URL procedure, or the AWS presign documentation.

Creating a Website

  1. Copy an index.html object in your bucket and configure a public-read ACL:

    Request Sample
    $ aws s3 cp index.html s3://BUCKET/ \
       --profile YOUR_PROFILE \ 
       --acl public-read \
       --endpoint https://oos.<REGION>.outscale.com
  2. Copy an error.html object in your bucket and configure a public-read ACL:

    Request Sample
    $ aws s3 cp error.html s3://BUCKET/ \
       --profile YOUR_PROFILE \
       --acl public-read \
       --endpoint https://oos.<REGION>.outscale.com 
  3. Create a website.json file with the following content:

    {
        "IndexDocument": {
            "Suffix": "index.html"
        },
        "ErrorDocument": {
            "Key": "error.html"
        }
    }
  4. Copy the website.json file in your bucket and configure a public-read ACL:

    Request Sample
    $ aws s3 cp website.json s3://BUCKET/ \
        --profile YOUR_PROFILE \
        --acl public-read \
        --endpoint https://oos.<REGION>.outscale.com
  5. Create your website with 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.<REGION>.outscale.com

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

For more information about the corresponding s3 commands, see the AWS cp and website documentations.



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