Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add endpoint_url to boto3 #2

Open
tsohst opened this issue Aug 14, 2024 · 0 comments
Open

Add endpoint_url to boto3 #2

tsohst opened this issue Aug 14, 2024 · 0 comments

Comments

@tsohst
Copy link

tsohst commented Aug 14, 2024

In the current state the script only seems only to work with AWS .. this fix seems to be able to work with other cloud vendors as well.

# Set up retry logic
retry_config = Config(
    retries={
        'max_attempts': 10,  # Number of retries
        'mode': 'standard'
    }
)

# Open server sessions
session = boto3.Session(
    aws_access_key_id=config["s3"]["key"],
    aws_secret_access_key=config["s3"]["secret"],
    region_name=config["s3"]["region"]
)

# Create an S3 resource with the endpoint URL and retry configuration
s3 = session.resource('s3',
                      endpoint_url=config["s3"]["hostname"],
                      config=retry_config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant