> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ECS Terraform inputs

> Complete inputs reference for the Runlayer ECS Terraform module (generated from variables.tf)

> [!NOTE]
>
> Customer-facing inputs for the ECS Terraform module. Internal/debug and
> Runlayer-fleet-only variables are omitted. Examples and defaults are
> placeholders — do not paste real API keys, customer names, or
> account-specific identifiers. See the
> [ECS + Terraform guide](https://docs.runlayer.com/deployment/terraform.md) for deploy steps and examples.
> For corporate egress filters / SWG allowlists, see
> [Self-Hosted Egress Requirements](https://docs.runlayer.com/deployment/egress-requirements.md).

## Requirements

| Name | Version |
| - | - |
| Terraform / OpenTofu | `>= 1.12.0` |
| `hashicorp/aws` | `>= 6.68.0, < 7.0.0` |
| `hashicorp/random` | `~> 3.9` |

Providers must be passed into the module: `aws` and `aws.route53`.
AWS provider 6.68.0 adds the AgentCore runtime `platform_version` argument; 6.64.0 added the alarm warm-up used by ToolGuard registration monitoring.
When upgrading this module, upgrade any older AWS provider selection in your
dependency lock file before planning.

## Naming constraints

| Input | Constraint |
| - | - |
| `project` | 1–10 chars; `^[a-zA-Z0-9-]+$` |
| `environment` | `production` \| `staging` \| `development` |

This module exposes **299** inputs (**5** required). Deprecated no-op inputs, kept only so existing callers still plan, are not listed.

## Core

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `region` | AWS region | `string` | n/a (required) | yes |
| `domain_name` | Domain name for the application (required) **Validation:** Domain name is required for all deployments. | `string` | n/a (required) | yes |
| `account` | AWS account ID | `string` | n/a (required) | yes |
| `app_version` | Application version used to build default ECR image tags (mutually exclusive with ecr\_repositories). **Validation:** app\_version cannot be an empty string.; Provide either app\_version or ecr\_repositories, not both. | `string` | `null` | no |
| `app_build` | Build behind a pinned public app\_version (e.g. 1.28.1407 for 1.29.0) or behind the tags or digests in ecr\_repositories, used as the Sentry release and as the version of digest-pinned images. Leave unset for the module's default version, whose build it knows. **Validation:** app\_build cannot be an empty string.; app\_build needs app\_version or ecr\_repositories. | `string` | `null` | no |
| `ecr_repositories` | Map of service names to their ECR repository URIs (backend, worker, frontend required). Overrides the module defaults. **Validation:** ecr\_repositories cannot be an empty map. Provide image URIs for all services or omit to use defaults.; ECR repository URIs must be either public ECR (public.ecr.aws/namespace/repo:tag) or private ECR (account.dkr.ecr.region.amazonaws.com/repo:tag) format; Each ECR repository URI must include an explicit image tag or digest (no implicit latest).; ecr\_repositories must include backend, frontend, and worker entries. | `map(string)` | `null` | no |
| `project` | Project name **Validation:** Project name must be between 1 and 10 characters.; Project name must contain only alphanumeric characters and hyphens. | `string` | `"anysource"` | no |
| `environment` | Environment (production, staging, development) **Validation:** Environment must be one of: production, staging, development | `string` | `"production"` | no |
| `customer_id` | Customer identifier for this deployment (defaults to domain name for telemetry tagging) | `string` | `""` | no |
| `deployment_name` | Human-readable deployment name for telemetry (e.g. production, staging, `sandbox-<dev>`); defaults to environment when empty | `string` | `""` | no |
| `infra_version` | Infrastructure version for tracking deployment changes in Sentry (defaults to app image tag when not provided) | `string` | `""` | no |
| `additional_tags` | Additional tags for deployment workload resources (see README coverage). Empty by default; partner attribution requires explicit caller opt-in. Resource-specific tags take precedence. **Validation:** The aws-apn-id tag must use `pc:<Marketplace product code>`. Verify the code and resource ownership before enabling attribution.; additional\_tags must not replace a different aws-apn-id from provider default\_tags. Resolve attribution ownership first. | `map(string)` | `{}` | no |
| `deletion_protection` | Enable deletion protection for RDS clusters | `bool` | `true` | no |

## Auth & catalog

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `auth_client_id` | Auth client ID for authentication. This will be provided by the Runlayer team. **Validation:** auth\_client\_id must not be empty. Ask Runlayer support for your auth\_client\_id. | `string` | n/a (required) | yes |
| `auth_api_key` | Auth API key for authentication. This will be provided by the Runlayer team. Required in input mode (`tenant_secret_source = "input"`, the default); must be unset in provisioned mode, where Runlayer writes `AUTH_API_KEY` to the provisioned tenant secret. **Validation:** auth\_api\_key must not be empty. Ask Runlayer support for your auth\_api\_key. *(sensitive)* | `string` | `""` | input mode |
| `tenant_secret_source` | Where the WorkOS, Sentry and Resend keys (`AUTH_API_KEY`, `SENTRY_DSN`, `SENTRY_RELAY_*`, `RESEND_API_KEY`) come from. `"input"` (default): the `auth_api_key` input plus the WorkOS Vault fetch, written to the app secret by Terraform. `"provisioned"`: Runlayer creates and fills `restricted/<project>-<env>-provisioned` before the apply; Terraform only looks it up (output `provisioned_tenant_secret_name`), tasks read the keys from it, the WorkOS Vault fetch is skipped and `auth_api_key` must be unset. The Distribution reader key is unaffected. **Validation:** tenant\_secret\_source must be "input" or "provisioned". | `string` | `"input"` | no |
| `directory_sync_enabled` | Deprecated. Mapped onto DIRECTORY\_SYNC\_EVENT\_SYNC\_ENABLED for compatibility; event sync now runs on the worker service. | `bool` | `true` | no |
| `directory_sync_interval_minutes` | Deprecated. Mapped onto DIRECTORY\_SYNC\_EVENT\_CRON for compatibility (exact below 60 minutes, hourly-approximate above). **Validation:** Directory sync interval must be between 1 and 1440 minutes (24 hours) | `number` | `10` | no |
| `mcp_catalog_api_url` | URL of the MCP Catalog API service. If empty, backend uses default. | `string` | `""` | no |
| `mcp_catalog_api_key` | API key for MCP Catalog API authentication *(sensitive)* | `string` | *(sensitive — omitted)* | no |

## VPC & networking

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `vpc_cidr` | VPC CIDR. Still required to match the real VPC CIDR when using `existing_vpc_id` (default `10.0.0.0/16`); used for security-group / allowlist CIDR rules even when the module does not create the VPC. | `string` | `"10.0.0.0/16"` | no |
| `region_az` | Availability zones for the main VPC and RDS. Empty picks the first three in the region. It also places a module-created AgentCore consumer VPC, which otherwise uses the AZs whose zone IDs AgentCore supports; the plan fails if a listed AZ is not supported there. | `list(string)` | `[]` | no |
| `single_nat_gateway` | Use a single NAT Gateway instead of one per AZ (cost savings for non-prod) | `bool` | `false` | no |
| `enable_ipv6` | Enable IPv6 networking for managed VPCs, dual-stack ALBs, AAAA DNS records, and IPv6 security group/WAF rules. Set false for IPv4-only VPCs. | `bool` | `true` | no |
| `private_subnets` | Private subnets (CIDR blocks for VPC creation) | `list(string)` | `["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]` | no |
| `public_subnets` | Public subnets (CIDR blocks for VPC creation) | `list(string)` | `["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]` | no |
| `vpc_flow_log_cloudwatch_log_group_name` | Optional explicit CloudWatch log group name for main VPC Flow Logs. When null, the VPC submodule keeps its generated random-suffix name. | `string` | `null` | no |
| `vpc_flow_log_iam_role_name` | Optional explicit IAM role name for main VPC Flow Logs. When null, the VPC submodule keeps its generated random-suffix name. | `string` | `null` | no |
| `private_additional_transit_gateway_routes` | Additional IPv4 routes to add to every private route table via a transit gateway. Only applies when this module creates the VPC. | `list(object({ cidr_block = string transit_gateway_id = st...` | `[]` | no |
| `existing_vpc_id` | ID of an existing VPC to use instead of creating a new one. If provided, existing\_private\_subnet\_ids and existing\_public\_subnet\_ids must also be provided. | `string` | `null` | no |
| `existing_private_subnet_ids` | List of existing private subnet IDs to use. Required if existing\_vpc\_id is provided. | `list(string)` | `null` | no |
| `existing_public_subnet_ids` | List of existing public subnet IDs to use. Required if existing\_vpc\_id is provided. | `list(string)` | `null` | no |
| `cross_account_hosted_zone_id` | Hosted zone ID for cross-account DNS validation (e.g., runlayer.com zone in management account). When set, caller must pass aws.route53 provider alias to module and configure cross-account access in that provider. | `string` | `""` | no |
| `vpc_peering_connections` | Map of VPC peering connections to accept and configure routes for. Only works when creating a new VPC (not with existing\_vpc\_id). Optional - defaults to no peering. SECURITY: peer\_owner\_id is now REQUIRED for all connections to prevent accepting connections from unknown sources. **Validation:** All VPC peering connections must have peer\_owner\_id specified. This is required for security validation to ensure you only accept connections from known and trusted AWS accounts.; VPC peering CIDR blocks must not overlap with the current VPC CIDR. Overlapping CIDR blocks cause routing conflicts and are not allowed. Please ensure peer\_vpc\_cidr does not overlap with vpc\_cidr. | `map(object({ peering_connection_id = string # VPC peering...` | `{}` | no |
| `enable_vpc_endpoints` | Enable VPC endpoints for AWS services to reduce NAT Gateway costs. Creates endpoints for S3 (gateway, FREE), ECR API, ECR Docker, and CloudWatch Logs (3 interface endpoints, \~\$21.60/month). Only applies when creating a new VPC (not with existing\_vpc\_id). | `bool` | `true` | no |

## ALB, DNS & WAF

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `alb_access_type` | ALB access type (public allows internet access, private restricts to VPC) **Validation:** ALB access type must be 'public' or 'private'. | `string` | `"public"` | no |
| `alb_allowed_cidrs` | CIDR blocks allowed to access the ALB **Validation:** alb\_allowed\_cidrs must not contain 0.0.0.0/0 when alb\_access\_type is private. | `list(string)` | `["0.0.0.0/0"]` | no |
| `alb_allowed_ipv6_cidrs` | IPv6 CIDR blocks allowed to access the ALB **Validation:** alb\_allowed\_ipv6\_cidrs must not contain ::/0 when enable\_ipv6 is true and alb\_access\_type is private. | `list(string)` | `["::/0"]` | no |
| `alb_additional_inbound_security_group_ids` | Additional security group IDs allowed to reach the ALB | `list(string)` | `[]` | no |
| `alb_internal_allowed_cidrs` | Additional CIDR blocks allowed to access the internal ALB in dual ALB mode. Effective internal ALB CIDRs are vpc\_cidr + peered VPC CIDRs + this list. **Validation:** alb\_internal\_allowed\_cidrs requires enable\_dual\_alb = true. | `list(string)` | `[]` | no |
| `alb_internal_allowed_ipv6_cidrs` | Additional IPv6 CIDR blocks allowed to access the internal ALB in dual ALB mode. **Validation:** alb\_internal\_allowed\_ipv6\_cidrs requires enable\_dual\_alb = true. | `list(string)` | `[]` | no |
| `enable_dual_alb` | Enable dual ALB setup (public + internal) for split-horizon DNS. When enabled, creates both a public ALB for internet traffic and an internal ALB for private network traffic. | `bool` | `false` | no |
| `enable_managed_secret_store` | Provision the Runlayer-managed secret store for browser logins: a key-admin IAM role that creates one KMS key per organization, and the task-role tag those keys trust. Org keys live outside Terraform, so turning this off leaves them in place. Ignored in stateless roots. **Precondition:** requires `additional_backend_env_vars.IN_POD_STDIO = "off"`. | `bool` | `false` | no |
| `private_hosted_zone_id` | Existing Route53 private hosted zone ID to use for internal DNS. If not provided and enable\_dual\_alb is true, a new private hosted zone will be created. | `string` | `""` | no |
| `manage_service_vpc_private_hosted_zone_association` | Whether to associate the service VPC with private\_hosted\_zone\_id. Set false when another Terraform stack already manages that service VPC association. **Validation:** manage\_service\_vpc\_private\_hosted\_zone\_association = false is only meaningful when private\_hosted\_zone\_id is set. | `bool` | `true` | no |
| `private_hosted_zone_vpc_id` | VPC ID to associate with the private hosted zone. If empty, uses the service VPC (local.vpc\_id). | `string` | `""` | no |
| `private_hosted_zone_additional_vpc_ids` | Additional VPC IDs to associate with the private hosted zone (e.g., for VPC peering scenarios). Same-account associations only; cross-account requires AWS RAM. | `list(string)` | `[]` | no |
| `ssl_certificate_arn` | Existing SSL certificate ARN (optional - will look up wildcard certificate if not provided) | `string` | `""` | no |
| `enable_acm_dns_validation` | Create a new ACM certificate with DNS validation (false = look up existing wildcard cert) | `bool` | `false` | no |
| `create_dns_records` | Create Route53 ALIAS record pointing domain to ALB (requires hosted\_zone\_name) | `bool` | `false` | no |
| `hosted_zone_name` | Route53 hosted zone name for DNS records and/or ACM validation (required when create\_dns\_records or enable\_acm\_dns\_validation is true) **Validation:** hosted\_zone\_name must be provided when enable\_acm\_dns\_validation or create\_dns\_records is true. | `string` | `""` | no |
| `alb_5xx_alarm_period` | Period (seconds) of each ALB 5XX rate datapoint. The alarm evaluates 3 periods. | `number` | `300` | no |
| `alb_5xx_alarm_threshold_percent` | ALB 5XX alarm threshold: percent of requests answered with an ALB-generated 5XX, in 2 of 3 periods of alb\_5xx\_alarm\_period seconds. Periods under 50 requests never breach. **Validation:** alb\_5xx\_alarm\_threshold\_percent must be in (0, 100). | `number` | `2` | no |
| `target_group_deregistration_delay` | Deregistration delay in seconds for ALB target groups. Must exceed the longest in-flight MCP call (MCP\_REQUEST\_TIMEOUT = 104s) so the ALB doesn't sever it mid-drain. **Validation:** target\_group\_deregistration\_delay must be between 0 and 3600 seconds. | `number` | `120` | no |
| `blocked_path_patterns` | URL path patterns blocked at the public ALB with a 404 (private-only paths, still served on the internal ALB) | `list(string)` | `[]` | no |
| `waf_enable_ip_allowlisting` | Enable WAF IP allowlisting to restrict ALB access to specific IPv4 and/or IPv6 CIDR blocks | `bool` | `false` | no |
| `waf_allowlist_ipv4_cidrs` | List of user-supplied IPv4 CIDR blocks to allowlist in the WAF (e.g., \['1.2.3.4/32', '10.0.0.0/8']). The effective IPv4 allowlist also includes the sandbox VPC NAT EIPs. **Validation:** When waf\_enable\_ip\_allowlisting is true, provide at least one IPv4 CIDR block. | `list(string)` | `[]` | no |
| `waf_allowlist_ipv6_cidrs` | List of user-supplied IPv6 CIDR blocks to allowlist in the WAF (e.g., \['2001:db8::/48']) **Validation:** When waf\_enable\_ip\_allowlisting and enable\_ipv6 are true, provide at least one IPv6 CIDR block. | `list(string)` | `[]` | no |
| `waf_webhook_allowlist_ipv4_cidrs` | Additional IPv4 sources admitted only for POST agent webhook invocation; managed WAF rules and webhook authentication still apply. **Validation:** Nonempty lists require waf\_enable\_ip\_allowlisting = true. Each entry must be a valid IPv4 CIDR with prefix length 1–32. Invalid configurations fail planning; empty lists remain valid when allowlisting is disabled. | `list(string)` | `[]` | no |
| `waf_webhook_allowlist_ipv6_cidrs` | Additional IPv6 sources admitted only for POST agent webhook invocation; managed WAF rules and webhook authentication still apply. **Validation:** Nonempty lists require waf\_enable\_ip\_allowlisting = true and enable\_ipv6 = true. Each entry must be a valid IPv6 CIDR with prefix length 1–128. Invalid configurations fail planning; empty lists remain valid when either feature is disabled. | `list(string)` | `[]` | no |
| `waf_allowlist_exempt_uri_path_prefixes` | URI path prefixes exempt from WAF IP allowlist blocking (e.g., \['/.well-known/oauth-client/']). Use for endpoints that must stay publicly reachable, such as CIMD documents fetched by upstream OAuth servers. AWS managed rules still apply. Empty list disables exemptions. **Validation:** Each waf\_allowlist\_exempt\_uri\_path\_prefixes entry must start with '/' followed by at least one character. | `list(string)` | `[]` | no |
| `bad_inputs_count_uri_regex` | URI path regex for requests whose AWSManagedRulesKnownBadInputsRuleSet body matches count instead of block. Header, path, query and method matches still block. Defaults to the client routes whose bodies carry user code or tool I/O: AI Watch hooks and scans, prompt scans, local MCP pre/post checks and tool sync, skill and plugin uploads, and skill file sync and scoring. Set empty to disable count-mode path matching. | `string` | `"^/api/v1/(ai-watch/(scan\|inventory\|(skills\|plugins)/submit(-batch)?)\|hooks/(cursor\|events(/batch)?\|mcp-usage(/batch)?\|prompt/pre\|tool/(pre\|post))\|local/[0-9a-fA-F-]{36}/(pre\|post\|capabilities)\|skills/[0-9a-fA-F-]{36}/files(/[0-9a-fA-F-]{36})?\|security/score/skill)$"` | no |
| `bad_inputs_count_user_agent` | User-Agent substring also required for bad\_inputs\_count\_uri\_regex count mode. Empty matches by URI path only, which covers every client of those routes (CLI, browser extension, agent sandbox, SDKs). | `string` | `""` | no |
| `client_ip_header` | HTTP header a trusted proxy sets to the client IP (for example `CF-Connecting-IP`). Rate limits, audit `ip_address` and the `meta.request.ip` policy field all read it when set and carrying an IP. When empty (default), the client IP is the `X-Forwarded-For` entry `trusted_proxy_hops` positions from the end, the one the ALB appended. For ECS with ALB, leave empty. | `string` | `""` | no |
| `trusted_proxy_hops` | How many trailing `X-Forwarded-For` entries your own proxies append, the client being the first of them. Rate limits, audit `ip_address` and the `meta.request.ip` policy field key on that entry; everything before it is caller-supplied. `1` (default) when the ALB is the only proxy in front of the backend; raise it by one for each extra appending proxy you place in front of the ALB. Used when `client_ip_header` is unset or carries no IP. **Validation:** whole number of at least 1. | `number` | `1` | no |

## PrivateLink & tunnels

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `enable_privatelink` | Enable an AWS PrivateLink endpoint service backed by an internal Network Load Balancer. Consumers connect with interface VPC endpoints using the privatelink\_service\_name output. | `bool` | `false` | no |
| `privatelink_allowed_principals` | AWS principal ARNs allowed to create interface VPC endpoints to this PrivateLink service, usually customer account root ARNs. **Validation:** privatelink\_allowed\_principals entries must be IAM principal ARNs, such as arn:aws:iam::123456789012:root. | `list(string)` | `[]` | no |
| `privatelink_acceptance_required` | Whether PrivateLink endpoint connection requests require manual acceptance by the service owner. In AgentCore VPC mode the module consumes its own service and accepts that connection itself, and the accepter can fire while the endpoint is still provisioning and then wait out its 20-minute timeout; set false when this account is the only consumer. Set it before the first VPC-mode apply: turning it off later destroys the accepter, which rejects the live connection. | `bool` | `true` | no |
| `privatelink_subnet_ids` | Optional subnet IDs for the internal PrivateLink NLB. Defaults to the module private subnets. **Validation:** privatelink\_subnet\_ids must be null or contain at least one subnet ID. | `list(string)` | `null` | no |
| `privatelink_additional_supported_regions` | Additional Regions from which service consumers can create cross-Region interface VPC endpoints to this PrivateLink service. The service host region is always included automatically from region. | `set(string)` | `[]` | no |
| `private_connection_types` | Enabled private-connection types ("aws\_privatelink", "tunnel"). Empty disables private connections; delete all connections before removing a type. **Validation:** private\_connection\_types entries must be "aws\_privatelink" or "tunnel".; The "tunnel" private-connection type requires runlayer\_deploy\_use\_shared\_sg = false.; The tunnel type requires enable\_vpc\_endpoints = true when the module manages the VPC. | `list(string)` | `[]` | no |
| `tunnel_router_listener_priority` | HTTPS listener-rule priority for the public /tunnel route. **Validation:** tunnel\_router\_listener\_priority must be an unused integer between the /mcp alias and frontend catch-all priorities, and must differ from llm\_gateway\_listener\_priority when the LLM gateway is enabled. | `number` | `13` | no |
| `tunnel_aws_endpoint_security_group_id` | Existing-VPC security group dedicated to the ECR API, ECR DKR, CloudWatch Logs, and Secrets Manager interface endpoint ENIs used by tunnel tasks. Required when tunnel connections use an existing VPC; its endpoint associations must exist before this module evaluates them, and it must not be attached to any other ENI. **Validation:** Existing-VPC tunnel connections require tunnel\_aws\_endpoint\_security\_group\_id. | `string` | `null` | no |
| `tunnel_image_tag` | Shared tunnel router, endpoint, and connector image bundle tag. Omit to use the module's release default. **Validation:** tunnel\_image\_tag must be semver or a 40-character lowercase git SHA. | `string` | `"0.6.0"` | no |
| `tunnel_trace_sample_ratio` | Parent-based trace ID sampling ratio for tunnel-router and tunnel-endpoint OTEL traces. Metrics are not sampled. **Validation:** tunnel\_trace\_sample\_ratio must be between 0 and 1. | `number` | `0.1` | no |
| `tunnel_otel_collector_desired_count` | Number of deployment-local OTEL Collector tasks for tunnel metrics and traces. Changing only this value scales the collector service without replacing tunnel tasks. **Validation:** tunnel\_otel\_collector\_desired\_count must be a positive integer. | `number` | `1` | no |
| `tunnel_router_repository` | Untagged same-region private ECR repository for the shared tunnel-router image. Null defaults to the regional Runlayer mirror. Cross-account repositories must allow the ECS task execution role to pull. **Validation:** tunnel\_router\_repository must be an untagged private ECR repository in var.region, for example 123456789012.dkr.ecr.us-east-1.amazonaws.com/runlayer/tunnel-router. | `string` | `null` | no |
| `tunnel_endpoint_repository` | Untagged same-region private ECR repository for per-connection tunnel endpoint images. Null defaults to the regional Runlayer mirror. Cross-account repositories must allow the ECS task execution role to pull. **Validation:** tunnel\_endpoint\_repository must be an untagged private ECR repository in var.region, for example 123456789012.dkr.ecr.us-east-1.amazonaws.com/runlayer/tunnel-endpoint. | `string` | `null` | no |
| `tunnel_connector_repository` | Untagged Docker/OCI repository for the customer-run tunnel connector image. Defaults to Runlayer's anonymously pullable public ECR repository. The customer runtime must be able to reach and authenticate to an override. **Validation:** tunnel\_connector\_repository must be an untagged Docker/OCI repository without a scheme or digest; registry host:port is supported. | `string` | `"public.ecr.aws/d5v9c9x6/runlayer/tunnel-connector"` | no |
| `tunnel_router_config` | Sizing and per-task admission limits for the shared tunnel-router service. **Validation:** tunnel\_router\_config min\_capacity and max\_capacity must be positive integers with min\_capacity no greater than max\_capacity.; Tunnel router authorization, handshake, active-session, and WAF limits must be positive integers.; tunnel\_router\_config.max\_concurrent\_handshakes must not exceed max\_active\_sessions. | `object({ cpu = number memory = number container_port = nu...` | `{ cpu = 256 memory = 512 container_port = 8080 min_capacity = 2 max_capacity ...` | no |

## Database

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `database_name` | Database name | `string` | `"anysource"` | no |
| `database_username` | Database master username | `string` | `"postgres"` | no |
| `rds_kms_key_arn` | Optional customer-managed KMS key ARN for Aurora storage, automated backups, and snapshots. Null preserves the existing key selection. Set at cluster creation; changing an existing cluster's key requires migration. Ignored with external\_database. **Validation:** Must be a key ARN (`...:key/<id>`); alias ARNs and bare key IDs are rejected. | `string` | `null` | no |
| `snapshot_identifier` | Optional DB cluster snapshot name or ARN used to restore Aurora at create time only (ignored after). Master username must match the snapshot; password is set from app secrets PLATFORM\_DB\_PASSWORD. | `string` | `null` | no |
| `database_config` | Aurora PostgreSQL Serverless v2 settings (all optional). The cluster is always db.serverless - size it with min\_capacity/max\_capacity in ACUs, not a provisioned instance class. enable\_ops\_reader adds another Serverless v2 reader. log\_lock\_waits defaults to null (unspecified); true enables and false disables lock-wait logging immediately, using the existing deadlock\_timeout threshold (engine default: one second). Use external\_database to skip Aurora; log\_lock\_waits has no effect in that mode. | `object({ engine_version = optional(string, "16") min_capa...` | `{}` | no |
| `external_database` | External PostgreSQL connection details. When set, Aurora RDS is not created. Set external\_database\_password separately. | `object({ host = string reader_host = optional(string) ops...` | `null` | no |
| `external_database_password` | Password for external\_database. Required when external\_database is set. *(sensitive)* | `string` | `null` | no |
| `migration_lock_timeout_ms` | Optional override for the backend migration task's PostgreSQL lock\_timeout, in milliseconds **Validation:** migration\_lock\_timeout\_ms must be null or >= 0. | `number` | `5000` | no |
| `migration_statement_timeout_ms` | Optional override for the backend migration task's PostgreSQL statement\_timeout, in milliseconds **Validation:** migration\_statement\_timeout\_ms must be null or >= 0. | `number` | `null` | no |
| `migration_retry_count` | Optional override for the backend migration task's migration retry count **Validation:** migration\_retry\_count must be null or >= 0. | `number` | `180` | no |
| `backend_migration_aws_role` | Optional IAM role configuration to assume before starting the backend migration ECS task. **Validation:** backend\_migration\_aws\_role.arn must be non-empty when backend\_migration\_aws\_role is set. | `object({ arn = string external_id = optional(string) sess...` | `null` | no |
| `backend_migration_wait_timeout_seconds` | Maximum time to wait for the backend migration ECS task to stop. On timeout the task is stopped and the apply fails. **Validation:** backend\_migration\_wait\_timeout\_seconds must be a positive whole number. | `number` | `1800` | no |
| `enable_db_health_alarms` | Enable Postgres health alarms (invalid indexes, auditlog partition runway/leaks, pg\_partman maintenance failures) on the Runlayer/DatabaseHealth metrics emitted by the worker. Effective only when enable\_monitoring and critical\_alerts\_enabled are set. | `bool` | `true` | no |
| `rds_database_connections_threshold` | Threshold for RDS DatabaseConnections alarm. Default is \~80% of Aurora PostgreSQL Serverless v2 max\_connections for the default 16 ACU. | `number` | `2700` | no |
| `rds_writer_cpu_utilization_threshold` | Aurora WRITER CPUUtilization (%) above which the writer-cpu alarm fires after 3 consecutive 5-minute periods. Evaluated with Role = WRITER rather than the cluster average, which halves a pinned writer against an idle reader. **Validation:** rds\_writer\_cpu\_utilization\_threshold must be a percentage in (0, 100]. | `number` | `85` | no |
| `rds_reader_cpu_utilization_threshold` | Aurora reader CPUUtilization (%) above which an instance's reader-cpu alarm fires after 3 consecutive 5-minute periods. One metric-math alarm per cluster instance (DBInstanceIdentifier), gated on AuroraReplicaLag so it evaluates only while that instance is a reader and follows role swaps on failover; the Role = READER series averages the replicas and would mask one saturated reader next to an idle ops reader. Looser than the writer threshold: readers only serve replica-routed and ops/analytics reads. **Validation:** rds\_reader\_cpu\_utilization\_threshold must be a percentage in (0, 100]. | `number` | `90` | no |
| `rds_writer_acu_utilization_threshold` | Aurora Serverless v2 WRITER ACUUtilization (%) at or above which the writer-acu alarm fires after 6 consecutive 5-minute periods. 100% means the writer is pinned at database\_config.max\_capacity and cannot scale further. The alarm is only created when database\_config.min\_capacity \< max\_capacity: a fixed-size cluster reads 100% permanently. **Validation:** rds\_writer\_acu\_utilization\_threshold must be a percentage in (0, 100]. | `number` | `90` | no |
| `db_idle_in_txn_max_duration_threshold` | Idle-age threshold in seconds shared by the max-duration alarm and the count of sessions over the threshold. **Validation:** must be greater than 0. | `number` | `30` | no |
| `db_idle_in_txn_count_threshold` | Alarm threshold for the number of concurrent sessions over db\_idle\_in\_txn\_max\_duration\_threshold | `number` | `10` | no |
| `rds_alarm_config` | Map of RDS CloudWatch alarm configs for each metric. Each object must include period, threshold, and unit. **Validation:** All RDS alarm periods and thresholds must be positive numbers. | `map(object({ period = number threshold = number unit = st...` | `{ DiskQueueDepth = { period = 300 threshold = 5 unit = "Count" } WriteIOPS = {...` | no |
| `prestart_container_cpu` | CPU units for the backend migration task | `number` | `512` | no |
| `prestart_container_memory` | Memory (MB) for the backend migration task | `number` | `1024` | no |

## Redis / ElastiCache

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `external_redis` | External Redis/Valkey connection details. When set, ElastiCache is not created. Set external\_redis\_password separately when auth is required. | `object({ host = string port = optional(number, 6379) tls_...` | `null` | no |
| `external_redis_password` | Password/auth token for external\_redis. Omit or leave null when the external Redis server has no auth. *(sensitive)* | `string` | `null` | no |
| `redis_curr_connections_threshold` | Raw Redis CurrConnections backstop alarm threshold (per node, 3 of 3 five-minute periods). Normal fleet growth is covered by `redis_connections_per_backend_task_threshold`; this only catches a connection storm, so keep it well above max backend tasks × \~500 connections per task and below the node's maxclients (65,000). | `number` | `20000` | no |
| `redis_connections_per_backend_task_threshold` | Redis CurrConnections per running backend task (per node) above which the connection alarm pages, 3 of 3 five-minute periods. A backend task holds roughly 340-500 connections; worker services share the Redis URL but hold far fewer, so the default leaves headroom for them. Backend scale-out does not move this ratio; a sustained breach is a connection leak. Needs Container Insights (the ratio alarm is not created without it). | `number` | `750` | no |
| `critical_redis_curr_connections_threshold` | Raw CurrConnections alarm threshold for the critical Redis cluster (per node, 3 of 3 five-minute periods). The backend opens only its shared client against this cluster, so the per-task threshold does not apply. Leave `null` to inherit: a `redis_curr_connections_threshold` you set yourself applies to the critical alarm too, as before; otherwise the critical alarm uses 2000. | `number` | `null` | no |
| `redis_evictions_threshold` | Threshold for Redis Evictions alarm (sum over period) | `number` | `1` | no |
| `redis_burst_evictions_threshold` | Eviction sum in a single 5-minute period that pages immediately (acute storm detection). Lower it if your steady-state eviction noise is well below the default. | `number` | `5000` | no |
| `redis_sustained_evictions_threshold` | Hourly eviction sum that must be exceeded for 3 consecutive hours to trigger the sustained-evictions alarm. The default is set low enough to catch a slow, steady eviction bleed rather than only acute storms. | `number` | `500` | no |
| `redis_node_type` | ElastiCache Redis node type | `string` | `"cache.t3.medium"` | no |
| `redis_num_cache_clusters` | Number of Redis cache nodes in the replication group **Validation:** redis\_num\_cache\_clusters must be 1 or greater. | `number` | `1` | no |
| `redis_automatic_failover_enabled` | Enable automatic failover for Redis (requires 2+ nodes) | `bool` | `false` | no |
| `redis_multi_az_enabled` | Enable multi-AZ for Redis (requires 2+ nodes and failover) | `bool` | `false` | no |
| `redis_snapshot_retention_limit` | Days to retain ElastiCache Redis automatic backups. 0 disables. Null (default) resolves to 1 for production (remediates Security Hub ElastiCache.1) and 0 for staging/development. **Validation:** redis\_snapshot\_retention\_limit must be null or between 0 and 35. | `number` | `null` | no |
| `enable_critical_redis` | Create a dedicated ElastiCache replication group with maxmemory-policy=noeviction for correctness-critical ephemeral state, injected into ECS tasks as REDIS\_CRITICAL\_URL. Requires the managed ElastiCache Redis (not supported with external\_redis) and wait\_for\_ecs\_steady\_state = true (keep it true for the group's whole lifetime, including the apply that disables this flag). **Validation:** enable\_critical\_redis requires the managed ElastiCache Redis; it is not supported together with external\_redis.; enable\_critical\_redis requires wait\_for\_ecs\_steady\_state = true: the disabling apply then observes the service drain instead of returning at API-accept. The group destroy is NOT graph-ordered after that drain — old tasks may fail critical-Redis operations (loudly, degrade-only) until replaced — so keep the wait enabled for the group's whole lifetime, including the apply that disables this flag, and treat disables as a maintenance action.; enable\_critical\_redis: replication\_group\_id `"${var.project}-${var.environment}-redis-critical"` is `${length("${var.project}-${var.environment}-redis-critical")}` characters; AWS caps replication group ids at 40. Shorten project and/or environment. | `bool` | `false` | no |
| `critical_redis_node_type` | ElastiCache node type for the critical Redis replication group | `string` | `"cache.t4g.small"` | no |
| `critical_redis_num_cache_clusters` | Number of cache nodes in the critical Redis replication group **Validation:** critical\_redis\_num\_cache\_clusters must be 1 or greater. | `number` | `1` | no |
| `critical_redis_multi_az_enabled` | Enable multi-AZ for the critical Redis (requires 2+ nodes; failover is automatic with 2+ nodes) | `bool` | `false` | no |
| `sessions_write_payloads_to_redis` | Hot-path Redis payload writes (ag\_events bodies, ag\_turns quad history). Flip to false ONLY after sessions\_read\_from\_postgres = true in this env - the backend has an interlock that keeps writing until the durable path is complete and read from. Real-time keys are never gated. The flag itself is instantly revertible, but events from any off-window exist only in the durable store: rolling sessions\_read\_from\_postgres back after an off-window renders those sessions empty from Redis (up to the 7d TTL horizon). | `bool` | `true` | no |

## ECS services & scaling

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `workers` | Number of workers for the backend | `number` | `null # Set to null to use the number of CPUs on the node` | no |
| `additional_backend_env_vars` | Additional non-sensitive backend environment variables. Values override module-defined backend environment variables with the same name, except reserved module-managed values. **Validation:** module-managed deploy-encryption, analytics, and trusted-CA variables cannot be overridden. | `map(string)` | `{}` | no |
| `additional_backend_only_env_vars` | Additional non-sensitive environment variables for the backend **service** task only — they do not reach the worker, the consumers, or the backend migration task. Use for settings whose runtime constraints differ per service (e.g. `ECS_TASK_PROTECTION_ENABLED`). **Validation:** keys already present in the shared backend environment (module-built or set in `additional_backend_env_vars`) are rejected, as are the module-managed deploy-encryption, analytics, and trusted-CA variables. | `map(string)` | `{}` | no |
| `trusted_ca_pem` | Optional PEM bundle containing one or more additional trusted CA certificates. Combined with the image public roots for backend, shared worker, and MCP execution worker HTTPS clients. Private keys are rejected. | `string` | `null` | no |
| `backend_desired_count` | Override the backend service's initial desired\_count without replacing the full services\_configurations map. Only seeds a backend service that has never been created; Application Auto Scaling owns the live count afterwards. Prefer backend\_min\_capacity for a capacity floor. | `number` | `null` | no |
| `backend_min_capacity` | Override backend service min\_capacity without replacing the full services\_configurations map | `number` | `null` | no |
| `backend_ephemeral_storage_size_gib` | Ephemeral storage size in GiB for the backend ECS task. **Validation:** backend\_ephemeral\_storage\_size\_gib must be between 21 and 200 GiB for ECS Fargate. | `number` | `40` | no |
| `services_configurations` | **Validation:** services\_configurations must reserve backend.priority + 1 for the /mcp alias listener rule, before the frontend catch-all rule. | `map(object({ name = string path_pattern = list(string) he...` | `{ "backend" = { name = "backend" path_pattern = ["/api/*", "/docs*", "/redoc*...` | no |
| `frontend_sentry_dsn` | Public frontend Sentry DSN. Overrides the optional frontend\_sentry\_dsn key of the WorkOS Vault relay secret. Empty defers to that Vault key; frontend Sentry stays disabled when neither is set. **Validation:** frontend\_sentry\_dsn must be empty or a public HTTP(S) Sentry DSN without a password. | `string` | `""` | no |
| `frontend_sentry_traces_sample_rate` | Frontend Sentry trace sample rate passed unchanged to the browser runtime. Runtime configuration owns parsing and disable behavior. | `string` | `"0.1"` | no |
| `backend_stop_timeout_seconds` | Grace period (seconds) between SIGTERM and SIGKILL for backend containers. Must cover uvicorn's graceful shutdown of the longest in-flight request (timeout\_graceful\_shutdown = 105s, just above MCP\_REQUEST\_TIMEOUT = 104s); 120s is the ECS/Fargate maximum. **Validation:** backend\_stop\_timeout\_seconds must be between 2 and 120 seconds for ECS/Fargate. | `number` | `120` | no |
| `health_check_grace_period_seconds` | Grace period in seconds before health checks start | `number` | `120` | no |
| `wait_for_ecs_steady_state` | Wait for ECS services to reach steady state before Terraform apply completes. | `bool` | `false` | no |
| `worker_config` | Worker configuration for background job processing | `object({ cpu = optional(number, 1024) memory = optional(n...` | `{}` | no |
| `worker_exclude_entrypoints` | Comma-separated job names to exclude from the main worker (empty = register all cron jobs on main worker). execute\_tool\_call is always excluded regardless — the dedicated mcp-exec-worker service owns that lane. | `string` | `""` | no |
| `mcp_exec_worker_config` | Dedicated worker service for the execute\_tool\_call pgqueuer lane (worker-tier MCP tool calls). Deployable-but-idle by default: the lane receives no traffic until the worker-tier flag flips. **Validation:** mcp\_exec\_worker\_config: min\_capacity and desired\_count must be >= 1 (scale-from-zero is unsupported; use infra\_parked to park), and max\_capacity must be >= min\_capacity. | `object({ cpu = optional(number, 1024) memory = optional(n...` | `{}` | no |
| `mcp_exec_worker_ephemeral_storage_size_gib` | Ephemeral storage size in GiB for the mcp-exec-worker ECS task. Default matches the backend's: both host the same 10GiB-budget stdio npm cache, which ENOSPC'd the backend's original 20GiB default. **Validation:** mcp\_exec\_worker\_ephemeral\_storage\_size\_gib must be between 21 and 200 GiB for ECS Fargate. | `number` | `40` | no |
| `ecs_service_wait_timeout` | Timeout for ECS service create/update operations when waiting for steady state. The backend's task scale-in protection hard cap (ECS\_TASK\_PROTECTION\_HARD\_CAP\_SECONDS) assumes the 120m default; if you lower this below \~100 minutes, lower ECS\_TASK\_PROTECTION\_HARD\_CAP\_SECONDS to stay under it so a protected task can never outlast the wait. | `string` | `"120m"` | no |
| `enable_ecs_exec` | Enable ECS Exec for interactive shell access to backend and worker containers. Use only for development and testing purposes. | `bool` | `false` | no |
| `enable_read_only_root_filesystem` | Enable read-only root filesystem for ECS containers. | `bool` | `false` | no |
| `ec2_metadata_http_tokens` | EC2 instance metadata token requirement for module-managed launch templates. Use required to enforce IMDSv2. **Validation:** ec2\_metadata\_http\_tokens must be either required or optional. | `string` | `"required"` | no |
| `backend_cors_origins` | Optional list of backend CORS origins; leave empty to let the backend default to APP\_URL. **Validation:** backend\_cors\_origins entries must start with http\:// or https\:// | `list(string)` | `[]` | no |

## Monitoring & alerts

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `container_insights` | ECS cluster Container Insights setting. Null (default) resolves to "enabled" for production and "disabled" for all other environments. **Validation:** container\_insights must be null or one of: enhanced, enabled, disabled. | `string` | `null` | no |
| `enable_monitoring` | Enable CloudWatch monitoring and alarms | `bool` | `false` | no |
| `enable_cloudwatch_metric_stream` | Stream this account's alarm and baseline CloudWatch metrics to the obs Firehose receiver. Default off. Also requires the api\_key secret to exist; a missing secret plans no stream. One stream per account per region: if any CloudWatch metric stream already exists, this root records a skip and does not create another. A stream this module did create stays under its management. Turning the flag off deletes that stream. After a skip, delete terraform\_data.cwmetrics\_decision from state to make the next plan look again. | `bool` | `false` | no |
| `cloudwatch_metric_stream_destination_url` | HTTPS Firehose endpoint for the metric stream. Not an OTLP /v1/metrics URL. **Validation:** cloudwatch\_metric\_stream\_destination\_url must be an https URL. | `string` | `"https://cwmetrics.obs.runlayer.com"` | no |
| `cloudwatch_metric_stream_access_key_secret_name` | Pre-seeded Secrets Manager name Firehose reads for the HTTP destination. JSON object with api\_key set to the bare OTLP ingest token. The module never reads or creates this secret. The Firehose role may decrypt only that secret, and only through Secrets Manager. A customer managed key's policy must allow the role. Set null to skip the lookup. Default runlayer/cwmetrics-firehose-api-key. | `string` | `"runlayer/cwmetrics-firehose-api-key"` | no |
| `critical_alerts_enabled` | Enable mission-critical CloudWatch alarms and wire them to the critical alerts SNS topic | `bool` | `true` | no |
| `enable_agent_run_alarms` | Enable agent-run health alarms (stalled in-flight runs, run failure rate) on the Runlayer/AgentRuns metrics emitted by the worker. Effective only when enable\_monitoring and critical\_alerts\_enabled are set. | `bool` | `true` | no |
| `enable_worker_queue_alarms` | Enable the mcp-exec-worker queue dead-man alarm on the Runlayer/WorkerQueue metrics emitted by the shared worker (missing data breaches: a dark metric freezes the lane's autoscaling). Effective only when enable\_monitoring and critical\_alerts\_enabled are set. | `bool` | `true` | no |
| `agent_run_stall_threshold_minutes` | Minutes a run may sit in `running` with no new run event before it counts as stalled. Documentation for the alarm text only — the worker reads its own AGENT\_RUN\_STALL\_THRESHOLD\_MINUTES setting, so change both together. **Validation:** agent\_run\_stall\_threshold\_minutes must be positive. | `number` | `60` | no |
| `agent_run_stalled_count_threshold` | Number of concurrently stalled agent runs tolerated before the alarm fires. 0 means any stalled run pages. **Validation:** agent\_run\_stalled\_count\_threshold must not be negative. | `number` | `0` | no |
| `agent_run_failure_rate_threshold_percent` | Percentage of agent runs finishing in the rolling window that may fail before paging. Usage-limit rejections and user cancellations are excluded from the rate by the emitter. **Validation:** agent\_run\_failure\_rate\_threshold\_percent must be between 0 and 100. | `number` | `5` | no |
| `agent_run_failure_rate_min_volume` | Minimum runs finishing in the rolling window before the failure-rate alarm evaluates. Below this the rate is forced to 0, so a single failure at low volume does not page. A deployment whose hourly volume sits under this value can never fire the alarm at all — lower it there (toward 1, where any single failure pages) rather than raising it. **Validation:** agent\_run\_failure\_rate\_min\_volume must be at least 1. | `number` | `20` | no |
| `critical_alerts_create_sqs_subscription` | Create an SQS queue subscribed to the critical alerts SNS topic (useful for Slack/ops ingestion pipelines). The queue is encrypted with the critical-alerts CMK: consumers need kms:Decrypt on critical\_alerts\_kms\_key\_arn (IAM-grantable; the key policy delegates to account IAM). | `bool` | `true` | no |
| `critical_alerts_extra_sns_topic_arns` | Extra SNS topic ARNs to fan out critical alarms to (e.g. an internal Slack relay). Must be in the same region as this module. CloudWatch allows five actions per alarm, and the ToolGuard alarms already carry their own topic plus the critical-alerts topic when that route exists, so with ToolGuard alarms enabled at most 3 extra topics fit (4 when enable\_monitoring or critical\_alerts\_enabled is off). **Validation:** Too many critical\_alerts\_extra\_sns\_topic\_arns for the ToolGuard alarms: CloudWatch allows five actions per alarm, and those alarms already carry their own topic plus the critical-alerts topic when enable\_monitoring and critical\_alerts\_enabled are on, so at most 3 extra topics fit (4 with that route off). | `list(string)` | `[]` | no |
| `enable_runlayer_topic_cpu_alarms` | Enable CloudWatch alarms for topic CPU ECS service | `bool` | `true` | no |
| `enable_runlayer_deploy_healthcheck` | Run the MCP telemetry proxy as a health-check sidecar for Runlayer Deploy ECS tasks without routing MCP traffic through it. | `bool` | `false` | no |

## OpenTelemetry

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `otel_exporter_otlp_metrics_endpoint` | Optional OTEL\_EXPORTER\_OTLP\_METRICS\_ENDPOINT for the backend ECS task and every Kinesis consumer. Ignored by the backend when otel\_collector\_config.enabled (sidecar) and by the consumers whenever the shared collector is created (see kinesis\_consumer\_otel\_collector\_config). | `string` | `null` | no |
| `otel_exporter_otlp_metrics_protocol` | Optional OTEL\_EXPORTER\_OTLP\_METRICS\_PROTOCOL for the backend ECS task. Only used when otel\_exporter\_otlp\_metrics\_endpoint is set. | `string` | `null` | no |
| `otel_service_name` | Optional OTEL\_SERVICE\_NAME for the backend ECS task. Only used when otel\_exporter\_otlp\_metrics\_endpoint is set. | `string` | `null` | no |
| `otel_collector_config` | Optional otel-collector sidecar for the backend and worker ECS tasks. When enabled, adds a second container running the OpenTelemetry Collector that receives telemetry via localhost:4317. export\_endpoint is the OTLP gRPC endpoint of a customer-OWNED collector; leave it null when none exists and the customer export pipeline is omitted entirely (loopback values are rejected at plan time — they point at the sidecar itself). Runlayer export is configured separately via runlayer\_obs\_otel\_\*. | `object({ enabled = optional(bool, false) image = optional...` | `{}` | no |
| `kinesis_consumer_otel_collector_config` | One shared OTEL Collector service the Kinesis consumers export metrics to (they have no sidecar). Needs otel\_collector\_config.enabled and a metrics sink (runlayer\_obs\_otel\_enabled and/or otel\_collector\_config.export\_endpoint); exporter gating matches the sidecar's. Not created in stateless regions; keeps running when infra\_parked. **Validation:** kinesis\_consumer\_otel\_collector\_config.desired\_count must be a positive integer; cpu >= 256 and memory >= 512 (the container gets memory minus 64 MiB for the Service Connect proxy). | `object({ enabled = optional(bool, false) desired_count = o...` | `{}` | no |
| `flow_metrics_collection_enabled` | Backend flow-metric generation (FLOW\_TRACE\_COLLECTION\_ENABLED). Defaults (null) to runlayer\_obs\_otel\_enabled. Set explicitly to decouple flow collection from export transport. | `bool` | `null` | no |
| `flow_trace_adaptive_sampling_enabled` | Adaptive sampling for hot-path flow traces (FLOW\_TRACE\_ADAPTIVE\_SAMPLING\_ENABLED). A cost lever, deliberately independent of the contractual collection permission (runlayer\_obs\_otel\_enabled): it sheds local step-recording work even when remote export is off. | `bool` | `false` | no |

## LLM gateway & Bedrock

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `enable_llm_gateway` | Deploy the Runlayer LLM gateway ECS service behind the application ALB. | `bool` | `false` | no |
| `llm_gateway_image_uri` | Optional LLM gateway image URI. Defaults to the Runlayer customer-distribution image for app\_version. **Validation:** llm\_gateway\_image\_uri must include an explicit tag or digest. | `string` | `null` | no |
| `llm_gateway_runlayer_api_key` | Optional org-bound Runlayer user API key (must hold MANAGE\_ORG\_SETTINGS) for the LLM gateway control plane. Required only on multi-organization deployments; leave empty on single-org deployments and the module generates a machine sync secret shared with the backend instead. *(sensitive)* | `string` | *(sensitive — omitted)* | no |
| `llm_gateway_listener_priority` | HTTPS listener-rule priority for /openai and /anthropic gateway routes. **Validation:** llm\_gateway\_listener\_priority must be unused and between the /mcp alias and frontend catch-all priorities. | `number` | `12` | no |
| `anthropic_api_key` | Anthropic API key for Claude AI models *(sensitive)* | `string` | *(sensitive — omitted)* | no |
| `mcp_tunnel_base_url` | Optional Anthropic MCP Gateway tunnel base URL (https\://…). When set, server MCP OAuth PRM/AS metadata uses this host; browser auth stays on APP\_URL. Single-tenant deployments only. | `string` | `null` | no |
| `bedrock_region` | AWS region for Bedrock API calls. Defaults to the deployment region when empty. | `string` | `""` | no |
| `bedrock_auto_model_access` | Let the backend grant this AWS account Bedrock model access on its own (submits Anthropic's use case details form and accepts the model agreement). Disable to keep model access a manual step in the AWS console. | `bool` | `true` | no |
| `bedrock_model_access_industry` | Industry named on Anthropic's Bedrock use case details form, alongside bedrock\_model\_access\_company\_name. Defaults to the operator's. Override it if you run this install yourself and are in another sector — the form is submit-once and permanent. | `string` | `"Software as a Service"` | no |
| `bedrock_model_access_company_website` | Company website named on Anthropic's Bedrock use case details form. Not the deployment URL — that is often an internal hostname. Override alongside bedrock\_model\_access\_company\_name if you run this install yourself. | `string` | `"https://runlayer.com"` | no |
| `bedrock_model_access_intended_users` | Intended user count on Anthropic's Bedrock use case details form. A deployment-level estimate, not a live count — the form is submit-once, so raise it if this deployment serves a larger audience. | `number` | `2` | no |
| `bedrock_model_access_company_name` | Company named on Anthropic's Bedrock use case details form, which the backend submits automatically so the Runlayer Assistant works on a fresh AWS account. Defaults to the operator of the software making the calls. Override for a self-managed install run by the customer themselves. To skip submission entirely, set bedrock\_auto\_model\_access = false — an empty name here is discarded and falls back to the default. Never derived from tenant data: the form is submit-once and permanent. | `string` | `"Runlayer"` | no |
| `enable_bedrock_anthropic_models` | Enable Bedrock Anthropic models for regular agent runs. Default false so single-tenant/customer deployments do not expose them unless explicitly opted in. Note: the Runlayer Assistant always routes through Bedrock regardless of this flag. | `bool` | `false` | no |
| `platform_llm_trial_default_budget_usd` | Default trial inference budget in USD stamped on newly created organizations. Empty leaves the capability opt-in for generic module consumers; Runlayer-managed tenant templates set it explicitly. | `string` | `""` | no |
| `braintrust_api_key` | Braintrust API key for agent tracing (optional) *(sensitive)* | `string` | *(sensitive — omitted)* | no |
| `braintrust_project` | Braintrust project name for agent tracing | `string` | `"Runlayer Agents"` | no |

## Agents, ToolGuard & topic CPU

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `enable_runlayer_tool_guard` | Enable Runlayer ToolGuard Flask server deployment | `bool` | `false` | no |
| `runlayer_tool_guard_desired_count` | Initial capacity and autoscaling floor for Runlayer ToolGuard (1–12); capacity provider manages EC2 instance scaling **Validation:** Runlayer ToolGuard desired count must be between 1 and 12 | `number` | `2` | no |
| `runlayer_tool_guard_max_count` | Maximum Runlayer ToolGuard GPU instance count (2–24), the ASG max\_size. Autoscaling reserves ceil(25%) of it, at least one host, so a rolling deploy always has a free GPU host: 8 allows 6 tasks, 6 allows 4, 2 allows 1. `runlayer_tool_guard_desired_count` above that ceiling is lowered to it. **Validation:** Runlayer ToolGuard max count must be between 2 and 24 | `number` | `6` | no |
| `runlayer_tool_guard_instance_type` | EC2 instance type for the Runlayer ToolGuard GPU hosts: a single-GPU g6f.\* (fractional L4), g6.\* (full L4) or g6e.\* (L40S) size. One task runs per host and its CPU/memory reservation scales with the instance. Full-GPU types (g6.*, g6e.*) lower encoder latency. Changing it rolls every ToolGuard host. **Validation:** runlayer\_tool\_guard\_instance\_type must be a single-GPU g6f/g6/g6e size. | `string` | `"g6f.large"` | no |
| `runlayer_tool_guard_cutover` | Set for the apply that changes runlayer\_tool\_guard\_instance\_type: the previous instance type and the runlayer\_tool\_guard\_max\_count it ran with. While set, the autoscaling task ceiling comes from the larger of the two max counts and the GPU ASG max\_size holds the whole old fleet plus a full replacement fleet, so the running fleet is never scaled in before its replacements serve. Remove it once no hosts of the previous type remain; a plan warning says when. Null (default): no cutover. **Validation:** runlayer\_tool\_guard\_cutover.from\_instance\_type must be a supported ToolGuard instance type other than runlayer\_tool\_guard\_instance\_type. | `object({ from_instance_type = string, from_max_count = number })` | `null` | no |
| `runlayer_tool_guard_gpu_resource_value` | GPU resource value requested by the Runlayer ToolGuard ECS task. Null derives it from runlayer\_tool\_guard\_instance\_type: ALL on g6f.\* (ECS rejects an integer request for a fractional GPU), 1 on full-GPU g6.*/g6e.*. **Validation:** runlayer\_tool\_guard\_gpu\_resource\_value must be either 1 or ALL. | `string` | `null` | no |
| `runlayer_tool_guard_dynamic_batch_max` | Max items per coalesced GPU forward in the ToolGuard dynamic batcher. 16 is burst-gate validated on g6f.large and is the default. Set to 1 to disable batching and restore inline prediction. **Validation:** runlayer\_tool\_guard\_dynamic\_batch\_max must be between 1 and 64. | `number` | `16` | no |
| `runlayer_tool_guard_health_check_grace_period_seconds` | ECS `health_check_grace_period_seconds` for the ToolGuard service. Unset (`null`) uses the module's GPU host boot window (900s: GRID driver install + model load), shared with the ASG health check grace period and the capacity provider instance warmup. Set to 2147483647 (int32 max) as a scoped stopgap where ECS is looping on task replacement because the current image's worker-recycle drain flips `/health` to 503 and every task owns a whole GPU; restore the default once the worker-rotation image (no `/health` flip) is pinned. **Validation:** runlayer\_tool\_guard\_health\_check\_grace\_period\_seconds must be between 0 and 2147483647. | `number` | `null` | no |
| `runlayer_tool_guard_timeout` | Deprecated: enforcement scans take their budget from the workspace scan latency budget (Security Scanners -> Scan budgets, 50 ms-300 s, fail-open or fail-closed) once it is set; this value is adopted into that setting whenever it is unset. Timeout in whole seconds for every other ToolGuard request the backend makes (tool-list scans, analyze, models), which read it directly and fail open on timeout. **Validation:** Runlayer ToolGuard timeout must be between 5 and 300 seconds | `number` | `5` | no |
| `runlayer_tool_guard_log_retention_days` | CloudWatch log retention in days for Runlayer ToolGuard. Longer retention recommended for security auditing and compliance. **Validation:** Log retention must be a valid CloudWatch retention period (e.g., 7, 30, 60, 90, 180, 365 days) | `number` | `30` | no |
| `enable_runlayer_tool_guard_alarms` | Enable CloudWatch alarms for Runlayer ToolGuard service health and performance monitoring | `bool` | `true` | no |
| `runlayer_tool_guard_scaling_profile` | How aggressively ToolGuard adds GPU capacity under load. `conservative` (default): CPU target 50%, capacity provider target 100 (no spare EC2 headroom), scale-out step = `runlayer_tool_guard_desired_count` instances, 60s scale-out cooldown. `balanced`: CPU 35%, capacity target 80 (\~20% spare instance headroom), two instances per step, 30s cooldown. `aggressive`: CPU 25%, capacity target 70 (\~30% headroom), steps up to `runlayer_tool_guard_max_count` at once, 30s cooldown, plus a second target-tracking policy on fleet-average GPU utilization (target 60%; hosts publish GPU metrics every 60s, no new CloudWatch series). Scale-in cooldown is 900s for every profile. CPU targets are a percent of a g6f.large task's CPU reservation; on a larger `runlayer_tool_guard_instance_type` they keep the same CPU, since a ToolGuard task uses about one core whatever the host (balanced 35% becomes 15% on g6.xlarge). Higher profiles keep more idle `g6f.large` hours warm; new GPU hosts still take 10-15 min to install drivers, so headroom is what actually shortens time-to-serve. **Validation:** runlayer\_tool\_guard\_scaling\_profile must be one of: conservative, balanced, aggressive. | `string` | `"conservative"` | no |
| `runlayer_tool_guard_queue_depth_scaling` | Scale ToolGuard on admission queue depth: target tracking on the fleet-mean waiters per task (requests queued or in a forward, which the image caps and answers 503 past) at 1, plus an alarm when that series goes missing or stays above 5 for 15 minutes. Needs a ToolGuard image that serves `/metrics/admission` (an older one publishes nothing and the alarm fires) and `runlayer_tool_guard_dynamic_batch_max` > 1. Turning it on rolls the ToolGuard hosts (user data change). | `bool` | `false` | no |
| `runlayer_tool_guard_rotation_release_gpu_cache` | Experimental. During a ToolGuard worker rotation the old worker releases its PyTorch cache before the replacement forks (waiting at most 2 s for the GPU lock) and after every forward while the replacement loads, to leave the replacement more free VRAM. Needs a ToolGuard image that reads `ROTATE_RELEASE_GPU_CACHE` (an older one ignores it). Off adds nothing to the task definition. ECS only: the Kubernetes operator (`ToolguardSpec`) has no equivalent. | `bool` | `false` | no |
| `runlayer_tool_guard_predictive_scaling_mode` | ECS predictive scaling for ToolGuard. Forecasts the next 48h of task demand from up to 14 days of ToolGuard predict-request history and launches tasks `runlayer_tool_guard_predictive_scheduling_buffer_seconds` ahead of each forecast hour, so GPU hosts are booting before the load arrives instead of after. `forecast_only` records forecasts without acting (the AWS-recommended evaluation mode; the first forecast needs 24h of history). `forecast_and_scale` acts on them. `disabled` creates no policy. Unset (`null`) derives from `runlayer_tool_guard_scaling_profile`: `conservative` -> `forecast_only`, `balanced`/`aggressive` -> `forecast_and_scale`. Automatically disabled in regions where ECS predictive scaling is unavailable (a plan warning names the region). Pair `forecast_and_scale` with `container_insights = enabled`: without Container Insights the requests-per-task metric divides by ASG in-service hosts, which include the capacity provider's spare hosts (\~20% on `balanced`, \~30% on `aggressive`), so it reads low and the forecast under-provisions. Predictive scaling only scales out; the CPU target-tracking policy still handles scale-in and unexpected bursts. **Validation:** runlayer\_tool\_guard\_predictive\_scaling\_mode must be one of: disabled, forecast\_only, forecast\_and\_scale. | `string` | `null` | no |
| `runlayer_tool_guard_predictive_scheduling_buffer_seconds` | Seconds before each forecast hour at which ToolGuard predictive scaling launches the forecast task count. The default covers a `g6f.large` host boot plus GRID driver install (the service's 900s `health_check_grace_period`) and task start, so forecast capacity is serving at the top of the hour. **Validation:** runlayer\_tool\_guard\_predictive\_scheduling\_buffer\_seconds must be between 0 and 3600. | `number` | `1200` | no |
| `runlayer_tool_guard_predictive_load_floor_fraction` | Weekday floor for the predictive load metric, as a fraction of the mean hourly ToolGuard predict-request count over the forecast window. Hours below the floor are raised to it before forecasting so days when scanning was disabled do not teach predictive scaling that the weekday is idle. `0` disables the floor. **Validation:** runlayer\_tool\_guard\_predictive\_load\_floor\_fraction must be between 0 and 1. | `number` | `0.5` | no |
| `runlayer_tool_guard_predictive_load_floor_weekdays_only` | Apply the predictive load floor Monday-Friday (UTC) only; weekends forecast from actual traffic. `false` floors every day. | `bool` | `true` | no |
| `runlayer_tool_guard_predictive_target_requests_per_task_per_minute` | Per-task predict-request rate, per minute, that ToolGuard predictive scaling sizes forecast capacity to. Application Auto Scaling evaluates throughput scaling metrics over one-minute intervals, so the target must be a per-minute figure. Null (default) uses the rate measured for runlayer\_tool\_guard\_instance\_type: 50 on g6f.large, 250 on g6.xlarge, 50 on other (unmeasured) types; during runlayer\_tool\_guard\_cutover, the lower of the two types' rates. On g6f.large, predict p95 stays near its floor at 50 and rises steeply past roughly twice that. Raise to trade latency for fewer hosts, lower for more headroom. **Validation:** runlayer\_tool\_guard\_predictive\_target\_requests\_per\_task\_per\_minute must be between 2 and 2000. | `number` | `null` | no |
| `runlayer_tool_guard_predictive_target_requests_per_task_per_hour` | Deprecated: use runlayer\_tool\_guard\_predictive\_target\_requests\_per\_task\_per\_minute. When set, this per-hour value is divided by 60 and used as the per-minute target. **Validation:** runlayer\_tool\_guard\_predictive\_target\_requests\_per\_task\_per\_hour must be between 120 and 120000 (2–2000 per minute). | `number` | `null` | no |
| `enable_runlayer_topic_cpu` | Enable the CPU guard stacks: with `enable_runlayer_guard_cpu_split` (default) the `guard-cpu-slow-path` host (topic\_cascaded, session titler, tool removal, SkillGuard) and the `guard-cpu-hot-path` host (the `/pre` session tool scanner), plus the legacy shared-host `runlayer-topic-cpu` stack while `keep_legacy_runlayer_topic_cpu` is true. | `bool` | `false` | no |
| `enable_runlayer_guard_cpu_split` | Create the `guard-cpu-hot-path` and `guard-cpu-slow-path` stacks (each its own cluster, host and NLB) and point the backend at them: `RUNLAYER_SESSION_TOOL_SCANNER_ENDPOINT_URL` to the hot path, `RUNLAYER_TOPIC_CASCADED_ENDPOINT_URL` (topic, titler, tool removal, SkillGuard) to the slow path. `false` returns the backend to the legacy shared-host `runlayer-topic-cpu` stack (slow pool :8080, scanner fast pool :8081), which is always kept while the split is off; that is the rollback. The new stacks stay running, idle, until `keep_runlayer_guard_cpu_split_stacks = false` in a second apply, because Terraform would otherwise destroy them before the backend has rolled off them. Only meaningful with `enable_runlayer_topic_cpu`. | `bool` | `true` | no |
| `keep_legacy_runlayer_topic_cpu` | Keep the legacy shared-host `runlayer-topic-cpu` stack (cluster, host, NLB :8080/:8081, log group, alerts topic) running beside the new stacks so the cutover has no gap and rollback (`enable_runlayer_guard_cpu_split = false`) is instant. Set `false` in a later apply, never the apply that bumps the module: Terraform destroys the legacy stack before it rolls the backend, so in the same apply the backend's old tasks would keep calling the legacy NLB while the new hosts boot and the roll runs. Once the backend has rolled (a later apply) the legacy stack is idle and dropping it touches nothing else. Fresh installs can set `false` from the start. Ignored (the legacy stack is always kept) while `enable_runlayer_guard_cpu_split` is false. The legacy stack and this input are removed in a future major release. | `bool` | `true` | no |
| `keep_runlayer_guard_cpu_split_stacks` | With `enable_runlayer_guard_cpu_split = false` (rollback), keep the `guard-cpu-hot-path` and `guard-cpu-slow-path` stacks running, idle, so the rollback apply only points the backend back at the legacy stack and never tears down a stack the backend's tasks are still talking to (Terraform would otherwise destroy the new stacks before it rolls the backend). Set `false` in a second apply, after the backend has rolled, to remove them. Ignored (the stacks always exist) while `enable_runlayer_guard_cpu_split` is true. The mirror of `keep_legacy_runlayer_topic_cpu` for the other direction. | `bool` | `true` | no |
| `runlayer_guard_cpu_wait_for_steady_state` | Wait for the stack the backend is being pointed at before the backend task definition is rolled to it: while the split is on, the `guard-cpu-hot-path` and `guard-cpu-slow-path` ECS services wait for steady state and their NLB target groups for healthy targets; while it is off (rollback), the legacy `runlayer-topic-cpu` service and target groups do. Either this or `wait_for_ecs_steady_state` turns the waits on; set both to `false` to return at API-accept. Without the waits the first split apply repoints the backend while the new hosts are still booting (about 6 minutes), and until they are up `/pre` scans fail open and SkillGuard imports fail. Bounds: the new services' steady-state wait by `ecs_service_wait_timeout` (about 2 minutes for a task-definition change, 6 for a host), the legacy service's by the provider's default 20 minutes, the target health wait by 15 minutes (`scripts/guard_cpu_wait.sh`). The script runs the AWS CLI on the apply host with its ambient credentials, or with `backend_migration_aws_role` assumed first when set (the provider's `assume_role` is not visible to it), and needs `ecs:DescribeServices` and `elasticloadbalancing:DescribeTargetHealth`. Tearing a stack down is a separate apply (`keep_legacy_runlayer_topic_cpu` / `keep_runlayer_guard_cpu_split_stacks`), not something this input orders. | `bool` | `true` | no |
| `runlayer_topic_cpu_desired_count` | Initial capacity for topic CPU ASG (1–5); capacity provider manages EC2 instance scaling **Validation:** runlayer\_topic\_cpu\_desired\_count must be between 1 and 5 | `number` | `1` | no |
| `runlayer_topic_cpu_gunicorn_workers` | Worker processes in the topic CPU slow-pool container. Default 4 is the recommended production sizing; lower values let batch scanning work occupy every slot and delay interactive scans. Each worker needs its own memory allocation, so raise runlayer\_topic\_cpu\_memory alongside it. **Validation:** runlayer\_topic\_cpu\_gunicorn\_workers must be between 1 and 6; with enable\_runlayer\_topic\_cpu, runlayer\_topic\_cpu\_memory must be at least workers \* 3584 MiB, or workers \* 4096 MiB while runlayer\_skill\_guard\_enabled is also true (one slow-pool worker measured 3,011 MiB resident with runlayer-session-topic loaded, so 3584 leaves \~0.5 GiB of margin; SkillGuard scans peak \~0.5 GiB above resident). Raise runlayer\_topic\_cpu\_memory, lower runlayer\_topic\_cpu\_gunicorn\_workers, or set runlayer\_skill\_guard\_enabled = false. | `number` | `4` | no |
| `runlayer_topic_cpu_instance_type` | EC2 instance type for the `guard-cpu-slow-path` capacity provider (and the legacy `runlayer-topic-cpu` host while it is kept). On `guard-cpu-slow-path` the slow container is alone (the `/pre` scanner runs on `guard-cpu-hot-path`), so the host must fit `runlayer_topic_cpu_memory` plus \~1 GiB OS/agent overhead; on the legacy host it must also fit `runlayer_topic_cpu_fast_memory`. Default m7i.2xlarge (8 vCPU, 32 GiB, registers \~31.4k MiB to ECS, fits 20480 + 8192). `runlayer_topic_cpu_omp_threads` derives the per-worker torch pin from this type's vCPUs / `runlayer_topic_cpu_gunicorn_workers` (8 / 4 = 2 by default). | `string` | `"m7i.2xlarge"` | no |
| `runlayer_topic_cpu_omp_threads` | Torch compute threads per worker (OMP\_NUM\_THREADS) in the slow container (`guard-cpu-slow-path`, and the legacy `runlayer-topic-cpu` slow pool while it is kept). Unset in the container, every worker defaults to one thread per host vCPU, so the pool runs workers x vCPUs threads on vCPUs cores and stalls under a burst of concurrent requests. Leave null to derive host vCPUs / runlayer\_topic\_cpu\_gunicorn\_workers from runlayer\_topic\_cpu\_instance\_type (2 at the defaults); set a number only to override, and the plan rejects an override whose threads x workers exceed the host's vCPUs. ECS only; the Kubernetes operator does not set it yet. **Validation:** runlayer\_topic\_cpu\_omp\_threads must be null (derive from the instance type) or between 1 and 16 | `number` | `null` | no |
| `runlayer_topic_cpu_memory` | Hard memory limit (MiB) for the `guard-cpu-slow-path` container (and the legacy slow-pool container while it is kept). Every worker loads every model copy. Measured: \~1.7 GiB per worker resident before `runlayer-session-topic` (2026-10-16, 7 days, per-container); with the model one worker measures 3,011 MiB resident (2026-10-22, full roster; +375 MiB over the same roster without it), so the floor is 3584 MiB per worker (3011 + 573 MiB of margin); SkillGuard scan activations peak \~0.5 GiB above resident, so the floor with SkillGuard is 4096 and 4 workers budget 4 x 4096 = 16384 MiB. Budget at least 3584 MiB per worker (4096 with `runlayer_skill_guard_enabled`) plus spike headroom; the 20480 default leaves \~4 GiB of headroom at the default 4 workers with SkillGuard. While the legacy stack is kept, slow + `runlayer_topic_cpu_fast_memory` must fit the instance type (m7i.2xlarge registers \~31.4k MiB to ECS): 20480 + 8192 = 28672; once it is dropped the slow container is alone on its host. Smaller instance types (m7i.xlarge, 16 GiB) need this pinned explicitly; while the legacy stack is kept an xlarge holds at most three slow workers (3 x 4096 = 12288 plus a 3072 MiB fast pool = 15360 = 16384 - 1024). **Validation:** runlayer\_topic\_cpu\_memory must be at least 2048 MiB | `number` | `20480` | no |
| `runlayer_topic_cpu_fast_gunicorn_workers` | Legacy shared-host `runlayer-topic-cpu` stack only (kept while `keep_legacy_runlayer_topic_cpu`); removed with it in a future major release. Worker processes in the topic CPU fast-pool container, which serves latency-sensitive scans. Agents can issue large bursts of concurrent scans, so the default 6 is sized for burst headroom; too few workers serialize a burst past the client timeout budget. Fast-pool workers are comparatively cheap memory-wise. **Validation:** runlayer\_topic\_cpu\_fast\_gunicorn\_workers must be between 1 and 6; fast memory must be at least fast workers \* 1024 MiB, which is a floor with no spike headroom — size above it. Raise runlayer\_topic\_cpu\_fast\_memory or lower runlayer\_topic\_cpu\_fast\_gunicorn\_workers. On the new stacks use `runlayer_guard_cpu_hot_path_gunicorn_workers`. | `number` | `6` | no |
| `runlayer_topic_cpu_fast_omp_threads` | Legacy shared-host `runlayer-topic-cpu` stack only (kept while `keep_legacy_runlayer_topic_cpu`); removed with it in a future major release. Torch compute threads per worker (OMP\_NUM\_THREADS) in the topic CPU fast-pool container. Each fast request is a short single scan that gains nothing from extra threads, so the default is one thread per worker whatever the instance size, and the workers provide the parallelism. Raise only if you run far fewer fast workers than the host has vCPUs; the plan rejects a raised value whose threads x fast workers exceed the host's vCPUs. Counterpart on the new stack: `runlayer_guard_cpu_hot_path_omp_threads`. **Validation:** runlayer\_topic\_cpu\_fast\_omp\_threads must be between 1 and 16 | `number` | `1` | no |
| `runlayer_topic_cpu_fast_memory` | Legacy shared-host `runlayer-topic-cpu` stack only (kept while `keep_legacy_runlayer_topic_cpu`); removed with it in a future major release. Hard memory limit (MiB) for the topic CPU fast-pool container. Size to roughly 1 GiB per fast worker plus headroom; the 8192 default leaves \~2 GiB spare at the default 6 workers. Slow + fast limits must fit the instance type (m7i.2xlarge registers \~31.4k MiB to ECS): 16384 + 8192 = 24576. An OOM kill here restarts the whole task, so do not size this tight. On the new stacks use `runlayer_guard_cpu_hot_path_memory`. **Validation:** runlayer\_topic\_cpu\_fast\_memory must be at least 2048 MiB | `number` | `8192` | no |
| `runlayer_topic_cpu_fast_cpu` | Legacy shared-host `runlayer-topic-cpu` stack only (kept while `keep_legacy_runlayer_topic_cpu`); removed with it in a future major release. DEPRECATED in favor of runlayer\_topic\_cpu\_fast\_cpu\_share. Absolute CPU units (1024 = 1 vCPU) for the topic CPU fast-pool container; when set it overrides the share-derived value, so it silently stops scaling if runlayer\_topic\_cpu\_instance\_type changes. Kept so existing deployments that set it keep planning; leave null to derive from the instance type. **Validation:** runlayer\_topic\_cpu\_fast\_cpu must be between 256 and 2048 | `number` | `null` | no |
| `runlayer_topic_cpu_fast_cpu_share` | Legacy shared-host `runlayer-topic-cpu` stack only (kept while `keep_legacy_runlayer_topic_cpu`); removed with it in a future major release. Fraction of the instance's CPU units (vcpus \* 1024) reserved for the topic CPU fast-pool container; the slow pool gets the remainder. ECS cpu is a share (soft) on EC2, so this is the fast pool's guaranteed floor under full contention. The default 0.25 keeps enough headroom for the fast pool to drain a burst of concurrent scans within its client timeout budget even while the slow pool is saturated. Shares summing to 100% of vcpus\*1024 is placement-safe: ECS on EC2 registers the full capacity to the host. The new hot path owns its whole host, so it has no share. **Validation:** runlayer\_topic\_cpu\_fast\_cpu\_share must be strictly between 0 and 1 | `number` | `0.25` | no |
| `runlayer_topic_cpu_fast_queue_max` | Legacy shared-host `runlayer-topic-cpu` stack only (kept while `keep_legacy_runlayer_topic_cpu`); removed with it in a future major release. `DYNAMIC_BATCH_QUEUE_MAX` for the topic CPU fast-pool container: pending waiters one worker admits before shedding a fast 503; the container admits this times `runlayer_topic_cpu_fast_gunicorn_workers`. 22 is one thread's in-budget capacity for a `/pre` scan; `0` disables admission (rollback). Counterpart on the new stack: `runlayer_guard_cpu_hot_path_queue_max`. **Validation:** must be a whole number, and either 0 or >= 20; must be >= runlayer\_topic\_cpu\_fast\_expected\_concurrent\_callers | `number` | `22` | no |
| `runlayer_topic_cpu_fast_expected_concurrent_callers` | Legacy shared-host `runlayer-topic-cpu` stack only (kept while `keep_legacy_runlayer_topic_cpu`); removed with it in a future major release. Concurrent callers against the topic CPU fast pool, passed as `EXPECTED_CONCURRENT_CALLERS`. Raise `runlayer_topic_cpu_fast_queue_max` with it. Counterpart on the new stack: `runlayer_guard_cpu_hot_path_expected_concurrent_callers`. **Validation:** whole number >= 1, not above runlayer\_topic\_cpu\_fast\_queue\_max | `number` | `16` | no |
| `runlayer_guard_cpu_hot_path_instance_type` | EC2 instance type for the `guard-cpu-hot-path` capacity provider. Compute-optimised: a `/pre` scan is \~33ms of one CPU thread and the pool is sized as one worker per vCPU with `OMP_NUM_THREADS=1`. Default c7i.xlarge (4 vCPU, 8 GiB): with 4 workers it answered 64% of a 70-burst in budget under storm (vs 27% on the shared host) and all of a 20-burst at p95 423ms. Must fit `runlayer_guard_cpu_hot_path_memory` plus \~1 GiB OS/agent overhead. | `string` | `"c7i.xlarge"` | no |
| `runlayer_guard_cpu_hot_path_desired_count` | Initial capacity for the `guard-cpu-hot-path` ASG; the capacity provider manages EC2 instance scaling. One task per host. Default `null` follows `runlayer_topic_cpu_desired_count`, so a deployment that runs N topic CPU hosts today keeps N scanner hosts after the cutover instead of dropping to one. **Validation:** runlayer\_guard\_cpu\_hot\_path\_desired\_count must be between 1 and 5 | `number` | `null` | no |
| `runlayer_guard_cpu_hot_path_gunicorn_workers` | Gunicorn workers in the `guard-cpu-hot-path` container. One per vCPU of `runlayer_guard_cpu_hot_path_instance_type`, each pinned to one torch thread: 4 on the c7i.xlarge default. Agents fire 20-70 concurrent `/pre` scans in a single second; one worker drains 70 serially and blows the 0.8s budget, four drain it in parallel. Each worker loads only the dynamic-policy model (\~1.0 GiB); size `runlayer_guard_cpu_hot_path_memory` to workers x 1024 MiB plus headroom. More workers than vCPUs oversubscribes and was measured to collapse. **Validation:** runlayer\_guard\_cpu\_hot\_path\_gunicorn\_workers must be between 1 and 16; memory must be at least workers \* 1024 MiB; workers x runlayer\_guard\_cpu\_hot\_path\_omp\_threads must not exceed the instance's vCPUs | `number` | `4` | no |
| `runlayer_guard_cpu_hot_path_memory` | Hard memory limit (MiB) for the `guard-cpu-hot-path` container. Each worker loads only the dynamic-policy model (\~1.0 GiB); 4 workers \~4.1 GiB, so the 6144 default keeps \~2 GiB and fits the c7i.xlarge default (8192 MiB minus \~1 GiB OS/agent overhead). An OOM kill restarts the whole task, so do not size this tight. **Validation:** runlayer\_guard\_cpu\_hot\_path\_memory must be at least 2048 MiB and fit the instance | `number` | `6144` | no |
| `runlayer_guard_cpu_hot_path_omp_threads` | `OMP_NUM_THREADS` for the `guard-cpu-hot-path` container: torch intra-op threads per worker. A `/pre` scan is a single \~33ms forward pass that gains nothing from intra-op parallelism; the pool's parallelism comes from `runlayer_guard_cpu_hot_path_gunicorn_workers`. **Validation:** runlayer\_guard\_cpu\_hot\_path\_omp\_threads must be a whole number between 1 and 16 | `number` | `1` | no |
| `runlayer_guard_cpu_hot_path_queue_max` | `DYNAMIC_BATCH_QUEUE_MAX` for the `guard-cpu-hot-path` container: pending waiters one worker admits before shedding a fast 503; the container admits this times `runlayer_guard_cpu_hot_path_gunicorn_workers` (88 at the defaults, above the worst measured production burst of 20-70). 22 is one thread's in-budget capacity: the scanner's 0.8s budget over the \~33ms a scan costs on one CPU thread. A shed scan fails open (an unscanned tool call), so a fast 503 at least lets the caller fail over. `0` disables admission (rollback shape; measured to answer fewer requests in budget). **Validation:** must be a whole number, and either 0 or >= 20; must be >= runlayer\_guard\_cpu\_hot\_path\_expected\_concurrent\_callers | `number` | `22` | no |
| `runlayer_guard_cpu_hot_path_expected_concurrent_callers` | Concurrent callers against `guard-cpu-hot-path` (`/pre` scans), passed as `EXPECTED_CONCURRENT_CALLERS`. 16 is the sustained concurrency the load test used and the number a single worker's cap of 22 clears. Raise `runlayer_guard_cpu_hot_path_queue_max` with it. **Validation:** whole number >= 1, not above runlayer\_guard\_cpu\_hot\_path\_queue\_max | `number` | `16` | no |
| `runlayer_guard_cpu_hot_path_models` | Model names the `guard-cpu-hot-path` container loads (`MODEL_FILTER`) and serves. Must include `runlayer-dynamic-policy`, the model the backend's `/pre` scanner requests; the hot path is the only stack that serves `/pre` while the split is on, and a roster without it would 404 every scan and fail open. The container health check asserts every model listed here is loaded, so a host that comes up without one is stopped rather than registered. Each gets request/error/load-failure metrics and alarms on the hot-path log group and is left out of the `guard-cpu-slow-path` alarm roster. Only models that meet the hot-tier contract (0.8s client budget with fail-open, p99 inference under \~50ms) belong here. **Validation:** at least one lowercase model slug; every entry must also be in runlayer\_topic\_cpu\_models; must contain `runlayer-dynamic-policy` | `list(string)` | `["runlayer-dynamic-policy"]` | no |
| `runlayer_skill_guard_enabled` | Master switch for the SkillGuard skill scanner (RUNLAYER\_SKILL\_GUARD\_ENABLED). It shares the topic-cpu endpoint: every deployment with enable\_runlayer\_topic\_cpu scores skills with SkillGuard unless this is false. Set false to keep a deployment on the legacy skill scorer, for example a topic-cpu shape sized below the defaults (see runlayer\_topic\_cpu\_memory and runlayer\_topic\_cpu\_gunicorn\_workers). | `bool` | `true` | no |
| `enable_imessage_channel` | Turn on the agent iMessage channel through Sendblue (imessage-channel.tf): sets IMESSAGE\_CHANNEL\_ENABLED, which shows the Text message card on agent profiles in Go. Needs all four sendblue\_\* inputs: the line one agent answers. Default off. See [Agent iMessage channel](https://docs.runlayer.com/deployment/ecs-features.md#imessage-channel). | `bool` | `false` | no |
| `sendblue_api_key_id` | The iMessage line's Sendblue API key id (sb-api-key-id), from the Sendblue dashboard or `sendblue show-keys`. Required with enable\_imessage\_channel. Delivered to the backend and worker via Secrets Manager. *(sensitive)* | `string` | *(sensitive — omitted)* | no |
| `sendblue_api_secret_key` | The iMessage line's Sendblue API secret key (sb-api-secret-key). Required with enable\_imessage\_channel. Delivered to the backend and worker via Secrets Manager. *(sensitive)* | `string` | *(sensitive — omitted)* | no |
| `sendblue_from_number` | E.164 number of the iMessage channel's Sendblue line people text, e.g. +15551234567 (SENDBLUE\_FROM\_NUMBER). Required with enable\_imessage\_channel, like the other three sendblue\_\* inputs. Texts to other lines on the same Sendblue account are ignored. **Validation:** sendblue\_from\_number must be an E.164 number such as +15551234567. | `string` | `""` | no |
| `sendblue_webhook_secret` | Secret set on the iMessage line's Sendblue `receive` webhook (Developer -> Webhooks) that points at `https://<domain_name>/api/v1/integrations/imessage/sendblue/receive`. Required with enable\_imessage\_channel. Sendblue sends it in the sb-signing-secret header; the backend rejects calls without it. Use a long random value. *(sensitive)* | `string` | *(sensitive — omitted)* | no |
| `runlayer_topic_cpu_timeout` | Backend HTTP client timeout in seconds for RUNLAYER\_TOPIC\_CASCADED requests **Validation:** runlayer\_topic\_cpu\_timeout must be between 5 and 300 | `number` | `30` | no |
| `enable_runlayer_rev` | Run Rev, Runlayer's self-hosted decision model, as its own GPU ECS service (`runlayer-rev`, g6f.large, NLB :8080, `POST /predict/runlayer-rev`) and set `RUNLAYER_REV_ENDPOINT_URL` / `RUNLAYER_REV_TIMEOUT` on the backend. Independent of ToolGuard and the topic CPU stack. | `bool` | `false` | no |
| `enable_runlayer_rev_alarms` | Enable CloudWatch alarms for the Rev service (unhealthy targets; no healthy target for 20 minutes, which also catches a host that never registers), delivered to the Rev alerts topic and the critical-alerts topic when that route exists. | `bool` | `true` | no |
| `runlayer_rev_desired_count` | Rev tasks (= g6f.large hosts; each task takes the host's whole GPU). One slice serves \~8.6 req/s at 256 tokens. A deploy surges one extra host, which needs the 10-15 min GRID driver boot. **Validation:** 1..4. | `number` | `1` | no |
| `runlayer_rev_timeout` | Backend HTTP client timeout in seconds per Rev decision request (`RUNLAYER_REV_TIMEOUT`). Ceiling for every Rev caller. A bounded request (1 chunk of 2400 chars x 8 rules) takes \~1.5 s on the g6f.large slice; anything longer means Rev is overloaded and the cold-path smart rules analyzer fails open. Not on the hot path. **Validation:** 1..60 (matches operator `topicCpu.rev.timeoutSeconds`). | `number` | `15` | no |
| `runlayer_topic_cpu_log_retention_days` | CloudWatch log retention in days for topic CPU service **Validation:** Log retention must be a valid CloudWatch retention period | `number` | `30` | no |
| `enable_runlayer_agents` | Provision infrastructure only custom agents use (the agent event-trigger Kinesis consumer). Requires enable\_runlayer\_agentcore\_runtime = true. Does not turn on custom Agents in the app; that is the custom Agents entitlement (the app's agents feature flag). | `bool` | `false` | no |
| `enable_runlayer_cimd` | Deprecated no-op. CIMD is always enabled. | `bool` | `true` | no |
| `runlayer_agent_sandbox_image_uri` | Docker image URI for the Agent Sandbox Runner. Defaults to the CustomerDistribution ECR image tagged with app\_version. | `string` | `null` | no |
| `runlayer_agent_sandbox_image_repository_arn` | ECR repository ARN for the Agent Sandbox Runner image. Defaults to the repository derived from runlayer\_agent\_sandbox\_image\_uri. | `string` | `null` | no |
| `runlayer_agent_sandbox_sentry_dsn` | Separate Sentry DSN for Agent Sandbox error tracking. Empty disables Agent Sandbox Sentry reporting. *(sensitive)* | `string` | *(sensitive — omitted)* | no |
| `enable_runlayer_agentcore_runtime` | Provision the Bedrock AgentCore agent runtime and its sandbox files bucket. Runlayer Assistant, Security Investigations, Procedures and custom agents run on it, whatever the custom Agents entitlement (the app's agents feature flag) says. | `bool` | `false` | no |
| `runlayer_agentcore_network_mode` | AgentCore runtime network mode. PUBLIC keeps AgentCore public networking. VPC attaches AgentCore ENIs to a consumer VPC and reaches Runlayer through the PrivateLink endpoint service. **Validation:** runlayer\_agentcore\_network\_mode must be PUBLIC or VPC.; runlayer\_agentcore\_network\_mode = VPC requires enable\_privatelink = true.; runlayer\_agentcore\_network\_mode = VPC requires either runlayer\_agentcore\_consumer\_vpc\_id with non-empty runlayer\_agentcore\_consumer\_private\_subnet\_ids, or a module-created consumer VPC: leave both consumer subnet lists unset to derive them, or set runlayer\_agentcore\_consumer\_vpc\_cidr\_block with equally long, non-empty private and public subnet CIDR lists (one pair per consumer AZ). | `string` | `"PUBLIC"` | no |
| `runlayer_agentcore_consumer_vpc_id` | Existing consumer VPC ID for AgentCore VPC networking. Required with runlayer\_agentcore\_consumer\_private\_subnet\_ids when using an existing consumer VPC. Supplied private subnets must already have outbound HTTPS egress, such as through NAT. | `string` | `null` | no |
| `runlayer_agentcore_consumer_private_subnet_ids` | Private subnet IDs in the existing AgentCore consumer VPC. Required with runlayer\_agentcore\_consumer\_vpc\_id when using an existing consumer VPC. These subnets must already route outbound HTTPS through NAT or equivalent egress (see [Self-Hosted Egress Requirements](https://docs.runlayer.com/deployment/egress-requirements.md)). | `list(string)` | `null` | no |
| `runlayer_agentcore_consumer_vpc_cidr_block` | CIDR block for the module-created AgentCore consumer VPC. Defaults to 10.112.0.0/20: the consumer VPC reaches Runlayer only through PrivateLink and is never peered, so its range may overlap any other VPC. | `string` | `null` | no |
| `runlayer_agentcore_consumer_private_subnets` | Private subnet CIDR blocks for the module-created AgentCore consumer VPC, one per consumer AZ. Unset (with the public list also unset) derives one per selected AZ from the second half of the consumer VPC CIDR block (10.112.8.0/24 onward by default). | `list(string)` | `null` | no |
| `runlayer_agentcore_consumer_public_subnets` | Public subnet CIDR blocks in the module-created AgentCore consumer VPC (NAT gateway, or the sandbox egress proxy tasks in proxy\_only), one per consumer AZ. Unset (with the private list also unset) derives one per selected AZ from the first half of the consumer VPC CIDR block (10.112.0.0/24 onward by default). | `list(string)` | `null` | no |
| `sandbox_egress_mode` | How AgentCore sandboxes reach the internet; each value is one rollout step in docs-internal/decision-records/2026-09-16-sandbox-egress-proxy.md. "direct" (default): the runtime security group allows HTTPS to 0.0.0.0/0 through NAT and no proxy exists. "proxy": also deploy the sandbox egress proxy (identity-aware HTTP CONNECT forward proxy, ECS service behind an internal NLB in the consumer VPC) with the consumer VPC's S3, ECR and CloudWatch Logs endpoints, and hand its URL to the backend as SANDBOX\_EGRESS\_PROXY\_URL. Every run routes through it while the direct rule stays, so agent code can still bypass it and policies are not reported as enforced; switching back to direct is an apply. "proxy\_only": remove the direct rule, scope the endpoint policies and enable the consumer VPC DNS firewall. The proxy becomes the only internet path, so a proxy outage stops all sandbox internet traffic; the backend is told policies are enforced (SANDBOX\_EGRESS\_DIRECT\_BYPASS\_CLOSED). proxy and proxy\_only require runlayer\_agentcore\_network\_mode = VPC. **Validation:** sandbox\_egress\_mode must be direct, proxy or proxy\_only.; sandbox\_egress\_mode proxy and proxy\_only require runlayer\_agentcore\_network\_mode = VPC; the proxy lives in the AgentCore consumer VPC and is reachable only from the runtime security group. | `string` | `"direct"` | no |
| `sandbox_egress_proxy_keep_nat_gateway` | Keep the module-created AgentCore consumer VPC's NAT gateway in sandbox\_egress\_mode = "proxy\_only". By default proxy\_only drops it (nothing else in that VPC needs internet) and runs the proxy tasks in the public subnets with their own public IPs, which change whenever a task is replaced. Set true when third parties allowlist the sandboxes' egress IP: the proxy then stays in the private subnets behind the NAT's Elastic IP. | `bool` | `false` | no |
| `sandbox_egress_proxy_image_uri` | Optional sandbox egress proxy image URI. Defaults to the Runlayer customer-distribution image for app\_version. **Validation:** sandbox\_egress\_proxy\_image\_uri must include an explicit tag or digest. | `string` | `null` | no |
| `sandbox_egress_proxy_dns_servers` | Upstream DNS resolvers (IPv4) the sandbox egress proxy uses for destination lookups. The consumer VPC's DNS firewall (active once direct egress is off) answers NXDOMAIN for public names and applies to the proxy too, so it must not use the VPC resolver. Point at your own resolvers if public ones are not acceptable. When they are a DNS filter, list only that filter's resolvers: lookups try the next one after SERVFAIL, REFUSED or a timeout, so a public resolver in the list would resolve names around the filter. **Validation:** sandbox\_egress\_proxy\_dns\_servers must be a non-empty list of IPv4 addresses. | `list(string)` | `["1.1.1.1", "8.8.8.8"]` | no |
| `sandbox_egress_proxy_dns_block_answers` | IP addresses a filtering resolver in sandbox\_egress\_proxy\_dns\_servers (for example your Cloudflare Gateway DNS location) answers with for names it blocks, such as its block-page IPs. The proxy denies a destination that resolves to one of them with 403 egress\_denied, reason "blocked by your organization's DNS filter", instead of dialing it. Nothing is built in: list 0.0.0.0 and :: too when the filter answers blocked names with those (Cloudflare Gateway with its block page off). Empty (default) turns the check off, so deployments without a DNS filter behave as before. **Validation:** sandbox\_egress\_proxy\_dns\_block\_answers entries must be IPv4 or IPv6 addresses. | `list(string)` | `[]` | no |
| `sandbox_egress_proxy_upstream_url` | Optional customer forward proxy ([https://host\[:port](https://host\[:port)]) the sandbox egress proxy opens every allowed tunnel through instead of dialing the destination, so the customer's own web gateway (for example a Cloudflare Gateway source-IP proxy endpoint) filters agent traffic on top of Runlayer's policy. Fails closed: while it is unreachable, agents have no internet. Requires sandbox\_egress\_proxy\_keep\_nat\_gateway = true in proxy\_only, so the customer can register the NAT's Elastic IP as the endpoint's source network. The proxy security group gets its own rule for the gateway's port; destination ports stay capped at 443 plus sandbox\_egress\_proxy\_egress\_ports by the proxy itself. **Validation:** sandbox\_egress\_proxy\_upstream\_url must be [https://host\[:port](https://host\[:port)] in lowercase, without credentials or path.; sandbox\_egress\_proxy\_upstream\_url's port must be between 1 and 65535.; sandbox\_egress\_proxy\_upstream\_url needs sandbox\_egress\_proxy\_keep\_nat\_gateway = true in proxy\_only: without the NAT the proxy's public IP changes with every task and the upstream cannot allowlist it. | `string` | `null` | no |
| `sandbox_egress_proxy_upstream_ca_cert` | Optional PEM bundle that verifies sandbox\_egress\_proxy\_upstream\_url's certificate instead of the public roots. This only authenticates the upstream proxy; it does not make sandboxes trust a TLS-inspecting gateway. **Validation:** sandbox\_egress\_proxy\_upstream\_ca\_cert must be a PEM certificate bundle and requires sandbox\_egress\_proxy\_upstream\_url. | `string` | `null` | no |
| `sandbox_egress_proxy_platform_allow_hosts` | Additional platform host patterns the sandbox egress proxy allows unless the agent's policy explicitly denies them. Empty by default; the Sentry ingest host from runlayer\_agent\_sandbox\_sentry\_dsn is added automatically. Package registries and models.dev follow the agent's network policy. Same grammar as agent policies (host, \*.host, optional :port). **Validation:** sandbox\_egress\_proxy\_platform\_allow\_hosts entries must be lowercase host patterns: host, \*.host, optionally :port. | `list(string)` | `[]` | no |
| `sandbox_egress_proxy_egress_ports` | Destination TCP ports the sandbox egress proxy security group may open to the internet. 443 is always included (the task itself needs it for ECR, Secrets Manager and CloudWatch Logs); list additional ports that agent egress policies may allow as host:port. Without an explicit port a policy allows 443 only. **Validation:** sandbox\_egress\_proxy\_egress\_ports must be a non-empty list of TCP ports between 1 and 65535. | `list(number)` | `[443]` | no |
| `sandbox_egress_proxy_broker_github` | Let the sandbox egress proxy broker the agent's GitHub App token for github.com, api.github.com and uploads.github.com (TLS terminated for those hosts only, 443 only), so the token never enters the sandbox. Requires sandbox\_egress\_mode proxy or proxy\_only and sandbox\_egress\_proxy\_broker\_ca. **Validation:** needs sandbox\_egress\_mode proxy or proxy\_only; must be set together with sandbox\_egress\_proxy\_broker\_ca. | `bool` | `false` | no |
| `sandbox_egress_proxy_broker_ca` | Sensitive PEM certificate and private key (`{ cert_pem, key_pem }`) of a dedicated broker CA the proxy signs its leaves with; stored in its own restricted/ secret read only by the task execution role. Must be CA:TRUE with keyCertSign, valid now and for at least 24h more, or the proxy refuses to start. `cert_pem` may be a bundle: the CA `key_pem` pairs with first, then CAs sandboxes keep trusting during a rotation. Rotate in two applies: (1) `cert_pem` = old CA then new CA, `key_pem` = old key; (2) once every run started before (1) has ended, `cert_pem` = new CA then old CA, `key_pem` = new key; drop the old CA once every run started before (2) has ended. **Validation:** needs a PEM certificate and a PEM private key. | `object({ cert_pem = string, key_pem = string })` | `null` | no |
| `runlayer_agentcore_max_lifetime_seconds` | Maximum lifetime in seconds for AgentCore runtime sessions. **Validation:** runlayer\_agentcore\_max\_lifetime\_seconds must be between 60 and 28800 seconds. | `number` | `28800` | no |
| `runlayer_agentcore_idle_timeout_seconds` | Idle timeout in seconds for AgentCore runtime sessions. Bounds how long a warm conversation microVM survives between runs; in-run waits keep the session busy and are unaffected. **Validation:** runlayer\_agentcore\_idle\_timeout\_seconds must be between 60 and 28800 seconds.; runlayer\_agentcore\_idle\_timeout\_seconds must not exceed runlayer\_agentcore\_max\_lifetime\_seconds (AgentCore rejects idle timeouts above the session max lifetime). | `number` | `900` | no |
| `enable_toolguard_feedback` | Enable S3 storage for customer-submitted ToolGuard false-positive / false-negative feedback. When enabled, creates an S3 bucket and grants backend write access. | `bool` | `true` | no |

## Runlayer Deploy

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `runlayer_deploy_telemetry_proxy_image_uri` | Full image URI for the Runlayer Deploy MCP telemetry proxy health-check sidecar. Required when health checks are enabled. **Validation:** runlayer\_deploy\_telemetry\_proxy\_image\_uri must be set when Runlayer Deploy health checks are enabled. | `string` | `"088332244652.dkr.ecr.us-east-1.amazonaws.com/runlayer/mcp-telemetry-proxy@sh...` | no |
| `runlayer_deploy_use_shared_sg` | When true, create and reuse a single shared security group for Runlayer Deploy ECS services and drop SG mutation IAM permissions. When false (default), allow Terraform to manage a per-service SG via IAM permissions. | `bool` | `false` | no |
| `runlayer_deploy_use_shared_task_role` | When true, create and reuse a single shared IAM task role for Runlayer Deploy ECS services and drop per-deployment IAM role/policy creation permissions. When false (default), allow Terraform to manage a per-deployment task role and policy via IAM permissions. | `bool` | `false` | no |
| `runlayer_deploy_use_managed_policy` | When true (default), attach Runlayer Deploy permissions as a managed IAM policy for migration compatibility. Set false only when managed IAM policies are prohibited, aggregate inline-policy size is verified below the AWS quota, and dense shared-role features are disabled. **Validation:** runlayer\_deploy\_use\_managed\_policy cannot be false when audit-log S3 archive, binary package distribution, audit-log Kinesis, audit-log SIEM export, or the hook-events pipeline is enabled because the shared role can exceed AWS's aggregate inline-policy quota. | `bool` | `true` | no |

## Sentry Relay

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `sentry_dsn` | Sentry DSN override for this environment. If empty, uses value from WorkOS Vault. | `string` | `""` | no |
| `sentry_audit_events_enabled` | DEPRECATED, ignored; remove from callers. Audit events are not sent to Sentry. | `bool` | `false` | no |
| `sentry_relay_enabled` | Enable Sentry Relay deployment. If false, disables relay even if credentials are available. Useful for debugging or cost optimization. | `bool` | `true` | no |
| `sentry_relay_upstream` | Upstream Sentry endpoint for Relay | `string` | `"https://o4509836808028160.ingest.us.sentry.io"` | no |
| `sentry_relay_config` | Sentry Relay ECS task configuration. desired\_count is the Application Auto Scaling floor (target min; max is 2x), not a fixed task count: the live count belongs to autoscaling. See: [https://docs.sentry.io/product/relay/operating-guidelines/](https://docs.sentry.io/product/relay/operating-guidelines/) | `object({ cpu = optional(number, 2048) # 2 vCPU (multi-cor...` | `{}` | no |

## OAuth broker

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `oauth_broker_url` | OAuth Broker URL for OAuth flow handling | `string` | `""` | no |
| `oauth_client_registration_rate_limit_per_hour` | Maximum number of OAuth client registration requests per hour per IP address. Used to prevent abuse of the dynamic client registration endpoint. | `number` | `1000` | no |

## Audit, sessions & hook events

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `enable_hook_events_pipeline` | Enable hook events pipeline: Kinesis stream for ingestion, S3 bucket for Parquet storage. | `bool` | `false` | no |
| `enable_hook_events_parquet_archive` | Run the hook-events Lambda that archives the stream to Parquet in the hook-events bucket, even when no in-stack reader needs it. The Lambda always runs when ML data export (data\_export\_bucket\_arn) or the Sparkle worker is enabled. Off by default: the Lambda takes one of each shard's 5 shared GetRecords/s from the session consumers. | `bool` | `false` | no |
| `hook_events_consumer_image_uri` | Container image URI for the hook-events-consumer Lambda. Defaults to the CustomerDistribution ECR image tagged to match the backend image. Required when the backend image is digest-pinned. **Validation:** hook\_events\_consumer\_image\_uri cannot be an empty string.; hook\_events\_consumer\_image\_uri must be set when the hook-events pipeline is enabled and ecr\_repositories.backend uses a digest. | `string` | `null` | no |
| `hook_events_alert_email` | Email address for hook events pipeline alerts. Empty string disables alerts. | `string` | `""` | no |
| `hook_events_shard_level_metrics` | Per-shard (enhanced monitoring) CloudWatch metrics on the hook-events Kinesis stream, for finding hot shards and the readers that throttle on them; stream-level metrics are always on. Billed as CloudWatch custom metrics at $0.30 per open shard per metric per month (e.g. 3 metrics on a 53-shard stream = about $48/month); on-demand streams add shards as traffic grows. List metrics explicitly: ALL is rejected because the AWS provider documents that it should not be used. Empty (default) = off. **Validation:** hook\_events\_shard\_level\_metrics accepts only IncomingBytes, IncomingRecords, OutgoingBytes, OutgoingRecords, WriteProvisionedThroughputExceeded, ReadProvisionedThroughputExceeded or IteratorAgeMilliseconds (ALL is not supported; list metrics explicitly). | `list(string)` | `[]` | no |
| `hook_events_consumer_enhanced_fan_out` | Read the hook-events stream for the Parquet consumer Lambda through a dedicated enhanced fan-out (EFO) consumer instead of GetRecords polling, taking the Lambda off the 5 GetRecords calls/s/shard budget the other hook-events readers share. EFO reads are billed per GB (us-east-1 on-demand: $0.05 vs $0.04 for GetRecords). Flipping it either way replaces the event source mapping: the new mapping is created before the old one is deleted and starts 5 minutes before the apply, so about 5 minutes of events are written to Parquet twice. None are skipped if the module README's pre-cutover lag check passes right before the apply; defer the flip if it fails. Off (default) = polling. | `bool` | `false` | no |
| `enable_audit_log_kinesis` | Enable audit log Kinesis infrastructure: stream, IAM, and optional dormant standalone consumer service. | `bool` | `false` | no |
| `audit_log_kinesis_shard_count` | Pins the audit-log Kinesis stream to PROVISIONED mode with this many shards; null (the default) keeps ON\_DEMAND, which sizes the stream from recent peak write throughput (AWS splits a shard once it passes about 50% of its write limit). Lease-sharing consumers (audit-log, audit SIEM export) run at most one useful task per open shard, so a pinned count must be at least their max\_capacity. A provisioned stream also caps writes at shard\_count x (1 MB/s or 1,000 records/s). Changing it reshards the live stream and requires Runlayer backend `1.28.2313` or later (the first release with the ENG-6765 fix, #19256), or SIEM export skips the first records of new child shards; see the README before changing it. **Validation:** audit\_log\_kinesis\_shard\_count must be null (ON\_DEMAND) or an integer >= 1. | `number` | `null` | no |
| `audit_log_write_target` | Runtime audit log write target. Set to kinesis only after audit log Kinesis infra is enabled and ready. **Validation:** audit\_log\_write\_target must be one of: aurora, kinesis. | `string` | `"aurora"` | no |
| `audit_log_kinesis_consumer_config` | Standalone audit log Kinesis consumer ECS service configuration. `max_capacity > min_capacity` enables step scale-out on enhanced fan-out lag plus, with `cpu <= 1024`, CPU target tracking on the busiest task (above 1024, lag also scales in); fixed-size fleets (`max_capacity <= min_capacity`, the default) pin the count to desired\_count. See the module README "Audit-log consumer scaling" for sizing (shard count, `cpu <= 1024`, Aurora writer headroom). **Validation:** audit\_log\_kinesis\_consumer\_config requires cpu >= 256, memory >= 512, non-negative counts, and min\_capacity >= 1 when autoscaling is enabled (max\_capacity > min\_capacity): an empty fleet holds no shard subscription, so there is no lag signal to scale back out on. | `object({ enabled = optional(bool, false) cpu = optional(n...` | `{}` | no |
| `audit_log_siem_export_kinesis_consumer_config` | Standalone audit log SIEM export Kinesis consumer ECS service configuration. `max_capacity > min_capacity` enables CPU target tracking on the busiest task; fixed-size fleets (`max_capacity <= min_capacity`, the default) pin the count to desired\_count. See the module README "Audit SIEM export consumer scaling" for sizing (shard count, `cpu <= 1024`, duplicate exports). Default 1 vCPU / 2 GB per task. **Validation:** audit\_log\_siem\_export\_kinesis\_consumer\_config requires `cpu >= 256`, `memory >= 512`, `desired_count >= 1` when enabled, `min_capacity >= 1` and `cpu <= 1024` when autoscaling is enabled. | `object({ enabled = optional(bool, false) cpu = optional(n...` | `{}` | no |
| `audit_log_siem_export_kinesis_s3_prefix` | S3 prefix for enriched audit log SIEM exports written by the Kinesis consumer. | `string` | `"audit-logs"` | no |
| `agent_event_trigger_kinesis_consumer_config` | Standalone agent event-trigger Kinesis consumer ECS service configuration. When enabled, it reads the audit-log Kinesis stream and dispatches matched triggers. Omitted fields default to enabling one worker when audit logs are written to Kinesis and agents are enabled. **Validation:** agent\_event\_trigger\_kinesis\_consumer\_config requires cpu >= 256, memory >= 512, desired\_count = 0 or 1, and dispatch\_retry\_max\_age\_seconds as a whole number >= 0. | `object({ enabled = optional(bool) cpu = optional(number) ...` | `{}` | no |
| `sessions_read_from_postgres` | Flip the sessions read path to the materialized store: list from the agent\_session table, detail from the session-payload S3 bucket. The writers ship with enable\_hook\_events\_pipeline. Off = Redis read path. Instantly revertible. | `bool` | `false` | no |
| `session_materializer_config` | Session materializer ingest ECS service configuration. The service reads the hook-events stream via polling (GetRecords), or enhanced fan-out with `session_materializer_enhanced_fan_out`, writes session parts and is not a PGQueuer worker; compaction runs in the separate compactor service (`session_materializer_compactor_config`). Tasks lease hook-events shards in the checkpoint table, so the task count is useful up to the stream shard count. max\_capacity > min\_capacity enables step autoscaling on ingest lag (MillisBehindLatest); Application Auto Scaling then owns the task count and desired\_count only seeds service creation. Fixed-size fleets (`max_capacity <= min_capacity`) pin the count to desired\_count. Deploys start new tasks before stopping old ones. **Validation:** session\_materializer\_config requires cpu >= 256, memory >= 1024, non-negative counts, and min\_capacity >= 1 when autoscaling is enabled. | `object({ cpu = optional(number, 1024) memory = optional(n...` | `{}` | no |
| `session_materializer_enhanced_fan_out` | Read the hook-events stream for session materializer ingest through a dedicated enhanced fan-out (EFO) consumer instead of GetRecords polling. EFO gives each shard its own 2 MB/s read pipe and lets a task process its leased shards concurrently; it is billed per GB read. Needs a backend image that reads `SESSION_MATERIALIZER_KINESIS_CONSUMER_ARN`. Off (default) = polling. Turning it off is a safe rollback: ingest resumes polling from the same checkpoints and the consumer is deregistered. | `bool` | `false` | no |
| `session_materializer_compactor_config` | Session compactor ECS service configuration: folds session parts into Parquet segments, separate from ingest so a fold failure never stops ingest. Always deployed with the session materializer. Each task runs one fold at a time; scale out, not up. max\_capacity > min\_capacity enables autoscaling on fold duty (CompactionWorkerBusyPct). The service runs tasks only while session\_parquet\_store\_enabled is on; with the store off or infra\_parked it runs zero. **Validation:** session\_materializer\_compactor\_config requires cpu >= 256, memory >= 4096 and min\_capacity >= 1. | `object({ cpu = optional(number, 2048) memory = optional(n...` | `{}` | no |
| `session_parquet_store_enabled` | Kill switch for the session Parquet segment store, which gates session compaction. Off leaves session storage unchanged and the flag is instantly revertible. | `bool` | `false` | no |
| `session_parquet_delete_delay_seconds` | Seconds a compacted session segment must age before the parts it replaced may be reclaimed. The 7-day default is deliberately conservative; lower it per environment only once you are confident in the compacted read path. Enforced floor is 600s. | `number` | `604800` | no |
| `enable_session_search_indexer` | Standalone session-search indexer Kinesis consumer: extracts searchable text / entities / findings from hook events and writes the session-search index tables in Postgres. Requires enable\_hook\_events\_pipeline (true without it fails the plan). Opt-in, default off. DESTRUCTIVE when flipped back to false: it removes the ECS service AND its DynamoDB checkpoint table, dead-letter bucket, IAM role, log group, alarms and dashboard (none carry prevent\_destroy or deletion protection), so the stream position is lost and the next enablement starts a fresh checkpoint table at LATEST — events emitted while disabled are never indexed by the consumer. Index rows already written stay in Postgres (tables are migration-owned, not Terraform); the gap is recoverable only by replay. To merely stop processing while keeping state, use session\_search\_index\_mode = off instead. ECS-only: no Kubernetes operator counterpart yet. | `bool` | `false` | no |
| `session_search_indexer_config` | Standalone session-search indexer Kinesis consumer ECS service configuration (cpu / memory only). The service reads the hook-events stream via polling (GetRecords) and is not a PGQueuer worker. desired\_count is not an input: it is 1 whenever session\_search\_index\_mode is shadow or write and 0 when it is off — see session\_search\_index\_mode for stop-vs-remove semantics. **Validation:** session\_search\_indexer\_config requires cpu >= 256 and memory >= 1024 (the in-process coalescer holds up to SESSIONS\_SEARCH\_MAX\_COALESCER\_BYTES, 256 MiB by default, beside a 10 MiB poll batch). | `object({ cpu = optional(number, 512) memory = optional(nu...` | `{}` | no |
| `session_search_index_mode` | SESSIONS\_SEARCH\_INDEX\_MODE for the indexer task, and the non-destructive kill switch. shadow = parse + extract + coalesce + metrics, no writes (soak mode); write = real index writes, and the only mode that creates the coverage-gap alarm (the CoverageGapSessions sweep runs only when rows are actually written); off = STOP PROCESSING, KEEP STATE: the ECS service scales to desired\_count 0 while the checkpoint table, DLQ bucket, IAM, log group and dashboard stay in place, and the lag and freshness alarms are not created (a parked consumer emits no heartbeat). The process also exits immediately if started in off mode, as defence-in-depth against a stray task. Flipping back to shadow/write resumes from the saved checkpoint. Instantly revertible either way. To REMOVE the service and its checkpoint state, set enable\_session\_search\_indexer = false (destructive, see that variable). **Validation:** session\_search\_index\_mode must be one of: off, shadow, write. | `string` | `"shadow"` | no |
| `session_search_indexer_extra_env` | Passthrough env for the indexer task only, merged last onto its environment so any SESSIONS\_SEARCH\_\* knob can be tuned without a module change (e.g. SESSIONS\_SEARCH\_FLUSH\_SECONDS, SESSIONS\_SEARCH\_MAX\_ROWS\_PER\_SECOND). Keys must start with SESSIONS\_SEARCH\_, or be FF\_ENABLE / FF\_DISABLE: the indexer's write gate is the per-org feature flag session-search-ingest, so FF\_ENABLE = "session-search-ingest" turns on index writes where per-org flags are unavailable. Scoped to this task: the backend and worker never see it. Keys the module wires itself are rejected: SESSIONS\_SEARCH\_INDEX\_MODE (set session\_search\_index\_mode instead — it also drives desired\_count and the alarm gates, so a passthrough would run the process in one mode while Terraform provisions for another) and the stream / checkpoint-table / dead-letter-bucket pointers. **Validation:** session\_search\_indexer\_extra\_env keys must start with SESSIONS\_SEARCH\_ (or be FF\_ENABLE / FF\_DISABLE).; session\_search\_indexer\_extra\_env must not set SESSIONS\_SEARCH\_INDEX\_MODE — use var.session\_search\_index\_mode, which also drives desired\_count and the alarm gates — nor the module-owned SESSIONS\_SEARCH\_KINESIS\_STREAM\_ARN / \_CHECKPOINT\_TABLE\_NAME / \_DEAD\_LETTER\_BUCKET pointers. | `map(string)` | `{}` | no |
| `enable_cold_analyzers_consumer` | Standalone cold-analyzers Kinesis consumer: re-derives agent token usage facts off the hot path into a separate analytics table. Requires enable\_hook\_events\_pipeline; null (default) follows it, false opts out (saves one always-on Fargate singleton), true fails the plan without it. ToolGuard is optional; without it, tokenizer-derived facts are skipped without stalling the stream shard. ECS-only: no Kubernetes operator counterpart. | `bool` | `null` | no |
| `cold_analyzers_consumer_config` | Standalone cold-analyzers Kinesis consumer ECS service configuration. The service reads the hook-events stream via polling (GetRecords) and is not a PGQueuer worker. Tasks lease shards in the checkpoint table, so desired\_count may exceed 1 (useful up to the stream shard count). Upgrade to the leasing module version at the current desired\_count first and raise it in a later apply: a pre-leasing task overlapping leased peers causes duplicate delivery (never loss). The memory floor covers one poll batch of flattened tokenizer inputs (a GetRecords call can return \~10MB) alongside the fact rows it derives. **Validation:** cold\_analyzers\_consumer\_config requires cpu >= 256, memory >= 2048, and desired\_count >= 0. | `object({ cpu = optional(number, 512) memory = optional(nu...` | `{}` | no |
| `session_siem_export_kinesis_consumer_config` | Standalone session SIEM export Kinesis consumer ECS service configuration. The service reads hook events via polling and writes gzipped NDJSON to the selected managed or external S3 bucket. Tasks lease shards in the checkpoint table, so desired\_count may exceed 1 (useful up to the stream shard count). Upgrade to the leasing module version at the current desired\_count first and raise it in a later apply: a pre-leasing task overlapping leased peers causes duplicate delivery (never loss). Memory floor is 2048: batches are up to 10 MiB of unslimmed session content. **Validation:** session\_siem\_export\_kinesis\_consumer\_config requires cpu >= 256, memory >= 2048, and desired\_count >= 1 when enabled. | `object({ enabled = optional(bool, false) cpu = optional(n...` | `{}` | no |
| `session_siem_export_external_s3_bucket` | Existing external S3 bucket name for session SIEM export. When set for an enabled consumer, the module writes session objects there instead of creating a Runlayer-owned destination bucket. **Validation:** session\_siem\_export\_external\_s3\_bucket must be a bucket name, not an ARN. | `string` | `""` | no |
| `session_siem_export_external_s3_region` | AWS region of the external session SIEM export bucket for direct writes. Defaults to the ECS deployment region. Ignored for assume-role exports. **Validation:** session\_siem\_export\_external\_s3\_region must be a valid AWS region (e.g. us-east-1). | `string` | `""` | no |
| `session_siem_export_external_s3_kms_key_arn` | Optional KMS key ARN for direct writes to an external session SIEM export bucket using SSE-KMS. Only valid without session\_siem\_export\_assume\_role\_arn; for assume-role exports, the customer role must hold KMS permissions. **Validation:** session\_siem\_export\_external\_s3\_kms\_key\_arn must be a KMS key ARN. | `string` | `""` | no |
| `session_siem_export_assume_role_arn` | Optional customer-owned IAM role ARN to assume before writing session SIEM export objects to the destination bucket. **Validation:** session\_siem\_export\_assume\_role\_arn must be an IAM role ARN. | `string` | `""` | no |
| `session_siem_export_external_id` | ExternalId value used when assuming session\_siem\_export\_assume\_role\_arn. | `string` | `""` | no |
| `session_siem_export_s3_prefix` | S3 key prefix for session SIEM export objects. Leading/trailing slashes are trimmed. Set to an empty string to write at bucket root. | `string` | `"sessions"` | no |
| `enable_audit_payload_offload` | Enable S3 offloading for large audit log payloads (>10KB). When enabled, creates an S3 bucket and grants backend access to store/retrieve large tool call results. | `bool` | `true` | no |
| `enable_audit_log_spool` | Route audit log emission through a local-disk spool + in-process tailer so proxy requests do not wait on audit delivery (S3 offload, Aurora/Kinesis write, Sentry emit). Records are delivered within seconds; the spool lives on task ephemeral storage (Fargate-encrypted at rest). **Validation:** The audit spool's shutdown drain window is backend\_stop\_timeout\_seconds - 30s; at `<= 30s` it is zero and undelivered audit records are lost on every deploy. Raise backend\_stop\_timeout\_seconds above 30 or set enable\_audit\_log\_spool = false. | `bool` | `true` | no |
| `audit_log_spool_max_bytes` | App-level audit-spool byte budget, rendered as AUDIT\_LOG\_SPOOL\_MAX\_BYTES on the backend task only (parity with the k8s chart/CRD maxBytes knob). null (default) omits the env and the backend's 512MB default applies. The spool (and its dead-letter quarantine, which shares this budget) lives on the backend task's ephemeral storage — when raising this well past the default, size backend task ephemeral storage accordingly. **Validation:** audit\_log\_spool\_max\_bytes must be a positive integer byte count no larger than 2^62 (the k8s paths cap it identically so size derivations can never overflow; the backend setting is an int, so a fractional value would fail task startup).; audit\_log\_spool\_max\_bytes must be smaller than backend\_ephemeral\_storage\_size\_gib — the spool (and its dead-letter quarantine) lives on the backend task's ephemeral disk, which also holds images, logs, and other task data. | `number` | `null` | no |
| `enable_audit_log_siem_export` | Enable audit log SIEM export. By default this creates/manages a Runlayer S3 bucket unless audit\_log\_siem\_export\_external\_s3\_bucket is set. | `bool` | `false` | no |
| `audit_log_siem_export_external_s3_bucket` | Existing external S3 bucket name for audit log SIEM export. When set with enable\_audit\_log\_siem\_export, the module writes SIEM objects there instead of creating a Runlayer-owned SIEM export bucket. **Validation:** audit\_log\_siem\_export\_external\_s3\_bucket must be a bucket name, not an ARN. | `string` | `""` | no |
| `audit_log_siem_export_external_s3_region` | AWS region of the external SIEM export S3 bucket for direct bucket writes. Defaults to the ECS deployment region. Ignored for assume-role exports. **Validation:** audit\_log\_siem\_export\_external\_s3\_region must be a valid AWS region (e.g. us-east-1). | `string` | `""` | no |
| `audit_log_siem_export_external_s3_kms_key_arn` | Optional KMS key ARN for direct writes to an external audit log SIEM export S3 bucket using SSE-KMS. Only valid without audit\_log\_siem\_export\_assume\_role\_arn; for assume-role exports, the customer role must hold KMS permissions. **Validation:** audit\_log\_siem\_export\_external\_s3\_kms\_key\_arn must be a KMS key ARN. | `string` | `""` | no |
| `audit_log_siem_export_assume_role_arn` | Optional customer-owned IAM role ARN to assume before writing audit log SIEM export objects to the destination S3 bucket. **Validation:** audit\_log\_siem\_export\_assume\_role\_arn must be an IAM role ARN. | `string` | `""` | no |
| `audit_log_siem_export_external_id` | ExternalId value used when assuming audit\_log\_siem\_export\_assume\_role\_arn. | `string` | `""` | no |
| `audit_log_siem_export_s3_prefix` | S3 key prefix for audit log SIEM export objects. Leading/trailing slashes are trimmed. Set to an empty string to write at bucket root. | `string` | `"audit-logs"` | no |
| `enable_audit_log_s3_archive` | Enable audit log S3 archive bucket, ECS task, and schedule. | `bool` | `true` | no |
| `audit_log_archive_task_config` | ECS task config for the audit log S3 archive job. 4GB memory is temporary backfill headroom to avoid OOMs on large legacy audit payloads. **Validation:** audit\_log\_archive\_task\_config requires cpu >= 256 and memory >= 512. | `object({ cpu = optional(number, 512) memory = optional(nu...` | `{}` | no |
| `audit_log_archive_hot_window_days` | Days to keep hot in Aurora before archiving to S3. 0 archives all data (sandbox/test only). | `number` | `90` | no |
| `audit_log_siem_export_read_role_arns` | IAM role ARNs allowed to read and list audit log SIEM export objects from the Runlayer-managed bucket. Ignored when audit\_log\_siem\_export\_external\_s3\_bucket is set. | `list(string)` | `[]` | no |
| `session_siem_export_read_role_arns` | Customer-side IAM role ARNs granted read and list access to the Runlayer-managed session SIEM export bucket. Ignored when session\_siem\_export\_external\_s3\_bucket is set. | `list(string)` | `[]` | no |

## Secrets & misc features

| Name | Description | Type | Default | Required |
| - | - | - | - | - |
| `distribution_api_key` | Optional Distribution API reader credential for the flagd OpenFeature provider. *(sensitive)* | `string` | *(sensitive — omitted)* | no |
| `secret_key` | Existing non-empty application secret key. Must be provided with master\_salt. Omit both to generate new values. **Validation:** secret\_key and master\_salt must both be non-empty or both be omitted. *(sensitive)* | `string` | `null` | no |
| `master_salt` | Existing non-empty application master salt. Must be provided with secret\_key. Omit both to generate new values. *(sensitive)* | `string` | `null` | no |
| `runlayer_download_token` | Token sent as x-runlayer-download-token to fetch binary release manifests from downloads.runlayer.com. Must match one of the downloads distribution's download\_tokens. Empty disables binary release discovery. *(sensitive)* | `string` | *(sensitive — omitted)* | no |
| `runlayer_downloads_base_url` | Base URL for the binary distribution CDN that serves release manifests. | `string` | `"https://downloads.runlayer.com"` | no |
| `enable_dashboard` | Enable CloudWatch infrastructure dashboard | `bool` | `true` | no |
| `event_loop_monitor_interval_s` | Event loop monitor polling interval in seconds **Validation:** event\_loop\_monitor\_interval\_s must be null or >= 0. Set 0 to disable. | `number` | `null` | no |
| `event_loop_warn_threshold_ms` | Event loop block duration (ms) that triggers CloudWatch EMF emission. **Validation:** event\_loop\_warn\_threshold\_ms must be null or > 0. | `number` | `null` | no |
| `event_loop_slow_callback_threshold_s` | Threshold (seconds) for asyncio slow callback warnings. **Validation:** event\_loop\_slow\_callback\_threshold\_s must be null or > 0. | `number` | `null` | no |
| `event_loop_slow_callback_on_s` | Duration (seconds) to enable slow callback logging per duty cycle. **Validation:** event\_loop\_slow\_callback\_on\_s must be null or > 0. | `number` | `null` | no |
| `enable_tool_output_offload` | Enable dedicated S3 bucket for tool output offloading (>10KB). Separate from audit payload storage. | `bool` | `false` | no |
| `enable_binary_package_distribution` | Enable the S3 cache bucket for binary packages mirrored from downloads.runlayer.com. Release discovery and cache population require runlayer\_download\_token; serving cached artifacts does not. | `bool` | `false` | no |
| `data_export_bucket_arn` | ARN of the external drop-zone S3 bucket that hook-events parquet is pushed to. ARN string only (never a foreign-account principal) so applies never depend on the destination account's state. Empty disables the whole sync stack. **Validation:** data\_export\_bucket\_arn must be an S3 bucket ARN (arn:aws:s3:::bucket-name) or empty. | `string` | `""` | no |
| `data_export_sync_task_config` | ECS task config for the Data export sync job. Defaults size the task for the in-tenant scrub (in-process NER model plus parquet rewrite buffers). The NER scrub is single-core CPU-bound, so `workers` > 1 scrubs files in that many processes, each with its own model (\~1 GB each, plus \~1 GB for the parent); raise cpu and memory with it. **Validation:** data\_export\_sync\_task\_config requires cpu >= 256 and memory >= 512. data\_export\_sync\_task\_config.workers > 1 needs cpu >= workers x 1024 and memory >= (workers + 1) x 1024 MiB (\~1 GB per scrub process plus the parent). | `object({ cpu = optional(number, 1024) memory = optional(n...` | `{}` | no |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.