By gnickm
I just enabled CDN access for my Spaces and was previously using the following to download private objects from the buckets using boto3:
S3_REGION = 'sfo2'
S3_ENDPOINT = 'https://sfo2.digitaloceanspaces.com'
S3_BUCKET = 'mybucket'
AWS_ACCESS_KEY_ID = 'xxx'
AWS_SECRET_ACCESS_KEY = 'zzz'
amzn_s3 = boto3.resource('s3', \
region_name=S3_REGION, \
endpoint_url=S3_ENDPOINT, \
aws_access_key_id=AWS_ACCESS_KEY_ID, \
aws_secret_access_key=AWS_SECRET_ACCESS_KEY)
bucket = amzn_s3.Bucket(S3_BUCKET)
bucket.download_file('remote_file.tar.gz', 'local_file.tar.gz')
How do I pull private objects from CDN? I’ve tried a bunch of variations of S3_REGION and S3_ENDPOINT but can’t seem to make any progress.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.