You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
convex-backend PR 53: Add support for Cloudflare R2 Storage (#34993)
This PR introduces support for Cloudflare R2 by adding a new environment variable, AWS_ENDPOINT_URL, and replacing get_object_attributes with head_object.
From the [S3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/get_object_attributes.html), get_object_attributes combines the functionality of HeadObject and ListParts in a single call.
In the original code get_object_attributes was used to get the file size.
Since R2 does not support get_object_attributes, I use head_object instead.
@emmaling27 I would like your help on this.
I wanted to name the env variable S3_ENDPOINT_URL but I read that AWS automatically provides AWS_ENDPOINT_URL to lambda functions.
I can see you use `aws_config::defaults(BehaviorVersion::v2024_03_28())` which is equivalent to `aws_config::from_env()`, which I assumed automatically set defaults based on env variables ? From my tests it doesn't seem to do anything.
So right now I call `.endpoint_url(endpoint_url)` explicitly.
What is the best way to make it optional ? (I don't know much about rust)
Right now it's a mandatory variable ⚠️ which is not what we want.
----
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Co-authored-by: Spioune <[email protected]>
GitOrigin-RevId: f465784d59ebd1de2bb1de054669a78e5e68b293
0 commit comments