Google Associate Cloud Engineer

Google Associate Cloud Engineer

Get started today

Ultimate access to all questions.


You aim to host a static website on http://www.example.com using Google Cloud Storage for your staff. After creating a bucket named 'example-static-website', uploading 'index.html' and CSS files, and enabling static website hosting, you set up a CNAME record on http://www.example.com to point to c.storage.googleapis.com. However, accessing the website via http://www.example.com does not display the index page. What is the correct action to resolve this issue?




Explanation:

The correct solution is to create a bucket whose name matches the CNAME record for your domain. For instance, if your CNAME record points http://www.example.com to c.storage.googleapis.com, the bucket should be named 'www.example.com'. This is because CNAME records cannot include paths, making options involving path modifications incorrect. Additionally, A records require IP addresses, not hostnames, and there's no concept of a 'Cloud Storage static website server' to restart. The infrastructure for static websites is fully managed by Google Cloud Platform. Therefore, the only viable option is to ensure the bucket name aligns with the domain name specified in the CNAME record.