Setting up a static website with GCP and Google Domain



This article will cover the setups required to publish a static website on GCP and using a custom domain from Google domain. It assumes we have some content like html page etc. to publish on GCP as static site. Although it is written for domains registered with Google domain, any other domain providers should also work.

Assumptions

We have some static resources like HTML pages to be published.
We have secured a domain name with ownership.
We will be using CNAME to map the domain name to the static page bucket in GCP.

High level steps

1) Setting up the Custom Domain DNS to forward the request to the
2) Setting up the Buckets on Google cloud

Setting DNS on the custom domain 

We want the domain name to be mapped to GCP resource (bucket in our case holding static resources). Setting up the DNS for the custom domain is really simple, we just need to map the CNAME entry in the custom domain DNS section.

Login to Google Domain and go to the DNS setup page for the respective domain. Under the Custom resource records have an entry for www to c.storage.googleapis.com as follows.


Once we save the configuration as above we are good to go to the next section for setting up the static bucket in GCP.

To know more about CNAME and how it works A vs CNAME record explains the advantages of CNAME record and how it works. 

Setting Buckets on Google cloud

Create a bucket whose name matches the CNAME you created for your domain.
For example, if you added a CNAME record pointing www.bootng.com to c.storage.googleapis.com., then create a bucket with the name "www.bootng.com".
To create a bucket:
Open the Cloud Storage browser in the Google Cloud Platform Console.
Click Create bucket to open the bucket creation form.
Enter your bucket information and click Continue to complete each step:
The Name of your bucket.
The Storage class and Location for your bucket.

Click Create.




Once the bucket is created we need to upload the content of the static site and then give appropriate permissions to the individual objects (files directories) or to the bucket itself.

To assign permission to the bucket:

Go to the list of bucket page and corresponding to the bucket just created click on the last column which will open the action menu like bellow and click on Edit bucket permissions link















Since we want to make the content of this bucket publicly available we need to grant read access to a special group called allUsers


Once this is done the bucket list will show that this bucket is available to public access.

Conclusion

With the above setting now when we type www.bootng.com will map to the content of the bucket www.bootng.com on GCP. 

We still need to access resources explicitly for instance if we have welcome.html then we need to type www.bootng.com/welcome.html in the browser

Few things not covered in this article are
1) Mapping default page to the domain name -> so that we can just type www.bootng.com
2) Mapping subdomain to the GCP bucket -> so that we can just type bootng.com











23 comments :

  1. Replies
    1. The effectiveness of IEEE Project Domains depends very much on the situation in which they are applied. In order to further improve IEEE Final Year Project Domains practices we need to explicitly describe and utilise our knowledge about software domains of software engineering Final Year Project Domains for CSE technologies. This paper suggests a modelling formalism for supporting systematic reuse of software engineering technologies during planning of software projects and improvement programmes in Final Year Projects for CSE.

      Software management seeks for decision support to identify technologies like JavaScript that meet best the goals and characteristics of a software project or improvement programme. JavaScript Training in Chennai Accessible experiences and repositories that effectively guide that technology selection are still lacking.

      Aim of technology domain analysis is to describe the class of context situations (e.g., kinds of JavaScript software projects) in which a software engineering technology JavaScript Training in Chennai can be applied successfully

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. I am jovial you take pride in what you write. It makes you stand way out from many other writers that can not push high-quality content like you. UK VPS

    ReplyDelete
  3. News streak... Social Media is setting down deep roots. smm panel

    ReplyDelete
  4. I found your this post while searching for some related information on blog search...Its a good post..keep posting and update the information. renewing a domain name

    ReplyDelete
  5. Thanks, foг ones marvelous posting! I genuinely enjoyed reading it, you miggһt Ƅe a great author. I wiⅼl made certain to booҝmark your blog and ѡill often come back sometime soon. I want to encoᥙrage yourself to continue your great job, have a nice evening!
    Web Development Course
    best web development courses
    web development classes
    web development course near me
    Web Development Training
    training on web development
    web development training program
    web development training course
    web development summer training

    ReplyDelete
  6. What is an outstanding post! “I’ll be back” (to read more of your content). Thanks for the nudge! tetra packaging

    ReplyDelete
  7. Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign. Epik-protocolEPIK

    ReplyDelete
  8. I found your this post while searching for some related information on blog search...Its a good post..keep posting and update the information. combine words

    ReplyDelete
  9. Mindfulness: Here, the purchaser embraces introductory examination, comprehends the issue for which he searches for arrangements (later), perceive the chances, moves his needs. Yellow Pages Scraper

    ReplyDelete
  10. I would recommend my profile is important to me, I invite you to discuss this topic... Best SEO manager

    ReplyDelete
  11. I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. useless website generator

    ReplyDelete
  12. You need to pick the most ideal domain for your site, purchase from a recorder you can trust, and oversee it adequately. Domain Investing

    ReplyDelete
  13. There are a few apparatuses that help to do as such.Website Design Agency

    ReplyDelete
  14. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. visit the website

    ReplyDelete
  15. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work... this page

    ReplyDelete
  16. Cool you write, the information is very good and interesting, I'll give you a link to my site. Email Extractor

    ReplyDelete

Please leave your message queries or suggetions.