-
-
Save CypherpunkSamurai/d62ab9148958f7af66fd6693a693cde3 to your computer and use it in GitHub Desktop.
Minio with python boto3
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
# Sample as to how to initialize s3 client to work with Minio API compatible - https://github.com/minio/minio | |
# AWS CLI counterpart - https://docs.minio.io/docs/aws-cli-with-minio | |
import boto3 | |
s3 = boto3.resource('s3', | |
endpoint_url='http://<minio_IP>:9000', | |
config=boto3.session.Config(signature_version='s3v4') | |
) | |
# If credentials are not stored in ~/.aws/credentials location, boto3 must be parametrized like this instead, so it doesn't attempt to acquire a session token at AWS' endpoint | |
s3_target = boto3.resource('s3', | |
endpoint_url='https://<minio>:9000', | |
aws_access_key_id='<key_id>', | |
aws_secret_access_key='<access_key>', | |
aws_session_token=None, | |
config=boto3.session.Config(signature_version='s3v4'), | |
verify=False | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment