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

Managing R2 objects #2762

Closed
SvanteRichter opened this issue Sep 14, 2023 · 3 comments
Closed

Managing R2 objects #2762

SvanteRichter opened this issue Sep 14, 2023 · 3 comments
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@SvanteRichter
Copy link

SvanteRichter commented Sep 14, 2023

Current Terraform and Cloudflare provider version

Terraform v1.5.7
on linux_amd64

  • provider registry.terraform.io/cloudflare/cloudflare v4.14.0
  • provider registry.terraform.io/hashicorp/aws v4.67.0

Description

Currently it seems like it is not possible to upload/manage R2 objects with terraform. As was noted by @yonran in #1664:

it seems that it is not possible to create a cloudflare object using terraform-provider-aws 4.x aws_s3_object (aka aws_s3_bucket_object), since that resource tries to read the tags using GetObjectTagging (GET /key?tagging=), but R2 does not recognize ?tagging and just returns the object itself.

Since the R2 S3 API does not support the required interface to use the AWS terraform provider and the cloudflare provider does not implement any object-level apis there is no way to manage R2 objects with terraform.

Use cases

I'm trying to upload objects for use with workers that I deploy with the cloudflare provider. It can be frontend resources, backend data, anything object-like that is coupled to a deployment of a worker.

Potential Terraform configuration

Either with the s3 provider (if the cloudflare s3 api starts supporting GetObjectTagging):

resource "aws_s3_object" "dist" {
  bucket = cloudflare_r2_bucket.main_bucket.name
  key    = "test.txt"
  source = "${path.module}/example/dist/test.txt"
  source_hash   = filemd5("${path.module}/example/dist/test.txt")
}

Or with a r2 object resource:

resource "cloudflare_r2_object" "dist" {
  bucket = cloudflare_r2_bucket.main_bucket.name
  key    = "test.txt"
  source = "${path.module}/example/dist/test.txt"
  source_hash   = filemd5("${path.module}/example/dist/test.txt")
}

References

#1664 mentions the issue

@SvanteRichter SvanteRichter added kind/enhancement Categorizes issue or PR as related to improving an existing feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 14, 2023
@github-actions
Copy link
Contributor

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@jacobbednarz jacobbednarz added the triage/duplicate Indicates an issue is a duplicate of other open issue. label Sep 20, 2023
@jacobbednarz
Copy link
Member

jacobbednarz commented Sep 20, 2023

duplicate of #1664. there are still no plans to expose the S3 compatible API via the Go SDK so until such a time, this won't be possible.

@jacobbednarz jacobbednarz closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
@SvanteRichter
Copy link
Author

SvanteRichter commented Sep 20, 2023

@jacobbednarz Are there no plans to offer a cloudflare_r2_object or similar either? This feature request is just having any way to upload objects into an r2 bucket with terraform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes issue or PR as related to improving an existing feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

2 participants