Skip to content

Instantly share code, notes, and snippets.

@katzefudder
Last active September 21, 2022 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katzefudder/5d8836f3fd753a086f90e8f957a21838 to your computer and use it in GitHub Desktop.
Save katzefudder/5d8836f3fd753a086f90e8f957a21838 to your computer and use it in GitHub Desktop.
Using Ionos Cloud S3 with Boto3 and AWS CLI
import boto3
endpoint="https://S3-eu-central-1.ionoscloud.com"
bucket_name="my_bucket" # add your bucket here
client = boto3.client('s3',
endpoint_url=endpoint,
config=boto3.session.Config(signature_version='s3v4'),
aws_access_key_id = "4ab...76", # add your access key
aws_secret_access_key = "nDkdd...Trdd" # add your secret key
)
paginator = client.get_paginator('list_objects')
page_iterator = paginator.paginate(Bucket=bucket_name)
for page in page_iterator:
print(page['Contents'])
#!/bin/bash
# you need to have your Ionos access keys and secret configured in ~/.aws/credentials
#
# [default]
# aws_access_key_id = 4ab...76
# aws_secret_access_key = nDkdd...Trdd
#
BUCKET=$1
aws s3 ls --endpoint-url https://S3-eu-central-1.ionoscloud.com $BUCKET
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment