diff --git a/docs/root/configuration/http/http_filters/wasm_filter.rst b/docs/root/configuration/http/http_filters/wasm_filter.rst index ac3b6d2eb132..8b10dbaf7acd 100644 --- a/docs/root/configuration/http/http_filters/wasm_filter.rst +++ b/docs/root/configuration/http/http_filters/wasm_filter.rst @@ -21,20 +21,11 @@ Example configuration Example filter configuration: -.. code-block:: yaml - - name: envoy.filters.http.wasm - typed_config: - "@type": type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm - config: - config: - name: "my_plugin" - vm_config: - runtime: "envoy.wasm.runtime.v8" - code: - local: - filename: "/etc/envoy_filter_http_wasm_example.wasm" - allow_precompiled: true - +.. literalinclude:: ../../../start/sandboxes/_include/wasm-cc/envoy.yaml + :language: yaml + :lines: 24-49 + :emphasize-lines: 4-21 + :linenos: + :caption: :download:`wasm envoy.yaml <../../../start/sandboxes/_include/wasm-cc/envoy.yaml>` The preceding snippet configures a filter from a Wasm binary on local disk. diff --git a/examples/wasm-cc/envoy.yaml b/examples/wasm-cc/envoy.yaml index a6697ae1c8dd..1d04c7a26f62 100644 --- a/examples/wasm-cc/envoy.yaml +++ b/examples/wasm-cc/envoy.yaml @@ -22,28 +22,29 @@ static_resources: prefix: "/" route: cluster: web_service + http_filters: - name: envoy.filters.http.wasm typed_config: - "@type": type.googleapis.com/udpa.type.v1.TypedStruct - type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm - value: - config: - name: "my_plugin" - root_id: "my_root_id" - configuration: - "@type": "type.googleapis.com/google.protobuf.StringValue" - value: | - {} - vm_config: - runtime: "envoy.wasm.runtime.v8" - vm_id: "my_vm_id" - code: - local: - filename: "lib/envoy_filter_http_wasm_example.wasm" - configuration: {} + "@type": type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm + config: + name: "my_plugin" + root_id: "my_root_id" + # if your wasm filter requires custom configuration you can add + # as follows + configuration: + "@type": "type.googleapis.com/google.protobuf.StringValue" + value: | + {} + vm_config: + runtime: "envoy.wasm.runtime.v8" + vm_id: "my_vm_id" + code: + local: + filename: "lib/envoy_filter_http_wasm_example.wasm" - name: envoy.filters.http.router typed_config: {} + clusters: - name: web_service connect_timeout: 0.25s