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 the2) 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
Thanks for posting such a good blog it is really useful for everyone.
ReplyDeletePlease keep posting the updates.
Oracle Training in Chennai | Certification | Online Course Training | Oracle Training in Bangalore | Certification | Online Course Training | Oracle Training in Hyderabad | Certification | Online Course Training | Oracle Training in Online | Certification | Online Course Training | Hadoop Training in Chennai | Certification | Online Course Training
wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
ReplyDeleteThis article resolved my all queries. PHP Training in Chennai | Certification | Online Training Course | Machine Learning Training in Chennai | Certification | Online Training Course | iOT Training in Chennai | Certification | Online Training Course | Blockchain Training in Chennai | Certification | Online Training Course | Open Stack Training in Chennai |
Certification | Online Training Course
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
ReplyDeleteWhat is an outstanding post! “I’ll be back” (to read more of your content). Thanks for the nudge! tetra packaging
ReplyDeleteVery informative post! There is a lot of information here that can help any business get started with a successful social networking campaign. Epik-protocolEPIK
ReplyDeleteI 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
ReplyDeleteThe 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.
ReplyDeleteSoftware 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
I would recommend my profile is important to me, I invite you to discuss this topic... Best SEO manager
ReplyDeleteYou need to pick the most ideal domain for your site, purchase from a recorder you can trust, and oversee it adequately. Domain Investing
ReplyDeleteThere are a few apparatuses that help to do as such.Website Design Agency
ReplyDeleteExcellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. visit the website
ReplyDeleteI 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
ReplyDeleteAn awesome blog thanks a lot for giving me this great opportunity to write on this.
ReplyDeletegiá vé máy bay đi nhật bản xuất khẩu lao động
dịch vụ cách ly tại khách sạn
phỏng vấn xin visa kết hôn Hàn Quốc
Lệ phí xin visa Nhật Bản
Nice Post. Keep sharing more and more web development company in hyderabad
ReplyDeleteweb designers in hyderabad
Keep up the good work , I read few posts on this web site and I conceive that your blog is very interesting
ReplyDeleteSăn vé máy bay 0 đồng tu itali ve Viet Nam
mua ve may bay gia re tu Ha Lan ve Viet Nam
Ve may bay Vietjet tu New Zealand ve Viet Nam
vé máy bay từ nga về tphcm
các chuyến bay từ đức về việt nam hôm nay
giá thuê máy bay từ anh về việt nam
This post is so helfull and informative.keep updating with more information...
ReplyDeleteSkills Needed For Data Science
Career In Data Science
tiktok jeton hilesi
ReplyDeletetiktok jeton hilesi
binance referans kimliği
gate güvenilir mi
tiktok jeton hilesi
paribu
btcturk
bitcoin nasıl alınır
As a newbie to the design development field, I find this blog really helpful, thanks.
ReplyDeleteGlassWire Elite Activation Key provides you fantastic info and simplifies the system identification that at which the infected document GlassWire 2022 Activation Key
ReplyDeleteReimage License Key 2022 updated lists Reimage PC Repair. Reimage License Key Is LifeTime Activate Daily update Keys. Reimage Pc Repair Online License Key Free
ReplyDelete