---
title: "Update Consume Policy for Virtual Cluster"
method: PUT
path: "/v1/event-gateways/{gatewayId}/virtual-clusters/{virtualClusterId}/consume-policies/{policyId}#DecryptFields"
tags: ["Event Gateway Virtual Cluster Consume Policies"]
---

# Update Consume Policy for Virtual Cluster

`PUT /v1/event-gateways/{gatewayId}/virtual-clusters/{virtualClusterId}/consume-policies/{policyId}#DecryptFields`

Updates an existing consume policy associated with the specified Event Gateway virtual cluster.

## Request body

- EventGatewayParsedRecordDecryptFieldsPolicy — Decrypts fields of parsed Kafka records using AES_256_GCM. Keys are therefore 256 bits long. Note this policy can only be used as a child of a `EventGatewayConsumeSchemaValidationPolicy` policy. **Requires a minimum runtime version of `1.2`**.
  - `type` 'decrypt_fields', required — The type name of the policy.
  - `name` string — A unique user-defined name of the policy.
  - `description` string — A human-readable description of the policy.
  - `enabled` boolean — Whether the policy is enabled.
  - `labels` Labels — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
  - `config` EventGatewayParsedRecordDecryptFieldsConfig, required — The configuration of the decrypt parsed record fields policy.
    - `failure_mode` 'error' | 'skip' | 'passthrough' | 'mark', required — Describes how to handle a failure in a policy applied to consumed records. * `error` - the batch is not delivered to the client. Use sparingly: erroring on a batch causes clients to get stuck on the problematic offset and requires manual intervention to skip it. * `skip` - the record is not delivered to the client. * `passthrough` - passes the record to the client even though policy execution failed. * `mark` - passes the record to the client but marks it with a `kong/policy-failure-<id>` header whose value is the reason for the policy failure (truncated to 512 characters). **Requires a minimum runtime version of `1.2`**.
    - `key_sources` EventGatewayKeySource[], required — Describes how to find a symmetric key for decryption.
      - union — A key source that describes how to find a symmetric key for encryption or decryption. It can be an AWS KMS key source that uses a KMS to find a symmetric key, or a static key source that uses a static symmetric key provided as secrets.
        - EventGatewayAWSKeySource — A key source that uses an AWS KMS to find a symmetric key. Load KMS credentials from the environment. See [aws docs](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/credproviders.html#credproviders-default-credentials-provider-chain) for more information about how credential retrieval.
          - `type` 'aws', required
        - EventGatewayStaticKeySource — A key source that uses static symmetric keys.
          - `type` 'static', required
    - `decrypt_fields` EventGatewayParsedRecordDecryptionSelector, required — Selects fields of a parsed record for decryption.
      - `paths` object[], required
        - `match` string, required — A field selector. It can select nested fields and array entries. Currently supported are exact matches.
  - `condition` string — A string containing the boolean expression that determines whether the policy is applied. When the policy is applied as a child policy of schema_validation, the expression can also reference `record.value` fields.

## Response `200`

Updated consume policy object.

- EventGatewayPolicy — A policy associated with an Event Gateway.
  - `type` string, required — The type name of the policy.
  - `name` string — A unique user-defined name of the policy.
  - `description` string — A human-readable description of the policy.
  - `enabled` boolean — Whether the policy is enabled.
  - `labels` Labels — Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".
  - `id` string, uuid, required — The unique identifier of the policy.
  - `config` object, nullable — The configuration of the policy.
  - `created_at` string, date-time, required — An ISO-8601 timestamp representation of entity creation date.
  - `parent_policy_id` string, uuid, nullable — The unique identifier of the parent policy, if any.
  - `updated_at` string, date-time, required — An ISO-8601 timestamp representation of entity update date.
  - `condition` string — A string containing the boolean expression that determines whether the policy is applied.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden

---

[API](https://skmtc.net/kong/apis/konnect-api.md) · [All operations](https://skmtc.net/kong/apis/konnect-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kong/konnect-api/revisions/06734a9c491f/schema)
