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 for deploy steps and examples.
For corporate egress filters / SWG allowlists, see
Self-Hosted Egress Requirements.
Requirements
| Name | Version |
|---|---|
| Terraform / OpenTofu | >= 1.12.0 |
hashicorp/aws | >= 6.68.0, < 7.0.0 |
hashicorp/random | ~> 3.9 |
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 |
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 |
provisioned_tenant_secret_layout | How the provisioned tenant secret is laid out. "json" (default): one secret, restricted/<project>-<env>-provisioned, a JSON document with every key. "per_key": one secret per key, restricted/<project>-<env>-provisioned/<KEY>, holding the raw key; Terraform lists the secrets that exist and tasks read only those, so a key that is not provisioned has no secret. With "per_key" the JSON secret is not read (the outputs provisioned_tenant_secret_name and provisioned_tenant_secret_arn are null), so Terraform does not need it. Ask Runlayer before deleting it: Runlayer may still write it, a switch back to "json" needs it, and ECS can roll a failed deployment back to a task definition that reads it. Leave it at the default unless Runlayer has written the per-key secrets for your deployment. Ignored with tenant_key_vault_enabled; a stateless root follows its primary. Validation: provisioned_tenant_secret_layout must be “json” or “per_key”. | string | "json" | no |
tenant_secret_source | Deprecated: accepts only "provisioned"; remove it from callers (it goes away in the next major). The WorkOS, Sentry and Resend keys (AUTH_API_KEY, RESEND_API_KEY, SENTRY_DSN, SENTRY_RELAY_*) always come from Secrets Manager, where Runlayer creates and fills them before the apply; Terraform only looks them up and tasks read the keys from them. Which secrets depends on provisioned_tenant_secret_layout. "json" (default): the one secret restricted/<project>-<env>-provisioned (output provisioned_tenant_secret_name), whose every version must carry all six keys (empty string when unused). "per_key": one secret per key under that name; the JSON secret is not read and the output is null. The Distribution reader key is unaffected. A stateless root reads its primary’s secrets through central_state. Validation: tenant_secret_source = "input" is no longer supported: the WorkOS, Sentry and Resend keys are read from the provisioned tenant secret; create and fill it, remove auth_api_key and drop the variable. | string | "provisioned" | 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 |
enable_ai_watch_ca_kms | Let the backend create and sign with each organization’s AI Watch CA keys (TLS root and device identity) as asymmetric KMS keys: a key-admin IAM role that creates them and their aliases and retires keys the backend no longer uses (30-day KMS waiting period), and the task-role tag their key policies 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"; on an existing deployment, apply that first, since plan refuses while the backend, worker or MCP exec worker may still run a revision without it, or the frontend or Relay a revision with the task role. | 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 |
additional_hostnames | Multi-region deployments only. Hostnames the backend accepts besides domain_name, such as routed.<domain_name> and <region>.<domain_name>; every URL it builds (OAuth metadata, redirect URIs, links) stays on domain_name. Creates no DNS record and no certificate SAN. Empty (default) changes nothing. Validation: lowercase DNS names (no scheme, port, path or wildcard) other than domain_name. | list(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. Feeds only the internal ALB alarm, which has actions disabled; the public ALB 5XX page is a Mimir rule that does not read this input. 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_blocklist_ipv4_cidrs | IPv4 sources to block outright at the ALB WAF (403), evaluated before every other WAF rule, including the IP allowlist and its exemptions. Validation: At most 1000 entries; each must be an IPv4 CIDR with prefix length 1–32 and no host bits set (e.g. 203.0.113.7/32). Empty list blocks nothing here; temporary blocks go in the runtime IP set (output waf_runtime_blocklist_ip_sets). | list(string) | [] | no |
waf_blocklist_ipv6_cidrs | IPv6 sources to block outright at the ALB WAF (403), evaluated before every other WAF rule. Only takes effect on a dual-stack ALB (enable_ipv6). Validation: At most 1000 entries; each must be an IPv6 CIDR with prefix length 1–128 and no host bits set (e.g. 2001:db8::/48). Empty list blocks nothing here; temporary blocks go in the runtime IP set (output waf_runtime_blocklist_ip_sets). | list(string) | [] | no |
waf_ip_reputation_mode | Amazon IP reputation mode at the ALB WAF. block uses AWS’s rule actions, count counts the group’s would-block results, and off omits the group. | string | "block" | no |
waf_oauth_ssrf_guard | OAuth SSRF probe rules at the ALB WAF on /api/v1/oauth/ and /api/v1/cli/. metadata_target_mode: query arguments or body naming a cloud metadata address (selected spellings of 169.254.169.254, 169.254.170.2, metadata.google.internal, fd00:ec2::254); loopback redirect URIs are never matched. rebinding_host_mode: the hostname of a client_id query parameter on a wildcard-DNS rebinding service (nip.io, sslip.io, localtest.me, …); the raw-body check only counts and does not parse token forms. uri_path_prefixes overrides the paths. Validation: each mode is off, count or block. Both modes off creates no rule. | object | {} | no |
waf_unauthenticated_rate_limit | Per-source-IP rate limit at the ALB WAF on over-limit /api/ requests with no nonempty recognized credential header, e.g. { mode = "count", limit = 1000 } per 300 s. mode is count or block (429). Slack, Teams, Sendblue and Anthropic inference webhooks, agent webhook invocations, external approval decisions, the frontend Sentry tunnel and /api/v1/oauth/token are exempt; exempt_uri_path_prefixes, exempt_uri_path_regexes and credential_headers extend those defaults. Validation: integer limit of at least 10; evaluation_window_sec 60, 120, 300 or 600. null creates no rule. | object | null | 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.7.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 | Initial count and runtime minimum for deployment-local tunnel OTEL Collector tasks. Runs whenever tunnels run, including with central observability off. Equal maximum and desired counts pin capacity. Validation: positive integer. | number | 1 | no |
tunnel_otel_collector_max_capacity | Maximum collector tasks. Null resolves to the larger of four and the desired count. Larger than the desired count enables CPU target tracking; equal bounds pin capacity. Validation: null or whole number at least the desired count. | number | null | no |
tunnel_otel_collector_cpu_target | Target average ECS CPU utilization percentage for collector autoscaling, independent of central observability. Validation: greater than 0 and less than 100. | number | 60 | 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. instance_count (default 2) is the total number of Aurora instances: one writer plus instance_count - 1 readers; raise it to add read replicas. Validation: instance_count must be a whole number from 2 to 16, or to 15 when enable_ops_reader is true (the ops reader takes a slot). 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_escalated_lock_timeout_ms | Optional override for the backend migration task’s escalated PostgreSQL lock_timeout, in milliseconds, used after the base tier of attempts is exhausted. Raise it (e.g. 120000) for a deploy whose migrations starve on lock contention. Null keeps the runner default (30000) Validation: migration_escalated_lock_timeout_ms must be null or an integer > 0. Use migration_escalated_tier_attempts = 0 to disable escalation. | number | null | no |
migration_base_tier_attempts | Optional override for how many backend migration attempts use migration_lock_timeout_ms before escalating. Null keeps the runner default (20) Validation: migration_base_tier_attempts must be null or an integer >= 0. | number | null | no |
migration_escalated_tier_attempts | Optional override for how many backend migration attempts use migration_escalated_lock_timeout_ms before the deploy fails. 0 (or migration_lock_timeout_ms = 0) disables escalation and restores flat retries. migration_retry_count always caps total attempts. Null keeps the runner default (5) Validation: migration_escalated_tier_attempts must be null or an integer >= 0. | number | null | 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 | DatabaseConnections count at or above which backend health scaling withholds scale-out. The hosted Mimir rule AwsRdsDatabaseConnectionsHigh pages #incidents at 2700 and posts a copy to #alerts-tooling. It does not read this override. A self-hosted deployment does not evaluate it. | number | 2700 | no |
rds_writer_cpu_utilization_threshold | Retained so a configuration that sets it still plans. It no longer creates an alarm. The hosted Mimir rule AwsRdsWriterCpuHigh pages #incidents at 85% for 3 five-minute periods and posts a copy to #alerts-tooling. It does not read this override. A self-hosted deployment does not evaluate it. Validation: rds_writer_cpu_utilization_threshold must be a percentage in (0, 100]. | number | 85 | no |
rds_reader_cpu_utilization_threshold | Retained so a configuration that sets it still plans. It no longer creates an alarm. The hosted Mimir rule AwsRdsReaderCpuHigh pages #incidents at 90% for 3 five-minute periods and posts a copy to #alerts-tooling. It does not read this override. A self-hosted deployment does not evaluate it. Validation: rds_reader_cpu_utilization_threshold must be a percentage in (0, 100]. | number | 90 | no |
rds_replica_lag_threshold_ms | Aurora AuroraReplicaLag (ms) that an instance’s replica-lag alarm must exceed (per-minute Maximum) in 5 consecutive minutes to fire. One alarm per cluster instance (DBInstanceIdentifier); Aurora emits the metric only while the instance is a replica, so it follows failover. Default 1000 is ~40x the measured p99 (~26 ms); measured spikes above 1 s last a single minute. Validation: rds_replica_lag_threshold_ms must be a positive number of milliseconds. | number | 1000 | 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 | Retained so a configuration that sets it still plans. It no longer creates an alarm. The hosted Mimir rule AwsRedisConnectionsHigh pages #incidents at 20000 and posts a copy to #alerts-tooling. It does not read this override. A self-hosted deployment does not evaluate it. | number | 20000 | no |
redis_connections_per_backend_task_threshold | Retained so a configuration that sets it still plans. It no longer creates an alarm. The hosted Mimir rule AwsRedisConnectionsPerBackendTask pages #incidents at 750 and posts a copy to #alerts-tooling. It does not read this override. A self-hosted deployment does not evaluate it. | number | 750 | no |
critical_redis_curr_connections_threshold | Retained so a configuration that sets it still plans. It no longer creates an alarm. The hosted Mimir rule AwsCriticalRedisConnectionsHigh pages #incidents at 2000 and posts a copy to #alerts-tooling. It does not read this override. A self-hosted deployment does not evaluate it. | number | null | no |
redis_evictions_threshold | Threshold for Redis Evictions alarm (sum over period) | number | 1 | no |
redis_burst_evictions_threshold | Retained so a configuration that sets it still plans. It no longer creates an alarm. The hosted Mimir rule AwsRedisEvictionBurst pages #incidents at 5000 per 5 minutes and posts a copy to #alerts-tooling. It does not read this override. A self-hosted deployment does not evaluate it. | number | 5000 | no |
redis_sustained_evictions_threshold | Retained so a configuration that sets it still plans. It no longer creates an alarm. The hosted Mimir rule AwsRedisEvictionsSustained pages #incidents at 500 per hour for 3 hours and posts a copy to #alerts-tooling. It does not read this override. A self-hosted deployment does not evaluate it. | 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. Empty (the default) keeps frontend Sentry disabled; it also stays disabled while the Relay is off (sentry_relay_enabled) or sentry_dsn is empty. 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 agent-runs-stalled alarm fires. 0 means any stalled run alerts. That alarm goes to critical_alerts_extra_sns_topic_arns only and never pages; with that list empty it notifies nothing. Validation: agent_run_stalled_count_threshold must not be negative. | number | 0 | no |
agent_run_stalled_page_threshold | Number of concurrently stalled agent runs tolerated before the agent-runs-stalled-many alarm pages through the critical-alerts topic. That alarm also pages when the agent-run health metrics stop arriving. Raised to agent_run_stalled_count_threshold when set below it. Validation: agent_run_stalled_page_threshold must not be negative. | number | 4 | 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_ami_id | Override the base image for the ToolGuard GPU hosts (and the capacity bench) with an AMI ID in this region. Null uses the module’s pinned Canonical Ubuntu 22.04 build. Use it to roll back to the last image that booted, or to supply your own Ubuntu 22.04 x86_64 image (the user data still installs the GRID driver, Docker and the ECS agent). Changing it rolls every ToolGuard host. Validation: an AMI ID (ami-...) or null. | string | null | 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 launch lifecycle hook timeout. 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. | 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, g6.xlarge, 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 (= g6.xlarge hosts, 4 vCPU and one full L4 each; each task takes the host’s whole GPU). On the L4 a 1k-token decision takes ~577 ms for 16 rules on v1 and ~234 ms for 120 rules on v2; one host covers the smart rules analyzer’s cold-path load. A deploy surges one extra host, which needs the 10-15 min GRID driver boot, so GPU vCPU quota must cover desired_count + 1 hosts. Validation: 1..4. | number | 1 | no |
runlayer_rev_ami_id | Override the base image for the Rev GPU hosts with an AMI ID in this region. Null uses the same pinned build as ToolGuard. Same rules as runlayer_tool_guard_ami_id. Changing it rolls every Rev host. Validation: an AMI ID (ami-...) or null. | string | null | 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 well under 1 s on the g6.xlarge L4 (~1.5 s on the g6f.large slice Rev used before); 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 |
enable_runlayer_clef_flash | Run clef-flash (Cloudflare, Apache-2.0), a decision model separate from Rev, as its own GPU ECS service (runlayer-clef-flash, g6e.xlarge with per-AZ g6e.2xlarge fallback, NLB :8080, POST /predict/runlayer-clef-flash, Rev’s request and response contract) and set RUNLAYER_CLEF_FLASH_ENDPOINT_URL / RUNLAYER_CLEF_FLASH_TIMEOUT on the backend. No feature calls it yet: leave it off until a release ships the image and the detection-escalation feature. Smart rules, Slack gates and Command K always use Rev, so enabling this changes no existing decision. | bool | false | no |
enable_runlayer_clef_flash_alarms | Enable CloudWatch alarms for the clef-flash service (a target unhealthy for longer than a model load; no healthy target for about 41 minutes, past a full cold start; host bootstrap failures), delivered to the clef-flash alerts topic and the critical-alerts topic when that route exists. | bool | true | no |
runlayer_clef_flash_image_tag | clef-flash GPU image tag (runlayer-clef-flash-guard-gpu-v<YYYYMMDDhhmm>, weights baked in). Validation: starts with runlayer-clef-flash-guard-gpu-v. | string | runlayer-clef-flash-guard-gpu-v202611302243 | no |
runlayer_clef_flash_desired_count | clef-flash tasks (= g6e hosts, g6e.xlarge preferred with per-AZ g6e.2xlarge fallback; a fallback host stays on g6e.2xlarge until replaced and uses 8 G/VT vCPUs vs 4). A deploy surges one extra host, which needs the GRID driver boot plus the image pull and model load. Validation: 1..4. | number | 1 | no |
runlayer_clef_flash_ami_id | Override the base image for the clef-flash GPU hosts with an AMI ID in this region. Null uses the same pinned build as ToolGuard and Rev. Validation: an AMI ID (ami-...) or null. | string | null | no |
runlayer_clef_flash_timeout | Backend HTTP client timeout in seconds per clef-flash request (RUNLAYER_CLEF_FLASH_TIMEOUT); read only by the clef-flash client. Validation: 1..60. | 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). | 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]) 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. In proxy_only, set sandbox_egress_proxy_keep_nat_gateway = true for a stable public source IP, or set sandbox_egress_proxy_upstream_private_cidrs for a private gateway. 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] in lowercase, without credentials or path.; sandbox_egress_proxy_upstream_url’s port must be between 1 and 65535.; In proxy_only, sandbox_egress_proxy_upstream_url requires sandbox_egress_proxy_keep_nat_gateway = true for a stable public source IP or sandbox_egress_proxy_upstream_private_cidrs for a private gateway.; sandbox_egress_proxy_upstream_private_cidrs requires sandbox_egress_proxy_upstream_url.; When sandbox_egress_proxy_upstream_private_cidrs is set, a gateway IP literal must be a permitted public IPv4 address or belong to a declared private CIDR. In proxy_only with sandbox_egress_proxy_keep_nat_gateway = false, it must belong to a declared private CIDR. | string | null | no |
sandbox_egress_proxy_upstream_private_cidrs | Optional RFC1918 IPv4 CIDRs for the connection to sandbox_egress_proxy_upstream_url. The gateway must be reachable from the proxy task subnets and present a certificate valid for its hostname. Agent-selected destinations keep their private-address restrictions. Validation: sandbox_egress_proxy_upstream_private_cidrs entries must be IPv4 CIDRs wholly within 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16, with no leading zeros. | list(string) | [] | 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 |
runlayer_agentcore_run_from_ram | On the AgentCore V2 runtime, keep Bun and the sandbox runtime’s code in memory so restored sessions start without reading them from disk. Uses about 230 MB more memory per agent session. Ignored on V1. | bool | true | 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 | Backend Sentry DSN. It never reaches tasks (they read SENTRY_DSN from the provisioned tenant secret): it only gates frontend Sentry, so set it to the same DSN the provisioned secret carries when you want that. A stateless root mirrors its primary’s setting. | 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. Terraform cannot see whether the provisioned tenant secret carries Relay credentials, so set this to false for a deployment without them; also 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/ | 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, and the session materializer that writes sessions to Postgres and S3. null (default) turns it on, except in a region_role = “stateless” root, which takes it from the primary. false keeps sessions on the Redis store only. | bool | null | 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 | Retained so a configuration that sets it still plans. It no longer creates an alarm. The hook-events failure-rate email is no longer sent. | 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 (GetRecords), or enhanced fan-out with session_siem_export_enhanced_fan_out, 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_enhanced_fan_out | Read the hook-events stream for session SIEM export through a dedicated enhanced fan-out (EFO) consumer instead of GetRecords polling, taking the exporter off the read budget every polling hook-events reader shares. EFO gives each shard its own 2 MB/s read pipe and is billed per GB read. On EFO the exporter gathers each shard’s pushed events for up to 1 second or 500 records into one export, as the audit-log SIEM exporter does, and saves the checkpoint after every export. Needs a backend image that reads SESSION_SIEM_EXPORT_KINESIS_CONSUMER_ARN. Off (default) = polling. Turning it off is a safe rollback: the exporter resumes polling from the same checkpoints and the consumer is deregistered. | bool | false | 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 |
audit_log_siem_export_key_layout | Audit log SIEM export object key layout. legacy keeps <prefix>/year=.../ keys. org_partitioned writes each organization’s objects under <prefix>/organization_id=<uuid>/ and records with no organization under <prefix>/unscoped/, so reader grants can be scoped per organization. Validation: audit_log_siem_export_key_layout must be “legacy” or “org_partitioned”. | string | "legacy" | 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. Must be unset with distribution_reader_key_source = "provisioned". (sensitive) | string | (sensitive — omitted) | no |
tenant_key_vault_enabled | true: the deployment gets every Runlayer-issued key from Runlayer’s tenant key vault; the keys never reach Terraform inputs, state or CI. A function the module adds copies each key into a secret in your account (restricted/<project>-<environment short name>-tenant-key-copy/<KEY>), every minute and during the apply, and tasks read those copies. The vault keeps each key in a secret of its own, named after your task execution role and the key (tenants/<your account ID>/<task execution role name>/<KEY>), so the module builds every ARN from that role’s name and no key is exchanged with Runlayer. Ask Runlayer to onboard your deployment, set this, add root outputs for module.<name>.tenant_key_vault_secret_prefix_arn and module.<name>.ecs_task_execution_role_arn (a plan shows only outputs your root declares; snippet in ECS configuration), and run terraform plan without applying: the first shows the path your keys are copied from, the second the role that reads it. Send Runlayer both and apply once Runlayer confirms they equal the path it wrote your keys under and the role the vault lets in. The vault’s secrets expire together and Runlayer renews them; your copies do not expire. Validation: requires distribution_reader_key_source = "provisioned", distribution_api_url and openfeature_provider = "flagd"; not supported with region_role. | bool | false | no |
tenant_key_vault_account_id | AWS account of Runlayer’s tenant key vault. Leave as is unless Runlayer tells you otherwise. Validation: must be a 12-digit AWS account ID. | string | "625482318743" | no |
tenant_key_vault_region | AWS region of Runlayer’s tenant key vault. Leave as is unless Runlayer tells you otherwise. | string | "us-east-1" | no |
tenant_key_vault_secret_arn | Deprecated and ignored: remove it. It named the one vault secret that held every key; each key now has a secret of its own. Kept for one release so a module call that still sets it plans. Validation: refused without tenant_key_vault_enabled, which is what turns the vault on. | string | "" | no |
tenant_key_vault_kms_key_arn | Deprecated and ignored: remove it. Kept for one release so a module call that still sets it plans. | string | "" | no |
distribution_reader_key_source | Where the Distribution reader key comes from. "input" (default): the distribution_api_key input, written to the app secret by Terraform. "provisioned": Runlayer writes the key to the provisioned tenant secret and registers it before the apply; tasks read it from that secret and distribution_api_key, distribution_api_key_previous and mcp_catalog_api_key must be unset. Validation: distribution_reader_key_source must be “input” or “provisioned”. | string | "input" | no |
secret_key | Application SECRET_KEY used only on the first apply, before the restricted app-keys secret has a current version. After that it is ignored and the stored value is kept. Changing the stored value is not a routine edit: existing encrypted data stops decrypting (see the module README). Must be set with master_salt. Omit both to generate a value. Validation: secret_key and master_salt must both be non-empty or both be omitted. (sensitive) | string | null | no |
master_salt | Application MASTER_SALT used only on the first apply, before the restricted app-keys secret has a current version. After that it is ignored and the stored value is kept. Changing the stored value is not a routine edit: existing encrypted data stops decrypting (see the module README). Must be set with secret_key. Omit both to generate a value. (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 |
ai_watch_snapshot_signing_key | This deployment’s AI Watch policy snapshot signing key: a base64url 32-byte Ed25519 seed. Backend service only; changing it rolls that service. Empty disables signed snapshots. Rejected in a stateless root. See Runlayer-provided inputs. Validation: empty or a base64url 32-byte seed (43 characters). (sensitive) | string | (sensitive — omitted) | no |
ai_watch_snapshot_delegations | Runlayer’s per-organization delegations of ai_watch_snapshot_signing_key: a JSON object of organization ID to {payload, signature, root_key_id}. Public. Each expires within 90 days; renew before then. Rejected in a stateless root. See Runlayer-provided inputs. Validation: empty or a JSON object. | string | "" | 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_aws_cloud_discovery | Wire AWS Cloud Discovery so admins can connect AWS accounts from AI Inventory: a private bucket in region holding the CloudFormation template their Quick Create links presign, a task-role grant to assume RunlayerDiscovery-* roles, a bucket policy letting the task role read that template, and the backend’s AWS_CLOUD_DISCOVERY_* env (additional_backend_env_vars can still override it). The grant is inert until a customer creates a role that trusts this deployment’s task role. false removes them all. See AWS Cloud Discovery. | bool | true | 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 |