AWS CLI
IONOS S3 Object Storage supports using Amazon's AWS Command Line Interface (AWS CLI) for Windows, macOS, and Linux.
For the installation instructions, see Installing or updating the latest version of the AWS CLI.
Configuration
Run the following command in a terminal:
aws configure
.AWS Access Key ID [None]: Insert the Access Key. To get it, log in to the DCD, go to Menu > Storage > IONOS S3 Object Storage > Key management.
AWS Secret Access Key [None]: Paste the Secret Key. It can be found in the Data Center Designer by selecting Storage > S3 Key Management.
Default region name [None]:
de
.Default output format [None]:
json
.
Using AWS CLI with IONOS S3 Object Storage
For each command, be sure to include one of the endpoints in the endpoint-url
parameter:
For information on the supported IONOS S3 Object Storage Service endpoints, see Endpoints.
There are 2 sets of commands:
s3: Offers high-level commands for managing S3 buckets and for moving, copying, and synchronizing objects.
s3api: Allows you to work with specific features such as ACL, CORS, and Versioning.
Sample Usage
List buckets:
Option 1: Using s3 set of commands
Option 2: Using s3api set of commands
Create a bucket in the
eu-central-2
region (Berlin, Germany):Option 1: Using s3 set of commands
Option 2: Using s3api set of commands
Create a bucket in the
de
region (Frankfurt, Germany) with Object Lock enabled:Upload an object from the current directory to a bucket:
Copy the object to the bucket:
Copy the contents of the local directory
my-dir
to the bucketmy-bucket
:For more information, see cp command reference.
Copy all objects from
my-source-bucket
tomy-dest-bucket
excluding .zip files. The command doesn’t support cross-region copying for IONOS S3 Object Storage:Download all the objects from the
my-bucket
bucket to the local directorymy-dir
:Sync the bucket
my-bucket
with the contents of the local directorymy-dir
:For more information, see sync command reference.
Get Cross-Origin Resource Sharing (CORS) configuration:
Set up Cross-Origin Resource Sharing (CORS) configuration:
cors.json:
For more information, see put-bucket-cors command reference.
Enable versioning for the bucket:
Get versioning state of the bucket:
Set up a lifetime policy for a bucket (delete objects starting with "my/prefix/" older than 5 days):
delete-after-5-days.json:
Last updated