0
0
GCPcloud~30 mins

Cloud CDN integration in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Cloud CDN integration
📖 Scenario: You are setting up a website hosted on Google Cloud Platform (GCP). To improve the website's speed and reduce load on your server, you want to use Cloud CDN (Content Delivery Network) to cache content closer to users worldwide.
🎯 Goal: Build a simple Google Cloud configuration that creates a backend service with Cloud CDN enabled, linked to a URL map and HTTP proxy, ready to serve cached content globally.
📋 What You'll Learn
Create a backend service named my-backend-service with Cloud CDN enabled
Create a URL map named my-url-map that routes all requests to my-backend-service
Create a target HTTP proxy named my-http-proxy that uses my-url-map
Create a global forwarding rule named my-forwarding-rule that listens on port 80 and directs traffic to my-http-proxy
💡 Why This Matters
🌍 Real World
Many websites use Cloud CDN to speed up content delivery by caching content closer to users worldwide, reducing latency and server load.
💼 Career
Cloud engineers and DevOps professionals often configure CDN services to optimize web application performance and scalability.
Progress0 / 4 steps
1
Create the backend service
Create a backend service named my-backend-service with Cloud CDN disabled initially.
GCP
Need a hint?

Use the google_compute_backend_service resource with enable_cdn = false for now.

2
Enable Cloud CDN on the backend service
Modify the backend service my-backend-service to enable Cloud CDN by setting enable_cdn = true.
GCP
Need a hint?

Set enable_cdn to true inside the backend service resource.

3
Create URL map and HTTP proxy
Create a URL map named my-url-map that routes all requests to my-backend-service, and create a target HTTP proxy named my-http-proxy that uses my-url-map.
GCP
Need a hint?

Use google_compute_url_map with default_service set to the backend service, and google_compute_target_http_proxy with url_map set to the URL map.

4
Create global forwarding rule
Create a global forwarding rule named my-forwarding-rule that listens on port 80 and directs traffic to the target HTTP proxy my-http-proxy.
GCP
Need a hint?

Use google_compute_global_forwarding_rule with port_range = "80" and target set to the HTTP proxy.