Machine Learning Engineer
In Wizart LLC we are using boto3 client for Python to interact with DigitalOcean Spaces.
After the CDN was enabled for our spaces, we become unable to access data stored in buckets.
For example, stored files can be accessed via the following CDN link:
https://wizart-storage-data-dev.fra1.cdn.digitaloceanspaces.com/interiors/uploaded/images/07IRgHJ2PFhVqVrJDCIpzhghqe4TwK1cSSUXaC4T.jpeg
But boto3 SDK generates URLs like this one given in the form:
https://fra1.cdn.digitaloceanspaces.com/wizart-storage-data-dev/interiors/uploaded/images/07IRgHJ2PFhVqVrJDCIpzhghqe4TwK1cSSUXaC4T.jpeg
which seems to be an invalid CDN URL for DigitalOcean Spaces.
When CDN is not specified - the file is accessible with no problems:
https://fra1.digitaloceanspaces.com/wizart-storage-data-dev/interiors/uploaded/images/07IRgHJ2PFhVqVrJDCIpzhghqe4TwK1cSSUXaC4T.jpeg
Is any workaround can be applied in our case?
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!
Heya,
Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.
Boto3 uses the standard AWS format, but it seems the support for it isn’t fully there yet with DigitalOcean.
A possible workaround is to create URLs manually instead of relying on boto3 to create the URLs. You need to use the following pattern: https://your-space-name.your-region.digitaloceanspaces.com/your-object-key Instead of: https://your-region.your-space-name.digitaloceanspaces.com/your-object-key
If this doesn’t resolve your issue, I recommend reaching out to DigitalOcean support directly through the website.
For more information about working with DigitalOcean Spaces and CDNs, check out the DigitalOcean Spaces Documentation.
Hope that this helps!
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.