forge_resource_policy (Resource)
A Resource policy controls authenticated HTTP/HTTPS, PostgreSQL, MySQL, and Redis operations without mixing Resource fields into Access or Content policies. HTTP bodies and PostgreSQL/MySQL results support typed transformations; Redis policies match command metadata and can allow, block, or require approval, withenforcement = "monitor" available to observe matches without enforcing the
outcome.
data_target = "mysql_result" with the same row
and column-path model. Redis has no result transformation target; govern its
commands directly, including approval:
product.id is unavailable for direct Resource gateway connections because
they do not carry trusted endpoint process context. Product-scoped rules do not
match those connections; other applicable Resource rules still do.
The Rego module is only the match predicate. Keep action, data_target, and
redaction, filtering, or approval settings in typed Terraform attributes.
Schema
Required
action(String) Allow, block, flag for review, redact, filter, or require approval for matching Resource operations.id(String) Stable policy identifier.name(String)
Optional
acknowledge_broad_scope(Boolean) Required before enabling a broad disruptive Resource policy.compliance_frameworks(Set of String)conditions(Dynamic) A native HCL Resource condition using Resource fields, includingproduct.idfor originating products on automatically routed traffic,process.id, anddestination.domain;field/op/valueleaves;all,any, andnot; or prior-event, sequence, count, and distinct-value conditions. Set exactly one ofconditionsormodule.description(String)data_target(String) Data transformed byredactorfilter:http_request_body,http_response_body,postgres_result, ormysql_result.devices(Set of String)enabled(Boolean) (default:true)enforcement(String)enforceapplies matching outcomes;monitorrecords what would have happened while allowing traffic. (default:enforce)except(Dynamic) One anonymous exception. Preferexceptionsfor named, reasoned, and optionally expiring exceptions.exceptions(Dynamic) Named scoped exceptions with an ID, reason, optional expiration, and Resource conditions.group_directory_ids(Map of String) Optional map from a configured group name to a Forge directory ID, used only to disambiguate duplicate exact matches.groups(Set of String)labels(Set of String)message(String) Customer-facing guidance returned with a block, approval, or fail-closed transformation.module(String) Aforge.rego.v1module with thedata.forge.resource.matchentrypoint. Set exactly one ofmoduleorconditions.rationale(String)approval_mode(String) Approval mode forrequire_approval:admin_approvalorself_serve.filter_collection_path(String) Collection whose matching entries are removed byfilter.filter_on_unavailable(String)alloworblockwhen filtering cannot be applied safely.filter_operator(String) Comparison used byfilter.filter_path(String) Value tested within each collection entry.filter_value(Dynamic) Typed value compared byfilter.redaction_apply_to(String) Set tomatchesfor match-only redaction.redaction_fake_subtype(String) Synthetic value type used byfakeredaction.redaction_keep_end(Number) Trailing characters retained bypartialredaction.redaction_keep_start(Number) Leading characters retained bypartialredaction.redaction_mask_character(String) Character used bypartialredaction.redaction_paths(Set of String) JSON paths or PostgreSQL/MySQL column paths transformed byredact.redaction_pattern(String) Pattern used for match-only redaction.redaction_replacement(String) Replacement used byconstantredaction.redaction_salt_ref(String) Stable salt reference used byhashredaction.redaction_strategy(String)constant,partial,hash,nullify, orfake.resources(Set of String) Stable Forge Resource IDs governed by this policy.service_accounts(Set of String)severity(String) (default:medium)use_cases(Set of String)user_directory_ids(Map of String) Optional map from a configured user email to a Forge directory ID, used only to disambiguate duplicate exact matches.users(Set of String)
Read-Only
current_revision(Number)definition_sha256(String)module_sha256(String)validation_token(String, Sensitive) Short-lived server plan binding. Managed internally by the provider and never authored.
Import
Import a Resource policy by its stable policy ID:forge.resource Rego input support proven caller
identity, device and process IDs, originating product IDs for automatically
routed traffic, destination domain, Resource identity and
protocol, HTTP request metadata, PostgreSQL and MySQL query metadata, and Redis
user, database, and command metadata. Rego defines
only the match predicate; action, data target, redaction/filter settings, and
approval mode remain typed Terraform attributes.