Skip to main content

rules_tenant

Creates, updates, deletes, gets or lists a rules_tenant resource.

Overview

Namerules_tenant
TypeResource
Idcloudflare.zero_trust.rules_tenant

Fields

The following fields are returned by SELECT queries:

List Zero Trust Gateway rules response.

NameDatatypeDescription
idstringIdentify the API resource with a UUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415)
namestringSpecify the rule name. (example: block bad websites)
actionstringSpecify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to true. (on, off, allow, block, scan, noscan, safesearch, ytrestricted, isolate, noisolate, override, l4_override, egress, resolve, quarantine, redirect) (example: allow)
created_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
deleted_atstring (date-time)Indicate the date of deletion, if any. (x-stainless-terraform-configurability: computed)
descriptionstringSpecify the rule description. (example: Block bad websites based on their host name.)
device_posturestringSpecify the wirefilter expression used for device posture check. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response. (default: , example: any(device_posture.checks.passed[*] in {"1308749e-fcfb-4ebc-b051-fe022b632644"}), x-stainless-terraform-configurability: computed_optional)
enabledbooleanSpecify whether the rule is enabled.
expirationobjectDefines the expiration time stamp and default duration of a DNS policy. Takes precedence over the policy's schedule configuration, if any. This does not apply to HTTP or network policies. Settable only for dns rules. (x-stainless-terraform-configurability: computed_optional)
filtersarraySpecify the protocol or layer to evaluate the traffic, identity, and device posture expressions. Can only contain a single value.
identitystringSpecify the wirefilter expression used for identity matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response. (default: , example: any(identity.groups.name[*] in {"finance"}), x-stainless-terraform-configurability: computed_optional)
precedenceintegerSet the order of your rules. Lower values indicate higher precedence. At each processing phase, evaluate applicable rules in ascending order of this value. Refer to Order of enforcement to manage precedence via Terraform. (x-stainless-terraform-configurability: computed_optional)
read_onlybooleanIndicate that this rule is shared via the Orgs API and read only. (x-stainless-terraform-configurability: computed)
rule_settingsobjectDefines settings for this rule. Settings apply only to specific rule types and must use compatible selectors. If Terraform detects drift, confirm the setting supports your rule type and check whether the API modifies the value. Use API-returned values in your configuration to prevent drift. (x-stainless-terraform-configurability: computed_optional)
scheduleobjectDefines the schedule for activating DNS policies. Settable only for dns and dns_resolver rules. (x-stainless-terraform-configurability: computed_optional)
sharablebooleanIndicate that this rule is sharable via the Orgs API. (x-stainless-terraform-configurability: computed)
source_accountstringProvide the account tag of the account that created the rule. (x-stainless-terraform-configurability: computed)
trafficstringSpecify the wirefilter expression used for traffic matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response. (default: , example: http.request.uri matches ".a/partial/uri." and http.request.host in $01302951-49f9-47c9-a400-0297e60b6a10, x-stainless-terraform-configurability: computed_optional)
updated_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
versionintegerIndicate the version number of the rule(read-only). (x-stainless-terraform-configurability: computed)
warning_statusstringIndicate a warning for a misconfigured rule, if any. (x-stainless-terraform-configurability: computed)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_idList Zero Trust Gateway rules for the parent account of an account in the MSP configuration.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.

SELECT examples

List Zero Trust Gateway rules for the parent account of an account in the MSP configuration.

SELECT
id,
name,
action,
created_at,
deleted_at,
description,
device_posture,
enabled,
expiration,
filters,
identity,
precedence,
read_only,
rule_settings,
schedule,
sharable,
source_account,
traffic,
updated_at,
version,
warning_status
FROM cloudflare.zero_trust.rules_tenant
WHERE account_id = '{{ account_id }}' -- required
;