chientrm
03/08/2023, 2:09 AM80MB/s
Sid | R2
03/08/2023, 2:16 AMchientrm
03/08/2023, 2:29 AMchientrm
03/08/2023, 2:30 AMNot allowed
chientrm
03/08/2023, 2:32 AMchientrm
03/08/2023, 2:33 AMindex.html
Chaika
03/08/2023, 2:44 AMchientrm
03/08/2023, 2:48 AMchientrm
03/08/2023, 2:49 AMindex.html
on R2 web.mudassir
03/08/2023, 7:20 AMR2 storage
can we get the public url of uploaded object.. if yes then how?chientrm
03/08/2023, 7:21 AMr2
public domain.chientrm
03/08/2023, 7:21 AMmudassir
03/08/2023, 7:22 AMwrangler cli
.. in that case, we just get a message upload complete
.. if we need a public url of object in response?chientrm
03/08/2023, 7:23 AMmudassir
03/08/2023, 7:24 AMknpwrs
03/08/2023, 4:52 PMterraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.57.1"
}
}
}
provider "aws" {
alias = "cloudflare"
region = "us-east-1"
access_key = var.cloudflare_r2_access_key
secret_key = var.cloudflare_r2_secret_key
skip_credentials_validation = true
skip_region_validation = true
skip_requesting_account_id = true
endpoints {
s3 = var.cloudflare_r2_endpoint
}
}
resource "aws_s3_bucket" "public_bucket" {
provider = aws.cloudflare
bucket = var.cloudflare_r2_public_bucket
}
resource "aws_s3_bucket_cors_configuration" "public_bucket_cors" {
provider = aws.cloudflare
bucket = aws_s3_bucket.public_bucket.id
cors_rule {
allowed_methods = ["GET"]
allowed_origins = ["*"]
}
}
All of that works, but when I try to configure the ACL with the following:
resource "aws_s3_bucket_acl" "public_bucket_acl" {
provider = aws.cloudflare
bucket = aws_s3_bucket.public_bucket.id
acl = "public-read"
}
I get the following error:
│ Error: error creating S3 bucket ACL for public-bucket: NotImplemented: PutBucketAcl not implemented
│ status code: 501, request id: , host id:
│
│ with aws_s3_bucket_acl.public_bucket_acl,
│ on main.tf line 128, in resource "aws_s3_bucket_acl" "public_bucket_acl":
│ 128: resource "aws_s3_bucket_acl" "public_bucket_acl" {
This makes sense, but now I'm wondering: is there any way to enable "Public URL Access" through terraform, or do I have to use the web console after the bucket is created?giviz
03/08/2023, 5:05 PMwot
03/08/2023, 5:13 PMkian
03/08/2023, 5:17 PMSid | R2
03/08/2023, 5:22 PMgiviz
03/08/2023, 5:22 PMSid | R2
03/08/2023, 5:22 PMSid | R2
03/08/2023, 5:37 PMScheggia
03/08/2023, 6:26 PMkian
03/08/2023, 6:27 PMazurebarry
03/08/2023, 8:11 PMwot
03/08/2023, 9:33 PMsilentdevnull
03/09/2023, 12:05 AMJames
03/09/2023, 12:05 AMsilentdevnull
03/09/2023, 12:12 AMimport render from "render2";
export interface Env {
MY_BUCKET: 'mydevstorage';
}
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
return render.fetch(request, env, ctx);
},
};
I'm still working on learning the whole how workers work.