terraform-provider-cloudflare icon indicating copy to clipboard operation
terraform-provider-cloudflare copied to clipboard

R2 custom domain

Open FlorianLudwig opened this issue 1 year ago • 8 comments

Current Terraform and Cloudflare provider version

terraform: v1.4.6 provider: 4.8.0

Description

Currently it is not possible to configure public access to a R2 bucket via the terraform provider.

Use cases

See https://developers.cloudflare.com/r2/buckets/public-buckets/

Potential Terraform configuration

resource "cloudflare_r2_bucket" "example" {
  account_id = "f037e56e89293a057740de681ac9abbe"
  name       = "terraform-bucket"
  location   = "enam"

  public_access {
    enabled = true
    custom_domains = ["media.example.org", "media.example.com"]
  }

}

References

No response

FlorianLudwig avatar Jun 17 '23 15:06 FlorianLudwig

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.

github-actions[bot] avatar Jun 17 '23 15:06 github-actions[bot]

i notice this isn’t even available through the public API yet, but once it is, I may be able to work on that.

randomairborne avatar Jun 20 '23 17:06 randomairborne

Switching over to Cloudflare as a result of the Google killing off Google Domains, but the inability to automate this via Terraform is a big bummer, previously my static websites were completely Terraform-managed.

leonbreedt avatar Aug 05 '23 01:08 leonbreedt

We are trying to import our assets from CF into terraform, and it would be really nice if this would all hook in nicely.

mrmason avatar Sep 21 '23 10:09 mrmason

Would be cool to have a more advanced version of cloudflare_r2_bucket. Now I rely on the AWS resource to setup CORS etc, which isn't very stable when used by other providers.

The inability to automatically setup a bucket is a big deal breaker for enterprise-level projects...

michielswaanen avatar Oct 10 '23 12:10 michielswaanen

hmm, this seems a bit half-assed

is there a workaround... e.g. is there a private bucket url or something that I can use with a Record resource to manually set up the same thing that the custom domain feature does?

At the moment it looks like I'd have a better time with S3 + CloudFront

anentropic avatar Dec 25 '23 23:12 anentropic

Hello, is there any update on this? Will these be implemented anytime soon? I was wanting to manage a public bucket (with the additional DNS records). I also found a similar issue on the Cloudflare boards.

https://community.cloudflare.com/t/adding-custom-domains-to-r2-buckets/504805

Thanks

c-ameron avatar Jan 02 '24 15:01 c-ameron

is there a workaround

there's some undocumented API
POST  /client/v4/accounts/${account_id}/r2/buckets/${bucket}/custom_domains
{
  domain: ${domain}
  zoneId: ${zone_id}
  zoneName: ${zone_name}
}
PUT /client/v4/accounts/${account_id}/r2/buckets/${bucket}/policy?access=CnamesOnly&cname=${domain}&cname=${otherDomain}&...
DELETE /client/v4/accounts/${account_id}/r2/buckets/${bucket}/custom_domains/${domain}

but I'm guessing it's undocumented for a reason

wolf-cosmose avatar Jan 08 '24 14:01 wolf-cosmose

This issue has been closed as we are now tracking this internally with service teams directly. If you would like an update or to be notified when/if the product ships with this change, please reach out to Cloudflare Support or your account team who can watch the internal feature request for you.

jacobbednarz avatar Mar 25 '24 00:03 jacobbednarz

@jacobbednarz I highly disagree with you marking this issue as "completed" just because you are also tracking it in another system now. Especially since you indicate you may not even implement this.

This issue tracker is the place for external users to track and be notified when an issue is completed. It is absolutely ludicrous to expect everyone to reach out to Cloudflare support now, to get them to notify each of us individually when the feature is completed.

markbaird avatar Mar 25 '24 13:03 markbaird

@markbaird very bizarre, indeed. So 2007 or something. And certainly not how GitHub issues are intended to be used.

jakubadamw avatar Mar 26 '24 11:03 jakubadamw

I'm surprised that this a) isn't possible; but more so that b) it got removed from public view when people are actively asking for it. I think it's great that it's being worked on internally; but surely there's a better process than asking people to work with CF support in order to track its progress.

humphd avatar Apr 01 '24 01:04 humphd