Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: DOC-2644


Panel
bgColor#F6F5F5
borderWidth0

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

Note

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.



Panel
borderColor#FFFFFF
bgColor#F6F5F5
borderWidth2
titleBGColor#E6E6E6
borderStylesolid
titleRelated Pages


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.




UI Tabs


UI Tab
titleCreating a Bucket

Creating a Bucket

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


    Code Block
    languagetext
    titleRequest 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.

    Note

    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.

Info

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



UI Tab
titleUploading an Object to a Bucket

Uploading an Object to a Bucket

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

    Code Block
    languagetext
    titleRequest Sample
    $>$ aws s3api put-object \
        --profile YOUR_PROFILE \
        --bucket BUCKET \
        --key OBJECT \
        --body usr/bin/OBJECT \
        --endpoint https://oos.<REGION>.outscale.com


Include Page
INCL:_RC-General-SentPart-AWSCLIattributes
INCL:_RC-General-SentPart-AWSCLIattributes

  • bucket: The name you want to give to your bucket, according to the corresponding naming rules.
  • 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.

Info

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



UI Tab
titleConfiguring a Bucket ACL

Configuring a Bucket ACL

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

    Code Block
    languagetext
    titleRequest Sample
    $>$ aws s3api put-bucket-acl \
        --profile YOUR_PROFILE \
        --bucket BUCKET \
        --grant-read emailaddress=email@domain.com \
        --endpoint https://oos.<REGION>.outscale.com


Include Page
INCL:_RC-General-SentPart-AWSCLIattributes
INCL:_RC-General-SentPart-AWSCLIattributes

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

  • grant-read emailaddress=: The email address of the Cloud account to which you grant the read permission.

The ACL is configured for the bucket.

Info

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



UI Tab
titleConfiguring an Object ACL

Configuring an Object ACL

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

    Code Block
    languagetext
    titleRequest Sample
    $>$ aws s3api put-object-acl \
        --profile YOUR_PROFILE \
        --bucket BUCKET \
        --key OBJECT \
        --grant-read emailaddress=email@domain.com \
        --endpoint https://oos.<REGION>.outscale.com


Include Page
INCL:_RC-General-SentPart-AWSCLIattributes
INCL:_RC-General-SentPart-AWSCLIattributes

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

  • key The name of the object in the bucket.
  • grant-read emailaddress=:The email address of the Cloud account to which you grant the read permission.

 The ACL is configured for the object.

Info

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



UI Tab
titleConfiguring a Pre-signed URL

Configuring a Pre-signed URL

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

    Code Block
    languagetext
    titleRequest Sample
    $>$ aws s3 presign s3://BUCKET/OBJECT \
        --profile YOUR_PROFILE \
        --expires-in 3600 \
        --endpoint ENDPOINT 


Include Page
INCL:_RC-General-SentPart-AWSCLIattributes
INCL:_RC-General-SentPart-AWSCLIattributes

  • 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.
Info

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



UI Tab
titleCreating a Website

Creating a Website

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

    Code Block
    languagetext
    titleRequest 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:

    Code Block
    languagetext
    titleRequest 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:

    Code Block
    languagetext
    {
        "IndexDocument": {
            "Suffix": "index.html"
        },
        "ErrorDocument": {
            "Key": "error.html"
        }
    }


  4. Copy the website.json file in your bucket and configure a public-read ACL:

    Code Block
    languagetext
    titleRequest 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:

    Code Block
    languagetext
    titleRequest 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


Info

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



UI Tab
titles3api/OOS Compatibility

s3api/OOS Compatibility





Include Page
INCL:_RC-General-Panel-AWSLegalMentions
INCL:_RC-General-Panel-AWSLegalMentions