- [HTTP request](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations/updateCmekConfig#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations/updateCmekConfig#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations/updateCmekConfig#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations/updateCmekConfig#body.request_body)
- [Response body](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations/updateCmekConfig#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations/updateCmekConfig#body.aspect)
- [Try it!](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations/updateCmekConfig#try-it)

Creates or Updates a CMEK config.

Updates the Customer Managed Encryption Key associated with the Cloud Tasks location (Creates if the key does not already exist). All new tasks created in the location will be encrypted at-rest with the KMS-key provided in the config.

### HTTP request

`PATCH https://cloudtasks.googleapis.com/v2/{cmekConfig.name=projects/*/locations/*/cmekConfig}`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `cmekConfig.name` | `string` Output only. The config resource name which includes the project and location and must end in 'cmekConfig', in the format projects/PROJECT_ID/locations/LOCATION_ID/cmekConfig\` |

### Query parameters

| Parameters ||
|---|---|
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` List of fields to be updated in this request. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/CmekConfig`.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/CmekConfig`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/cloud-tasks`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).