Set up a Media CDN service

This quickstart shows you how to set up a Media CDN service in front of a Cloud Storage bucket. You can use this configuration for testing or as the basis for a production environment.


To follow step-by-step guidance for this task directly in the Google Cloud console, click Guide me:

Guide me


This page walks you through the following procedures:

  1. Create a Cloud Storage bucket to store your content.
  2. Enable the required services.
  3. Create an EdgeCacheOrigin resource to connect Media CDN to your bucket.
  4. Create an EdgeCacheService resource to configure request routing and caching for content in the origin.
  5. Test whether a response is being cached.

Before you begin

Make sure that you have the following:

Required roles

To get the permissions that you need to complete the tasks in this document, ask your administrator to grant the following roles:

  • roles/networkservices.edgeCacheAdmin: Access to create, update, delete, and manage all Edge Cache resources.
  • roles/networkservices.edgeCacheUser: Access to view and use Edge Cache resources.
  • roles/networkservices.edgeCacheViewer: Read-only access to Edge Cache resources.

To create storage bucket

To enable SSL on Media CDN

You might also be able to get the required permissions with custom roles or other predefined roles.

Create a Cloud Storage bucket

Media CDN content can originate from locations such as a Cloud Storage bucket, a third-party storage location, or a load balancer.

In this quickstart, we'll store content in a Cloud Storage bucket.

  1. Create a publicly accessible Cloud Storage bucket and name it my-bucket.

    If you prefer not to make your Cloud Storage bucket publicly accessible, you must give Media CDN permissions to access the bucket. For more information, see Using private Cloud Storage buckets.