Last active
September 21, 2022 19:08
-
-
Save katzefudder/5d8836f3fd753a086f90e8f957a21838 to your computer and use it in GitHub Desktop.
Using Ionos Cloud S3 with Boto3 and AWS CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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