[ Web Proxy ]
URL:
Viewing: https://docs.cloud.google.com/media-cdn/docs/deploy-plugins [Back]  [Original]

Deploy Service Extensions plugins in Media CDN routes  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

Deploy Service Extensions plugins in Media CDN routes Stay organized with collections Save and categorize content based on your preferences.

Preview

This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the Service Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see the launch stage descriptions.

This page describes how to deploy Service Extensions plugins in Media CDN routes.

You can use Media CDN with Service Extensions to add custom code to the request-response processing path. Such customization unlocks a wide variety of lightweight use cases.

For more information about Service Extensions concepts, see Service Extensions overview.

Before you begin

  1. Create a Media CDN origin.
  2. Create a Media CDN service.
  3. Create a plugin by using Service Extensions.

Deploy a Service Extensions plugin in a Media CDN route

To deploy a Service Extensions plugin in a Media CDN route, follow these steps:

  1. To export the current configuration of your service to a YAML file, run the gcloud edge-cache services export command:

      gcloud edge-cache services export SERVICE_NAME \
          --destination=FILENAME.yaml
    

    Replace the following:

    • SERVICE_NAME: the name of the Media CDN service
    • FILENAME: the name of the YAML file
  2. In Cloud Shell, use a text editor to edit the YAML file.

  3. Update the routes in the file to add the wasmAction header as shown in the following example:

      name: SERVICE_NAME
      routing:
        hostRules:
        - hosts:
          - DOMAIN_NAME 
          pathMatcher: routes
        pathMatchers:
        - name: routes
          routeRules:
          - priority: '1'
            description: Route 1
            matchRules:
            - prefixMatch: /plugins
            origin: projects/PROJECT_NUMBER/locations/global/edgeCacheOrigins/ORIGIN_NAME
            routeAction:
              wasmAction: projects/PROJECT_NUMBER/locations/global/wasmActions/WASM_ACTION
    

    Replace the following:

    • SERVICE_NAME: the name of the Media CDN service
    • DOMAIN_NAME: the domain of the Media CDN service
    • PROJECT_NUMBER: the project number
    • ORIGIN_NAME: the origin for the content
    • WASM_ACTION: the Service Extensions Wasm action
  4. Save the YAML file.

  5. Run the gcloud edge-cache services import command:

      gcloud edge-cache services import SERVICE_NAME \
          --source=FILENAME.yaml
    
Note: Service Extensions plugins run after all other configurable features of Media CDN are executed.

What's next

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-11 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-11 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page