Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

how can we host static website using global https loadbalancer and cdn keeping bucket private in gcp

how can we host static websites using a global HTTP load balancer and cdn keeping the bucket private in GCP? 

1 1 345
1 REPLY 1

Hi @bansalshivam06 ,

I found a related topic in this community discussion that might answer your question. As stated in this topic, this is not possible, as the bucket must be public at all times. Cloud CDN knows nothing about permissions so giving it permission to read the bucket has no effect. To add to it, buckets cannot be used as a backend for a global HTTP(S) load balancer while keeping the bucket private.

If you need to keep your static content in a private bucket while serving it through a global HTTP(S) load balancer and CDN, you may consider using a solution involving a combination of Cloud Storage and a server (e.g., Compute Engine instance) that acts as a proxy for your private content.