0

I have a Storage Bucket in GCP with a bunch of html files and images (just for testing purposes). Let's call this my-bucket.

I would like this to expose this via Cloud CDN. I was able to create a Cloud CDN for the bucket.

Cloud CDN also created a Load Balancer.

If I try to access the load balancer IP, I get this error.

<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
</Error>

Should I be providing public read access to the bucket? How can I attach a service account to a LB for a better access?

James S
  • 1,181
  • 1
  • 7
RamPrakash
  • 2,218
  • 3
  • 25
  • 54
  • Either make the bucket public or add a Signing Key to the CDN. https://cloud.google.com/cdn/docs/using-signed-urls – John Hanley Sep 08 '22 at 22:02
  • @JohnHanley, If I enable the public access - GCP gives this url - `https://storage.googleapis.com/my-bucket/index.html`. Is there any way to sop and make it serve via LB ? – RamPrakash Sep 09 '22 at 01:43
  • Use your domain name. https://cloud.google.com/load-balancing/docs/https/setup-global-ext-https-serverless#update_dns – John Hanley Sep 09 '22 at 01:54
  • You do not seem to understand the question. never mind. – RamPrakash Sep 09 '22 at 01:59

1 Answers1

2

If your bucket was set as publicly accessible, you can assign your cloud storage as the backend of your load balancer. This way, your bucket will be accessible via the load balancer IP address. This is possible as stated in this documentation.

Marvin Lucero
  • 468
  • 1
  • 8