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:
This page walks you through the following procedures:
- Create a Cloud Storage bucket to store your content.
- Enable the required services.
- Create an
EdgeCacheOriginresource to connect Media CDN to your bucket. - Create an
EdgeCacheServiceresource to configure request routing and caching for content in the origin. - Test whether a response is being cached.
Before you begin
Make sure that you have the following:
Access to Media CDN for your current project.
The Google Cloud CLI installed. Use version 345.0.0 or later.
If required, use
gcloud versionto check the version andgcloud components updateto update your installed gcloud CLI.The gcloud CLI provides the
gcloud edge-cachesub-command group for managing both new and existing Media CDN configurations.The Identity and Access Management (IAM) permissions required to create Media CDN resources.
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
- Storage Admin role
(
roles/storage.admin)
To enable SSL on Media CDN
- Certificate Manager Editor role (
roles/certificatemanager.editor)
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.
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.