GCP - Add custom domain to Storage bucket

  • Sign in to GCP via the Console home page and navigate to Load Balancing within the Network Services section. Click the Create load balancer button.

  • You’ll need to create a HTTP(S) Load Balancing type of load balancer, click on Start Configuration button.

  • Ensure that From Internet to my VMs or serverless services is selected. This allows internet traffic to reach the load balancer.

  • Give the new load balancer a relevant name, then name the frontend IP and ensure HTTPS.

  • The load balancer will need the IP to be static so it does not change away from what will be configured in DNS later. Click the dropdown for IP address and click Create IP Address

  • Enter a relevant name and description for the Static IP then click Reserve.

  • As you’re creating a load balancer frontend that handles HTTPS traffic it needs a certificate, so within the Certificate dropdown click the Create a new certificate option.

  • In the Create a new certificate panel enter a short and relevant name for the certificate, then select Create Google-managed certificate as the Create mode.

  • In the Create a new certificate panel enter a short and relevant name for the certificate, then select Create Google-managed certificate as the Create mode.

  • In the Domains section add the custom domain you wish to use for the CDN

  • click Create certifiate.

  • configure the backend Storage Bucket. Click Backend configuration, Then click Create A Backend Bucket.

  • Click Browse to open a bucket search window and select the bucket

  • make sure to select the Enable Cloud CDN option within the Cloud CDN section before clicking the Create button.

  • finalize the HTTPS frontend settings by clicking the Done button.

  • review the settings and if all looks good click that Create button!

  • set up the A record for your custom domain using the IP address that you reserved earlier)Load balancer ip)

  • Once both your certificate and DNS changes have provisioned, you can access the bucket contents using custom domain.