thinkwork-cli 0.12.16 → 0.12.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +517 -10403
- package/dist/commands/enterprise/templates/deploy-repo/docs/runbook.md +3 -8
- package/dist/commands/enterprise/templates/deploy-repo/terraform/main.tf +1 -184
- package/dist/drizzle/0050_brain_v0_entity_subtype.sql +2 -2
- package/dist/drizzle/0051_brain_v0_tenant_entity_pages.sql +6 -6
- package/dist/drizzle/0052_brain_v0_external_refs.sql +2 -2
- package/dist/drizzle/0053_brain_v0_unresolved_mentions_subtype.sql +2 -2
- package/dist/drizzle/0145_knowledge_graph_thread_ingest.sql +14 -14
- package/dist/drizzle/0146_knowledge_graph_source_scope.sql +1 -1
- package/dist/drizzle/0157_knowledge_graph_observations_source.sql +2 -2
- package/dist/drizzle/0158_wiki_tenant_scope.sql +1 -1
- package/dist/drizzle/0165_plugin_premium_entitlements.sql +2 -2
- package/dist/drizzle/{0166_company_brain_substrate_contract.sql → 0166_brain_substrate_contract.sql} +9 -9
- package/dist/drizzle/{0167_company_brain_artifact_manifest_runtime.sql → 0167_brain_artifact_manifest_runtime.sql} +5 -5
- package/dist/drizzle/0168_eval_skill_gate.sql +1 -1
- package/dist/drizzle/0183_okf_artifact_manifests.sql +1 -1
- package/dist/drizzle/0200_eval_results_execution_tier.sql +40 -0
- package/dist/drizzle/0201_brain_dream_runs.sql +72 -0
- package/dist/drizzle/0202_backfill_thread_participants_from_senders.sql +110 -0
- package/dist/drizzle/0203_threads_mode_override.sql +61 -0
- package/dist/drizzle/0204_thread_turns_triggering_message_id.sql +48 -0
- package/dist/drizzle/0205_routines_git_python.sql +185 -0
- package/dist/drizzle/0206_agent_loop_versions_routine_actions.sql +40 -0
- package/dist/drizzle/0207_tenant_credentials_github_repo_kind.sql +52 -0
- package/dist/drizzle/0208_knowledge_graph_neutral_identifiers.sql +253 -0
- package/dist/drizzle/0209_living_artifacts_schema.sql +109 -0
- package/dist/drizzle/0210_think137_automations_additive_schema.sql +113 -0
- package/dist/drizzle/0211_backfill_agent_loop_versions_target_spec.sql +120 -0
- package/dist/drizzle/0212_fold_webhooks_into_automations.sql +312 -0
- package/dist/drizzle/0213_agent_loop_versions_judge_evidence_nullable.sql +63 -0
- package/dist/drizzle/0214_think137_drop_judge_evidence_roi.sql +99 -0
- package/dist/drizzle/0215_agent_loop_versions_goal_worker_policy_nullable.sql +70 -0
- package/dist/drizzle/0216_drop_agent_loop_versions_goal_worker_policy.sql +81 -0
- package/dist/drizzle/0217_agents_capability_folder_dispatch.sql +12 -0
- package/dist/drizzle/0218_document_plates.sql +30 -0
- package/dist/drizzle/0219_document_section_waivers.sql +29 -0
- package/dist/drizzle/0220_artifacts_created_by_user.sql +21 -0
- package/dist/drizzle/0221_artifact_shares.sql +29 -0
- package/dist/drizzle/0221_workflow_interpreter_thin_slice.sql +71 -0
- package/dist/drizzle/0222_compliance_drainer_select_audit_events.sql +21 -0
- package/dist/drizzle/0223_document_conformance_reports.sql +38 -0
- package/dist/drizzle/0224_artifact_refresh_state.sql +11 -0
- package/dist/drizzle/0225_think216_agent_loop_convergence.sql +21 -0
- package/dist/drizzle/0226_drop_n8n_agent_step_runs.sql +6 -0
- package/dist/drizzle/0227_analyst_reader_role.sql +1055 -0
- package/dist/drizzle/0228_tenant_credentials_rds_iam_kind.sql +62 -0
- package/dist/drizzle/0229_analyst_reader_rds_iam_grant.sql +79 -0
- package/dist/drizzle/0230_analyst_rls.sql +1613 -0
- package/dist/drizzle/0231_cost_events_cache_write_enforcement_exempt.sql +11 -0
- package/dist/plugins/catalog/package.json +0 -1
- package/dist/plugins/catalog/src/__tests__/build-catalog.test.ts +0 -1
- package/dist/plugins/catalog/src/__tests__/catalog.test.ts +16 -8
- package/dist/plugins/catalog/src/__tests__/contracts.test.ts +56 -0
- package/dist/plugins/catalog/src/__tests__/plugin-package.test.ts +0 -2
- package/dist/plugins/catalog/src/__tests__/plugin-registry.test.ts +0 -5
- package/dist/plugins/catalog/src/contracts.ts +112 -0
- package/dist/plugins/catalog/src/registry/generated-first-party.ts +0 -6
- package/dist/plugins/n8n/README.md +4 -36
- package/dist/plugins/n8n/src/deployment/managed-app.ts +0 -17
- package/dist/plugins/n8n/src/manifest.ts +0 -5
- package/dist/plugins/n8n/terraform/n8n/main.tf +0 -26
- package/dist/plugins/n8n/terraform/n8n/outputs.tf +0 -5
- package/dist/plugins/n8n/terraform/n8n/variables.tf +0 -6
- package/dist/plugins/n8n/test/manifest.test.ts +0 -1
- package/dist/plugins/twenty/package.json +5 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/load-records.test.ts +232 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/mappers.test.ts +489 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/members-ensure.test.ts +199 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/provision-members-db.test.ts +43 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/schema-ensure.test.ts +230 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/twenty-client.test.ts +207 -0
- package/dist/plugins/twenty/scripts/lib/lastmile-reader.ts +282 -0
- package/dist/plugins/twenty/scripts/lib/load-attachments.ts +220 -0
- package/dist/plugins/twenty/scripts/lib/load-records.ts +680 -0
- package/dist/plugins/twenty/scripts/lib/mappers.ts +559 -0
- package/dist/plugins/twenty/scripts/lib/members-ensure.ts +381 -0
- package/dist/plugins/twenty/scripts/lib/provision-members-db.ts +191 -0
- package/dist/plugins/twenty/scripts/lib/schema-ensure.ts +425 -0
- package/dist/plugins/twenty/scripts/lib/twenty-client.ts +246 -0
- package/dist/plugins/twenty/scripts/migrate-lastmile.ts +610 -0
- package/dist/plugins/twenty/scripts/provision-twenty-members.ts +214 -0
- package/dist/plugins/twenty/src/manifest.ts +99 -0
- package/dist/plugins/twenty/terraform/twenty/README.md +1 -1
- package/dist/plugins/twenty/test/manifest.test.ts +12 -2
- package/dist/terraform/examples/greenfield/main.tf +90 -380
- package/dist/terraform/examples/greenfield/terraform.tfvars.example +0 -1
- package/dist/terraform/modules/app/agentcore-pi/README.md +1 -3
- package/dist/terraform/modules/app/agentcore-pi/main.tf +29 -38
- package/dist/terraform/modules/app/agentcore-pi/variables.tf +23 -15
- package/dist/terraform/modules/app/agentcore-runtime/main.tf +3 -3
- package/dist/terraform/modules/app/customer-domain/main.tf +16 -2
- package/dist/terraform/modules/app/deployment-control-plane/main.tf +5 -0
- package/dist/terraform/modules/app/deployment-control-plane/runner.py +85 -207
- package/dist/terraform/modules/app/deployment-control-plane/test_runner_bundle.py +56 -2
- package/dist/terraform/modules/app/hindsight-memory/main.tf +52 -4
- package/dist/terraform/modules/app/lambda-api/eval-fanout.tf +7 -0
- package/dist/terraform/modules/app/lambda-api/handlers.tf +493 -89
- package/dist/terraform/modules/app/lambda-api/iam-grouped.tf +215 -96
- package/dist/terraform/modules/app/lambda-api/main.tf +24 -5
- package/dist/terraform/modules/app/lambda-api/outputs.tf +19 -11
- package/dist/terraform/modules/app/lambda-api/variables.tf +94 -67
- package/dist/terraform/modules/app/ses-email/main.tf +14 -2
- package/dist/terraform/modules/app/workflow-interpreter-stepfunctions/main.tf +493 -0
- package/dist/terraform/modules/app/workflow-interpreter-stepfunctions/outputs.tf +34 -0
- package/dist/terraform/modules/app/workflow-interpreter-stepfunctions/variables.tf +32 -0
- package/dist/terraform/modules/data/aurora-postgres/main.tf +55 -0
- package/dist/terraform/modules/data/aurora-postgres/outputs.tf +15 -0
- package/dist/terraform/modules/data/s3-buckets/main.tf +26 -0
- package/dist/terraform/modules/thinkwork/README.md +0 -1
- package/dist/terraform/modules/thinkwork/main.tf +167 -446
- package/dist/terraform/modules/thinkwork/outputs.tf +2 -142
- package/dist/terraform/modules/thinkwork/variables.tf +55 -309
- package/dist/terraform/schema.graphql +4 -0
- package/dist/workspace-defaults/files/AGENTS.md +45 -31
- package/dist/workspace-defaults/files/CONTEXT.md +48 -4
- package/dist/workspace-defaults/files/GUARDRAILS.md +18 -0
- package/dist/workspace-defaults/files/MEMORY_GUIDE.md +32 -4
- package/dist/workspace-defaults/files/SPACE.md +34 -19
- package/dist/workspace-defaults/files/TOOLS.md +30 -0
- package/dist/workspace-defaults/files/skills/document-composer/SKILL.md +154 -0
- package/dist/workspace-defaults/files/skills/document-composer/references/authoring-rules.md +101 -0
- package/package.json +1 -1
- package/dist/plugins/company-brain/README.md +0 -37
- package/dist/plugins/company-brain/package.json +0 -33
- package/dist/plugins/company-brain/runtime/cognee/Dockerfile +0 -11
- package/dist/plugins/company-brain/smoke/cognee-managed-app-smoke.mjs +0 -458
- package/dist/plugins/company-brain/smoke/cognee-memory-cutover-smoke.mjs +0 -539
- package/dist/plugins/company-brain/smoke/company-brain-context-engine-smoke.mjs +0 -312
- package/dist/plugins/company-brain/smoke/company-brain-operations-smoke.mjs +0 -449
- package/dist/plugins/company-brain/smoke/company-brain-plugin-smoke.mjs +0 -655
- package/dist/plugins/company-brain/smoke/hindsight-memory-isolation-smoke.mjs +0 -474
- package/dist/plugins/company-brain/src/api/cognee-client.ts +0 -896
- package/dist/plugins/company-brain/src/api/cognee-cluster-identity.ts +0 -49
- package/dist/plugins/company-brain/src/api/cognee-memory-scope.ts +0 -84
- package/dist/plugins/company-brain/src/api/context-engine-provider.ts +0 -888
- package/dist/plugins/company-brain/src/api/migration.ts +0 -665
- package/dist/plugins/company-brain/src/deployment/cognee-managed-app.ts +0 -396
- package/dist/plugins/company-brain/src/index.ts +0 -62
- package/dist/plugins/company-brain/src/manifest.ts +0 -112
- package/dist/plugins/company-brain/terraform/cognee/README.md +0 -263
- package/dist/plugins/company-brain/terraform/cognee/main.tf +0 -766
- package/dist/plugins/company-brain/terraform/cognee/outputs.tf +0 -144
- package/dist/plugins/company-brain/terraform/cognee/variables.tf +0 -402
- package/dist/plugins/company-brain/test/api/cognee-client.test.ts +0 -562
- package/dist/plugins/company-brain/test/api/cognee-memory-scope.test.ts +0 -74
- package/dist/plugins/company-brain/test/api/context-engine-provider.test.ts +0 -447
- package/dist/plugins/company-brain/test/api/migration.test.ts +0 -465
- package/dist/plugins/company-brain/test/manifest.test.ts +0 -95
- package/dist/plugins/company-brain/tsconfig.json +0 -8
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
terraform {
|
|
13
13
|
required_providers {
|
|
14
|
+
tls = {
|
|
15
|
+
source = "hashicorp/tls"
|
|
16
|
+
version = "~> 4.0"
|
|
17
|
+
}
|
|
14
18
|
aws = {
|
|
15
19
|
source = "hashicorp/aws"
|
|
16
20
|
version = "~> 5.0"
|
|
@@ -47,11 +51,9 @@ locals {
|
|
|
47
51
|
|
|
48
52
|
# Hindsight is the canonical user/Space memory provider for full ThinkWork
|
|
49
53
|
# installs. AgentCore managed memory remains available as an explicit
|
|
50
|
-
# low-cost/development opt-out
|
|
51
|
-
#
|
|
52
|
-
# working even when enable_hindsight was not set.
|
|
54
|
+
# low-cost/development opt-out. We still honor var.memory_engine == "hindsight"
|
|
55
|
+
# so existing tfvars keep working even when enable_hindsight was not set.
|
|
53
56
|
hindsight_enabled = var.enable_hindsight || var.memory_engine == "hindsight"
|
|
54
|
-
cognee_enabled = var.enable_cognee
|
|
55
57
|
twenty_provisioned = var.twenty_provisioned
|
|
56
58
|
twenty_runtime_enabled = var.twenty_provisioned && var.twenty_runtime_enabled
|
|
57
59
|
twenty_domain = var.twenty_domain != "" ? var.twenty_domain : (var.www_domain != "" ? "crm.${var.www_domain}" : "")
|
|
@@ -68,11 +70,6 @@ locals {
|
|
|
68
70
|
n8n_domain = var.n8n_domain != "" ? var.n8n_domain : (var.www_domain != "" ? "n8n.${var.www_domain}" : "")
|
|
69
71
|
n8n_public_url = var.n8n_public_url != "" ? var.n8n_public_url : (local.n8n_domain != "" ? "https://${local.n8n_domain}" : "")
|
|
70
72
|
n8n_certificate_arn = var.n8n_certificate_arn != "" ? var.n8n_certificate_arn : var.www_certificate_arn
|
|
71
|
-
cognee_worker_subnet_ids = (
|
|
72
|
-
length(module.vpc.private_subnet_ids) > 0
|
|
73
|
-
? module.vpc.private_subnet_ids
|
|
74
|
-
: module.vpc.public_subnet_ids
|
|
75
|
-
)
|
|
76
73
|
okf_wiki_subnet_ids = (
|
|
77
74
|
length(module.vpc.private_subnet_ids) > 0
|
|
78
75
|
? module.vpc.private_subnet_ids
|
|
@@ -89,7 +86,12 @@ locals {
|
|
|
89
86
|
"bedrock-agentcore",
|
|
90
87
|
"bedrock-agentcore-control",
|
|
91
88
|
"bedrock-agentcore.gateway",
|
|
92
|
-
"execute-api"
|
|
89
|
+
# NOTE: never add "execute-api" here. Its private DNS captures ALL
|
|
90
|
+
# *.execute-api.<region>.amazonaws.com traffic from the VPC, but the
|
|
91
|
+
# endpoint only serves PRIVATE REST APIs — this stack's HTTP APIs (v2)
|
|
92
|
+
# reject VPC-endpoint traffic with 403 {"message":"Forbidden"}. In-VPC
|
|
93
|
+
# callers (e.g. the Pi runtime's admin-ops MCP connect) must reach the
|
|
94
|
+
# regional API publicly via the NAT gateway instead (THINK-144).
|
|
93
95
|
"lambda",
|
|
94
96
|
"logs",
|
|
95
97
|
"rds-data",
|
|
@@ -97,32 +99,17 @@ locals {
|
|
|
97
99
|
"ssm",
|
|
98
100
|
"sts",
|
|
99
101
|
"xray",
|
|
102
|
+
"bedrock-runtime",
|
|
100
103
|
],
|
|
101
|
-
local.cognee_enabled ? [] : ["bedrock-runtime"],
|
|
102
104
|
))
|
|
103
|
-
brain_private_interface_endpoint_services = toset([
|
|
104
|
-
"bedrock",
|
|
105
|
-
"bedrock-agentcore",
|
|
106
|
-
"bedrock-agentcore-control",
|
|
107
|
-
"bedrock-agentcore.gateway",
|
|
108
|
-
"execute-api",
|
|
109
|
-
"lambda",
|
|
110
|
-
"logs",
|
|
111
|
-
"rds-data",
|
|
112
|
-
"secretsmanager",
|
|
113
|
-
"ssm",
|
|
114
|
-
"sts",
|
|
115
|
-
"xray",
|
|
116
|
-
])
|
|
117
105
|
|
|
118
106
|
# Canonical long-term memory engine for this deployment. Exactly one engine
|
|
119
107
|
# is active per deployment for recall/inspect/export. Empty selects
|
|
120
108
|
# Hindsight for full installs; callers can explicitly choose AgentCore for
|
|
121
109
|
# low-cost/development deployments. Legacy value "managed" maps to
|
|
122
|
-
# "agentcore"
|
|
123
|
-
# the supported user/Space memory path.
|
|
110
|
+
# "agentcore".
|
|
124
111
|
resolved_memory_engine = (
|
|
125
|
-
var.memory_engine == "hindsight" || var.memory_engine == "agentcore"
|
|
112
|
+
var.memory_engine == "hindsight" || var.memory_engine == "agentcore"
|
|
126
113
|
? var.memory_engine
|
|
127
114
|
: var.memory_engine == "managed"
|
|
128
115
|
? "agentcore"
|
|
@@ -218,13 +205,6 @@ locals {
|
|
|
218
205
|
) : ""
|
|
219
206
|
}
|
|
220
207
|
|
|
221
|
-
check "memory_engine_requires_enabled_backend" {
|
|
222
|
-
assert {
|
|
223
|
-
condition = var.memory_engine != "cognee" || var.enable_cognee
|
|
224
|
-
error_message = "memory_engine = 'cognee' requires enable_cognee = true."
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
208
|
################################################################################
|
|
229
209
|
# Workspace Guard
|
|
230
210
|
################################################################################
|
|
@@ -259,121 +239,6 @@ resource "terraform_data" "customer_domain_configuration_guardrails" {
|
|
|
259
239
|
}
|
|
260
240
|
}
|
|
261
241
|
}
|
|
262
|
-
|
|
263
|
-
resource "terraform_data" "cognee_configuration_guardrails" {
|
|
264
|
-
count = var.enable_cognee ? 1 : 0
|
|
265
|
-
|
|
266
|
-
input = {
|
|
267
|
-
cognee_backend_mode = var.cognee_backend_mode
|
|
268
|
-
cognee_brain_storage_tier = var.cognee_brain_storage_tier
|
|
269
|
-
cognee_desired_count = var.cognee_desired_count
|
|
270
|
-
cognee_image_uri = var.cognee_image_uri
|
|
271
|
-
cognee_db_name = var.cognee_db_name
|
|
272
|
-
cognee_db_password_secret_arn = var.cognee_db_password_secret_arn
|
|
273
|
-
cognee_llm_provider = var.cognee_llm_provider
|
|
274
|
-
cognee_embedding_provider = var.cognee_embedding_provider
|
|
275
|
-
cognee_bedrock_model_resources = var.cognee_bedrock_model_resource_arns
|
|
276
|
-
public_subnet_count = length(module.vpc.public_subnet_ids)
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
lifecycle {
|
|
280
|
-
precondition {
|
|
281
|
-
condition = var.cognee_image_uri != ""
|
|
282
|
-
error_message = "enable_cognee requires cognee_image_uri pinned to an immutable digest."
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
precondition {
|
|
286
|
-
condition = var.cognee_db_password_secret_arn != ""
|
|
287
|
-
error_message = "enable_cognee requires cognee_db_password_secret_arn for a dedicated Cognee database user."
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
precondition {
|
|
291
|
-
condition = var.cognee_db_password_secret_arn != module.database.graphql_db_secret_arn
|
|
292
|
-
error_message = "enable_cognee requires a dedicated Cognee database secret, not the shared Thinkwork admin database secret."
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
precondition {
|
|
296
|
-
condition = var.cognee_db_name != var.database_name
|
|
297
|
-
error_message = "cognee_db_name must be distinct from the shared Thinkwork database name."
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
precondition {
|
|
301
|
-
condition = length(module.vpc.public_subnet_ids) > 0
|
|
302
|
-
error_message = "enable_cognee requires at least one public subnet for the phase-1 public-subnet task egress pattern."
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
precondition {
|
|
306
|
-
condition = var.cognee_backend_mode != "dogfood" || var.cognee_desired_count == 1
|
|
307
|
-
error_message = "cognee_backend_mode = dogfood requires cognee_desired_count = 1."
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
precondition {
|
|
311
|
-
condition = (
|
|
312
|
-
var.cognee_brain_storage_tier != "default" ||
|
|
313
|
-
(
|
|
314
|
-
var.cognee_backend_mode == "dogfood" &&
|
|
315
|
-
var.cognee_vector_db_provider == "lancedb" &&
|
|
316
|
-
var.cognee_graph_database_provider == "kuzu" &&
|
|
317
|
-
var.cognee_desired_count == 1
|
|
318
|
-
)
|
|
319
|
-
)
|
|
320
|
-
error_message = "cognee_brain_storage_tier = default requires dogfood backend mode, lancedb vectors, kuzu graph storage, and desired_count = 1."
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
precondition {
|
|
324
|
-
condition = (
|
|
325
|
-
var.cognee_brain_storage_tier != "production" ||
|
|
326
|
-
(
|
|
327
|
-
var.cognee_backend_mode == "remote" &&
|
|
328
|
-
var.cognee_vector_db_provider == "neptune_analytics" &&
|
|
329
|
-
var.cognee_graph_database_provider == "neptune_analytics" &&
|
|
330
|
-
var.cognee_neptune_graph_id != "" &&
|
|
331
|
-
var.cognee_neptune_endpoint != ""
|
|
332
|
-
)
|
|
333
|
-
)
|
|
334
|
-
error_message = "cognee_brain_storage_tier = production requires remote mode with Neptune Analytics graph/vector providers, cognee_neptune_graph_id, and cognee_neptune_endpoint."
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
precondition {
|
|
338
|
-
condition = !contains(["opensearch", "opensearch_serverless", "aoss"], lower(var.cognee_vector_db_provider))
|
|
339
|
-
error_message = "Company Brain production must not use direct OpenSearch vector storage; use Neptune Analytics for production graph/vector."
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
precondition {
|
|
343
|
-
condition = (
|
|
344
|
-
var.cognee_backend_mode != "remote" ||
|
|
345
|
-
(
|
|
346
|
-
(
|
|
347
|
-
var.cognee_vector_db_url != "" ||
|
|
348
|
-
(var.cognee_vector_db_provider == "neptune_analytics" && var.cognee_neptune_endpoint != "")
|
|
349
|
-
) &&
|
|
350
|
-
(
|
|
351
|
-
var.cognee_graph_database_url != "" ||
|
|
352
|
-
(var.cognee_graph_database_provider == "neptune_analytics" && var.cognee_neptune_endpoint != "")
|
|
353
|
-
)
|
|
354
|
-
)
|
|
355
|
-
)
|
|
356
|
-
error_message = "cognee_backend_mode = remote requires vector/graph URLs, or Neptune Analytics providers with cognee_neptune_endpoint."
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
precondition {
|
|
360
|
-
condition = (
|
|
361
|
-
(var.cognee_llm_provider == "bedrock" || var.cognee_llm_api_key_secret_arn != "") &&
|
|
362
|
-
(var.cognee_embedding_provider == "bedrock" || var.cognee_embedding_api_key_secret_arn != "")
|
|
363
|
-
)
|
|
364
|
-
error_message = "Non-Bedrock Cognee LLM or embedding providers require matching secret ARN inputs."
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
precondition {
|
|
368
|
-
condition = (
|
|
369
|
-
(var.cognee_llm_provider != "bedrock" && var.cognee_embedding_provider != "bedrock") ||
|
|
370
|
-
length(var.cognee_bedrock_model_resource_arns) > 0
|
|
371
|
-
)
|
|
372
|
-
error_message = "Bedrock Cognee providers require explicit cognee_bedrock_model_resource_arns."
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
242
|
resource "terraform_data" "okf_wiki_efs_guardrails" {
|
|
378
243
|
count = var.okf_wiki_efs_enabled ? 1 : 0
|
|
379
244
|
|
|
@@ -485,40 +350,39 @@ resource "terraform_data" "n8n_configuration_guardrails" {
|
|
|
485
350
|
count = local.n8n_provisioned ? 1 : 0
|
|
486
351
|
|
|
487
352
|
input = {
|
|
488
|
-
n8n_runtime_enabled
|
|
489
|
-
n8n_image_uri
|
|
490
|
-
n8n_database_name
|
|
491
|
-
n8n_database_username
|
|
492
|
-
n8n_database_admin_secret_arn
|
|
493
|
-
n8n_database_url_secret_arn
|
|
494
|
-
n8n_encryption_key_secret_arn
|
|
495
|
-
n8n_operator_secret_arn
|
|
496
|
-
n8n_service_credential_secret_arn
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
private_subnet_count = length(module.vpc.private_subnet_ids)
|
|
353
|
+
n8n_runtime_enabled = local.n8n_runtime_enabled
|
|
354
|
+
n8n_image_uri = var.n8n_image_uri
|
|
355
|
+
n8n_database_name = var.n8n_database_name
|
|
356
|
+
n8n_database_username = var.n8n_database_username
|
|
357
|
+
n8n_database_admin_secret_arn = var.n8n_database_admin_secret_arn
|
|
358
|
+
n8n_database_url_secret_arn = var.n8n_database_url_secret_arn
|
|
359
|
+
n8n_encryption_key_secret_arn = var.n8n_encryption_key_secret_arn
|
|
360
|
+
n8n_operator_secret_arn = var.n8n_operator_secret_arn
|
|
361
|
+
n8n_service_credential_secret_arn = var.n8n_service_credential_secret_arn
|
|
362
|
+
n8n_storage_bucket_name = var.n8n_storage_bucket_name
|
|
363
|
+
n8n_create_storage_bucket = var.n8n_create_storage_bucket
|
|
364
|
+
n8n_storage_prefix = var.n8n_storage_prefix
|
|
365
|
+
n8n_public_url = local.n8n_public_url
|
|
366
|
+
n8n_certificate_arn = local.n8n_certificate_arn
|
|
367
|
+
n8n_main_desired_count = var.n8n_main_desired_count
|
|
368
|
+
n8n_worker_desired_count = var.n8n_worker_desired_count
|
|
369
|
+
n8n_worker_concurrency = var.n8n_worker_concurrency
|
|
370
|
+
n8n_container_port = var.n8n_container_port
|
|
371
|
+
n8n_queue_mode = var.n8n_queue_mode
|
|
372
|
+
n8n_task_runners_enabled = var.n8n_task_runners_enabled
|
|
373
|
+
n8n_package_config_digest = var.n8n_package_config_digest
|
|
374
|
+
n8n_custom_package_specs = var.n8n_custom_package_specs
|
|
375
|
+
n8n_execution_data_storage_mode = var.n8n_execution_data_storage_mode
|
|
376
|
+
n8n_binary_data_mode = var.n8n_binary_data_mode
|
|
377
|
+
n8n_cache_engine = var.n8n_cache_engine
|
|
378
|
+
n8n_cache_engine_version = var.n8n_cache_engine_version
|
|
379
|
+
n8n_cache_parameter_group_family = var.n8n_cache_parameter_group_family
|
|
380
|
+
n8n_cache_node_type = var.n8n_cache_node_type
|
|
381
|
+
n8n_cache_num_cache_clusters = var.n8n_cache_num_cache_clusters
|
|
382
|
+
n8n_allowed_public_cidr_blocks = var.n8n_allowed_public_cidr_blocks
|
|
383
|
+
n8n_kms_key_arns = var.n8n_kms_key_arns
|
|
384
|
+
public_subnet_count = length(module.vpc.public_subnet_ids)
|
|
385
|
+
private_subnet_count = length(module.vpc.private_subnet_ids)
|
|
522
386
|
}
|
|
523
387
|
|
|
524
388
|
lifecycle {
|
|
@@ -557,11 +421,6 @@ resource "terraform_data" "n8n_configuration_guardrails" {
|
|
|
557
421
|
error_message = "n8n_provisioned requires n8n_service_credential_secret_arn or deployment_control_plane_create_secret_placeholders = true."
|
|
558
422
|
}
|
|
559
423
|
|
|
560
|
-
precondition {
|
|
561
|
-
condition = var.n8n_agent_step_bridge_credential_secret_arn != "" || var.deployment_control_plane_create_secret_placeholders
|
|
562
|
-
error_message = "n8n_provisioned requires n8n_agent_step_bridge_credential_secret_arn or deployment_control_plane_create_secret_placeholders = true."
|
|
563
|
-
}
|
|
564
|
-
|
|
565
424
|
precondition {
|
|
566
425
|
condition = var.n8n_database_url_secret_arn == "" || var.n8n_database_url_secret_arn != module.database.graphql_db_secret_arn
|
|
567
426
|
error_message = "n8n_provisioned requires a dedicated n8n database URL secret, not the shared Thinkwork admin database secret."
|
|
@@ -624,79 +483,6 @@ resource "terraform_data" "n8n_runtime_state_guardrails" {
|
|
|
624
483
|
}
|
|
625
484
|
}
|
|
626
485
|
}
|
|
627
|
-
|
|
628
|
-
resource "aws_security_group" "cognee_worker" {
|
|
629
|
-
count = local.cognee_enabled ? 1 : 0
|
|
630
|
-
|
|
631
|
-
name_prefix = "thinkwork-${var.stage}-cognee-worker-"
|
|
632
|
-
description = "Knowledge Graph ingest Lambda access to Cognee and Aurora"
|
|
633
|
-
vpc_id = module.vpc.vpc_id
|
|
634
|
-
|
|
635
|
-
egress {
|
|
636
|
-
from_port = 0
|
|
637
|
-
to_port = 0
|
|
638
|
-
protocol = "-1"
|
|
639
|
-
cidr_blocks = ["0.0.0.0/0"]
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
tags = { Name = "thinkwork-${var.stage}-cognee-worker-sg" }
|
|
643
|
-
lifecycle { create_before_destroy = true }
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
resource "aws_security_group_rule" "aurora_from_cognee_worker" {
|
|
647
|
-
count = local.cognee_enabled ? 1 : 0
|
|
648
|
-
|
|
649
|
-
type = "ingress"
|
|
650
|
-
from_port = 5432
|
|
651
|
-
to_port = 5432
|
|
652
|
-
protocol = "tcp"
|
|
653
|
-
source_security_group_id = aws_security_group.cognee_worker[0].id
|
|
654
|
-
security_group_id = module.database.db_security_group_id
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
# VPC-attached Knowledge Graph workers (attached for Cognee's internal ALB)
|
|
658
|
-
# have no public egress — the VPC has no NAT — so the observation promotion
|
|
659
|
-
# classifier's direct Bedrock calls need an interface endpoint inside the VPC.
|
|
660
|
-
# Private DNS keeps the SDK's default bedrock-runtime hostname resolving to
|
|
661
|
-
# the endpoint ENIs — for EVERY resource in the VPC, so the ingress must
|
|
662
|
-
# admit the whole VPC CIDR: the Cognee ECS task (its own SG) and any future
|
|
663
|
-
# in-VPC Bedrock caller resolve to this endpoint the moment it exists.
|
|
664
|
-
data "aws_vpc" "bedrock_endpoint_scope" {
|
|
665
|
-
count = local.cognee_enabled ? 1 : 0
|
|
666
|
-
id = module.vpc.vpc_id
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
resource "aws_security_group" "bedrock_runtime_endpoint" {
|
|
670
|
-
count = local.cognee_enabled ? 1 : 0
|
|
671
|
-
|
|
672
|
-
name_prefix = "thinkwork-${var.stage}-bedrock-vpce-"
|
|
673
|
-
description = "HTTPS to the Bedrock runtime interface endpoint"
|
|
674
|
-
vpc_id = module.vpc.vpc_id
|
|
675
|
-
|
|
676
|
-
ingress {
|
|
677
|
-
from_port = 443
|
|
678
|
-
to_port = 443
|
|
679
|
-
protocol = "tcp"
|
|
680
|
-
cidr_blocks = [data.aws_vpc.bedrock_endpoint_scope[0].cidr_block]
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
tags = { Name = "thinkwork-${var.stage}-bedrock-vpce-sg" }
|
|
684
|
-
lifecycle { create_before_destroy = true }
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
resource "aws_vpc_endpoint" "bedrock_runtime" {
|
|
688
|
-
count = local.cognee_enabled ? 1 : 0
|
|
689
|
-
|
|
690
|
-
vpc_id = module.vpc.vpc_id
|
|
691
|
-
service_name = "com.amazonaws.${var.region}.bedrock-runtime"
|
|
692
|
-
vpc_endpoint_type = "Interface"
|
|
693
|
-
subnet_ids = local.cognee_worker_subnet_ids
|
|
694
|
-
security_group_ids = [aws_security_group.bedrock_runtime_endpoint[0].id]
|
|
695
|
-
private_dns_enabled = true
|
|
696
|
-
|
|
697
|
-
tags = { Name = "thinkwork-${var.stage}-bedrock-runtime-vpce" }
|
|
698
|
-
}
|
|
699
|
-
|
|
700
486
|
resource "aws_security_group" "okf_wiki_lambda" {
|
|
701
487
|
count = var.okf_wiki_efs_enabled ? 1 : 0
|
|
702
488
|
|
|
@@ -747,18 +533,6 @@ resource "aws_security_group_rule" "okf_wiki_vpce_from_lambda" {
|
|
|
747
533
|
source_security_group_id = aws_security_group.okf_wiki_lambda[0].id
|
|
748
534
|
security_group_id = aws_security_group.okf_wiki_vpc_endpoint[0].id
|
|
749
535
|
}
|
|
750
|
-
|
|
751
|
-
resource "aws_security_group_rule" "okf_wiki_vpce_from_cognee_worker" {
|
|
752
|
-
count = local.okf_wiki_private_endpoints_enabled && local.cognee_enabled ? 1 : 0
|
|
753
|
-
|
|
754
|
-
type = "ingress"
|
|
755
|
-
from_port = 443
|
|
756
|
-
to_port = 443
|
|
757
|
-
protocol = "tcp"
|
|
758
|
-
source_security_group_id = aws_security_group.cognee_worker[0].id
|
|
759
|
-
security_group_id = aws_security_group.okf_wiki_vpc_endpoint[0].id
|
|
760
|
-
}
|
|
761
|
-
|
|
762
536
|
# Interface endpoints with private DNS capture the WHOLE VPC's traffic to the
|
|
763
537
|
# covered AWS APIs (logs, ssm, sts, bedrock, ...): every workload in the VPC
|
|
764
538
|
# resolves those hostnames to the endpoint's private IP, so per-source-SG
|
|
@@ -817,59 +591,6 @@ resource "aws_vpc_endpoint" "okf_wiki_s3" {
|
|
|
817
591
|
Purpose = "okf-wiki-private-egress"
|
|
818
592
|
}
|
|
819
593
|
}
|
|
820
|
-
|
|
821
|
-
resource "aws_security_group" "brain_private_vpc_endpoint" {
|
|
822
|
-
count = local.cognee_enabled && !local.okf_wiki_private_endpoints_enabled ? 1 : 0
|
|
823
|
-
|
|
824
|
-
name_prefix = "thinkwork-${var.stage}-brain-vpce-"
|
|
825
|
-
description = "HTTPS endpoints for private Company Brain/Pi runtime egress"
|
|
826
|
-
vpc_id = module.vpc.vpc_id
|
|
827
|
-
|
|
828
|
-
tags = { Name = "thinkwork-${var.stage}-brain-vpce-sg" }
|
|
829
|
-
lifecycle { create_before_destroy = true }
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
resource "aws_security_group_rule" "brain_vpce_from_cognee_worker" {
|
|
833
|
-
count = local.cognee_enabled && !local.okf_wiki_private_endpoints_enabled ? 1 : 0
|
|
834
|
-
|
|
835
|
-
type = "ingress"
|
|
836
|
-
from_port = 443
|
|
837
|
-
to_port = 443
|
|
838
|
-
protocol = "tcp"
|
|
839
|
-
source_security_group_id = aws_security_group.cognee_worker[0].id
|
|
840
|
-
security_group_id = aws_security_group.brain_private_vpc_endpoint[0].id
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
resource "aws_vpc_endpoint" "brain_private_interface" {
|
|
844
|
-
for_each = local.cognee_enabled && !local.okf_wiki_private_endpoints_enabled ? local.brain_private_interface_endpoint_services : toset([])
|
|
845
|
-
|
|
846
|
-
vpc_id = module.vpc.vpc_id
|
|
847
|
-
service_name = "com.amazonaws.${var.region}.${each.key}"
|
|
848
|
-
vpc_endpoint_type = "Interface"
|
|
849
|
-
subnet_ids = local.cognee_worker_subnet_ids
|
|
850
|
-
security_group_ids = [aws_security_group.brain_private_vpc_endpoint[0].id]
|
|
851
|
-
private_dns_enabled = true
|
|
852
|
-
|
|
853
|
-
tags = {
|
|
854
|
-
Name = "thinkwork-${var.stage}-brain-${each.key}-vpce"
|
|
855
|
-
Purpose = "company-brain-private-runtime-egress"
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
resource "aws_vpc_endpoint" "brain_private_s3" {
|
|
860
|
-
count = local.cognee_enabled && !local.okf_wiki_private_endpoints_enabled && length(local.okf_wiki_route_table_ids) > 0 ? 1 : 0
|
|
861
|
-
|
|
862
|
-
vpc_id = module.vpc.vpc_id
|
|
863
|
-
service_name = "com.amazonaws.${var.region}.s3"
|
|
864
|
-
vpc_endpoint_type = "Gateway"
|
|
865
|
-
route_table_ids = local.okf_wiki_route_table_ids
|
|
866
|
-
|
|
867
|
-
tags = {
|
|
868
|
-
Name = "thinkwork-${var.stage}-brain-s3-vpce"
|
|
869
|
-
Purpose = "company-brain-private-runtime-egress"
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
|
|
873
594
|
resource "aws_security_group_rule" "okf_wiki_efs_from_lambda" {
|
|
874
595
|
count = var.okf_wiki_efs_enabled ? 1 : 0
|
|
875
596
|
|
|
@@ -1207,9 +928,34 @@ module "deployment_control_plane" {
|
|
|
1207
928
|
create_secret_placeholders = var.deployment_control_plane_create_secret_placeholders
|
|
1208
929
|
}
|
|
1209
930
|
|
|
931
|
+
# ── Capability signing keypair (THINK-173 KTD-3) ──────────────────────────
|
|
932
|
+
# Asymmetric by requirement: the multi-tenant Pi container VERIFIES
|
|
933
|
+
# capability sidecars/manifests, so it may only ever hold the public key —
|
|
934
|
+
# a symmetric verify key would be a forge key. The private key lives in
|
|
935
|
+
# Secrets Manager (the api resolves it by name through runtime-config's
|
|
936
|
+
# secret loader; it must never enter the graphql-http env, which sits at
|
|
937
|
+
# the 4KB ceiling). Key material in terraform state is accepted under the
|
|
938
|
+
# same posture as the existing plaintext tfvars (SSM migration pending).
|
|
939
|
+
resource "tls_private_key" "capability_signing" {
|
|
940
|
+
algorithm = "ED25519"
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
resource "aws_secretsmanager_secret" "capability_signing_key" {
|
|
944
|
+
name = "thinkwork/${var.stage}/capability-signing-key"
|
|
945
|
+
description = "Ed25519 private key (PKCS8 PEM) signing capability sidecars and manifests (THINK-173)."
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
resource "aws_secretsmanager_secret_version" "capability_signing_key" {
|
|
949
|
+
secret_id = aws_secretsmanager_secret.capability_signing_key.id
|
|
950
|
+
secret_string = tls_private_key.capability_signing.private_key_pem
|
|
951
|
+
}
|
|
952
|
+
|
|
1210
953
|
module "api" {
|
|
1211
954
|
source = "../app/lambda-api"
|
|
1212
955
|
|
|
956
|
+
capability_signing_public_key = tls_private_key.capability_signing.public_key_pem
|
|
957
|
+
capability_signing_private_key_secret = aws_secretsmanager_secret.capability_signing_key.name
|
|
958
|
+
|
|
1213
959
|
stage = var.stage
|
|
1214
960
|
account_id = var.account_id
|
|
1215
961
|
region = var.region
|
|
@@ -1226,6 +972,7 @@ module "api" {
|
|
|
1226
972
|
billing_export_bucket_name = var.billing_export_bucket_name
|
|
1227
973
|
billing_export_manifest_key = var.billing_export_manifest_key
|
|
1228
974
|
billing_reconciliation_tolerance_usd = var.billing_reconciliation_tolerance_usd
|
|
975
|
+
cost_alert_emails = var.cost_alert_emails
|
|
1229
976
|
|
|
1230
977
|
# Phase 3 U4 — compliance-outbox-drainer connects as `compliance_drainer`
|
|
1231
978
|
# via this dedicated secret (provisioned in U2 / PR #887, populated by
|
|
@@ -1253,6 +1000,20 @@ module "api" {
|
|
|
1253
1000
|
compliance_reader_secret_arn = module.database.compliance_reader_secret_arn
|
|
1254
1001
|
compliance_anchor_object_lock_retention_days = var.compliance_anchor_retention_days
|
|
1255
1002
|
|
|
1003
|
+
# THINK-228 — analyst query broker: hardened reader role credentials +
|
|
1004
|
+
# the broker caller credential the seeded connector row references.
|
|
1005
|
+
# THINK-246 — artifact email delivery sender: customer stages send from
|
|
1006
|
+
# their own verified domain (noreply@<customer_domain>); dev keeps the
|
|
1007
|
+
# code fallback via the empty default.
|
|
1008
|
+
artifact_delivery_from_email = var.customer_domain != "" ? "noreply@${var.customer_domain}" : ""
|
|
1009
|
+
|
|
1010
|
+
analyst_reader_secret_arn = module.database.analyst_reader_secret_arn
|
|
1011
|
+
analyst_broker_secret_arn = module.database.analyst_broker_secret_arn
|
|
1012
|
+
# THINK-229 U1 — keys the broker's rds-db:connect grant and switches the
|
|
1013
|
+
# reader connection to per-connect RDS IAM auth tokens.
|
|
1014
|
+
analyst_db_cluster_resource_id = module.database.cluster_resource_id
|
|
1015
|
+
analyst_policy_source = var.analyst_policy_source
|
|
1016
|
+
|
|
1256
1017
|
# Phase 3 U8b — KMS key + Object Lock mode forwarded as
|
|
1257
1018
|
# COMPLIANCE_ANCHOR_KMS_KEY_ARN and COMPLIANCE_ANCHOR_OBJECT_LOCK_MODE
|
|
1258
1019
|
# env vars on the anchor Lambda. The live `_anchor_fn_live` requires
|
|
@@ -1287,45 +1048,38 @@ module "api" {
|
|
|
1287
1048
|
|
|
1288
1049
|
kb_service_role_arn = module.bedrock_kb.kb_service_role_arn
|
|
1289
1050
|
|
|
1290
|
-
lambda_zips_dir
|
|
1291
|
-
api_auth_secret
|
|
1292
|
-
db_password
|
|
1293
|
-
bootstrap_credential_lease_kms_key_id
|
|
1294
|
-
agentcore_pi_function_name
|
|
1295
|
-
agentcore_pi_function_arn
|
|
1296
|
-
enable_agentcore_pi_invoke_policy
|
|
1297
|
-
hindsight_endpoint
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
twenty_worker_log_group_name = local.twenty_provisioned ? module.twenty[0].twenty_worker_log_group_name : ""
|
|
1323
|
-
admin_url = local.end_user_app_url
|
|
1324
|
-
docs_url = "https://${module.docs_site.distribution_domain}"
|
|
1325
|
-
www_url = var.www_domain != "" ? "https://${var.www_domain}" : "https://${module.www_site.distribution_domain}"
|
|
1326
|
-
stripe_price_ids_json = var.stripe_price_ids_json
|
|
1327
|
-
appsync_realtime_url = module.appsync.graphql_realtime_url
|
|
1328
|
-
ecr_repository_url = module.agentcore_platform.ecr_repository_url
|
|
1051
|
+
lambda_zips_dir = var.lambda_zips_dir
|
|
1052
|
+
api_auth_secret = var.api_auth_secret
|
|
1053
|
+
db_password = var.db_password
|
|
1054
|
+
bootstrap_credential_lease_kms_key_id = var.bootstrap_credential_lease_kms_key_id
|
|
1055
|
+
agentcore_pi_function_name = module.agentcore_pi.agentcore_pi_function_name
|
|
1056
|
+
agentcore_pi_function_arn = module.agentcore_pi.agentcore_pi_function_arn
|
|
1057
|
+
enable_agentcore_pi_invoke_policy = true
|
|
1058
|
+
hindsight_endpoint = local.hindsight_enabled ? module.hindsight[0].hindsight_endpoint : ""
|
|
1059
|
+
hindsight_database_name = var.hindsight_database_name
|
|
1060
|
+
agentcore_memory_id = module.agentcore_memory.memory_id
|
|
1061
|
+
memory_engine = local.resolved_memory_engine
|
|
1062
|
+
okf_efs_subnet_ids = var.okf_wiki_efs_enabled ? local.okf_wiki_subnet_ids : []
|
|
1063
|
+
okf_efs_security_group_ids = var.okf_wiki_efs_enabled ? [aws_security_group.okf_wiki_lambda[0].id] : []
|
|
1064
|
+
okf_efs_mount_target_ids = var.okf_wiki_efs_enabled ? aws_efs_mount_target.okf_wiki[*].id : []
|
|
1065
|
+
okf_efs_file_system_arn = var.okf_wiki_efs_enabled ? aws_efs_file_system.okf_wiki[0].arn : ""
|
|
1066
|
+
okf_efs_refresh_access_point_arn = var.okf_wiki_efs_enabled ? aws_efs_access_point.okf_wiki_refresh[0].arn : ""
|
|
1067
|
+
twenty_provisioned = local.twenty_provisioned
|
|
1068
|
+
twenty_runtime_enabled = local.twenty_runtime_enabled
|
|
1069
|
+
twenty_url = local.twenty_provisioned ? module.twenty[0].twenty_url : ""
|
|
1070
|
+
twenty_alb_arn = local.twenty_provisioned ? module.twenty[0].twenty_alb_arn : ""
|
|
1071
|
+
twenty_target_group_arn = local.twenty_provisioned ? module.twenty[0].twenty_target_group_arn : ""
|
|
1072
|
+
twenty_cluster_arn = local.twenty_provisioned ? module.twenty[0].twenty_cluster_arn : ""
|
|
1073
|
+
twenty_server_service_name = local.twenty_provisioned ? module.twenty[0].twenty_server_service_name : ""
|
|
1074
|
+
twenty_worker_service_name = local.twenty_provisioned ? module.twenty[0].twenty_worker_service_name : ""
|
|
1075
|
+
twenty_server_log_group_name = local.twenty_provisioned ? module.twenty[0].twenty_server_log_group_name : ""
|
|
1076
|
+
twenty_worker_log_group_name = local.twenty_provisioned ? module.twenty[0].twenty_worker_log_group_name : ""
|
|
1077
|
+
admin_url = local.end_user_app_url
|
|
1078
|
+
docs_url = "https://${module.docs_site.distribution_domain}"
|
|
1079
|
+
www_url = var.www_domain != "" ? "https://${var.www_domain}" : "https://${module.www_site.distribution_domain}"
|
|
1080
|
+
stripe_price_ids_json = var.stripe_price_ids_json
|
|
1081
|
+
appsync_realtime_url = module.appsync.graphql_realtime_url
|
|
1082
|
+
ecr_repository_url = module.agentcore_platform.ecr_repository_url
|
|
1329
1083
|
# Static truth for count gating: agentcore_platform's ECR repo is
|
|
1330
1084
|
# unconditional, but its URL attribute is unknown until apply. The runner
|
|
1331
1085
|
# additionally needs its image tag seeded (CI does this for repo-managed
|
|
@@ -1345,10 +1099,10 @@ module "api" {
|
|
|
1345
1099
|
enable_slack_workspace_app = var.enable_slack_workspace_app
|
|
1346
1100
|
agentcore_code_interpreter_id = var.agentcore_code_interpreter_id
|
|
1347
1101
|
wiki_compile_model_id = var.wiki_compile_model_id
|
|
1348
|
-
|
|
1349
|
-
company_brain_backdoor_install_key_secret_arn = var.company_brain_backdoor_install_key_secret_arn
|
|
1350
|
-
company_brain_backdoor_install_key_stages = var.company_brain_backdoor_install_key_stages
|
|
1102
|
+
brain_source_agent_model_id = var.brain_source_agent_model_id
|
|
1351
1103
|
wiki_aggregation_pass_enabled = var.wiki_aggregation_pass_enabled
|
|
1104
|
+
wiki_source = var.wiki_source
|
|
1105
|
+
knowledge_graph_observations_ingest_enabled = var.knowledge_graph_observations_ingest_enabled
|
|
1352
1106
|
wiki_deterministic_linking_enabled = var.wiki_deterministic_linking_enabled
|
|
1353
1107
|
google_places_api_key = var.google_places_api_key
|
|
1354
1108
|
enable_workspace_orchestration = var.enable_workspace_orchestration
|
|
@@ -1356,6 +1110,8 @@ module "api" {
|
|
|
1356
1110
|
requester_memory_dreaming_enabled = var.requester_memory_dreaming_enabled
|
|
1357
1111
|
requester_memory_dreaming_schedule_expression = var.requester_memory_dreaming_schedule_expression
|
|
1358
1112
|
requester_memory_dreaming_model_id = var.requester_memory_dreaming_model_id
|
|
1113
|
+
brain_dream_state_enabled = var.brain_dream_state_enabled
|
|
1114
|
+
brain_dream_state_schedule_expression = var.brain_dream_state_schedule_expression
|
|
1359
1115
|
# Per-user OAuth client credentials — fed to Secrets Manager in
|
|
1360
1116
|
# app/lambda-api/oauth-secrets.tf. Reuses the same google_oauth_client_*
|
|
1361
1117
|
# tfvars that already flow to the Cognito federated-signin module.
|
|
@@ -1400,6 +1156,8 @@ module "agentcore_platform" {
|
|
|
1400
1156
|
module "agentcore_pi" {
|
|
1401
1157
|
source = "../app/agentcore-pi"
|
|
1402
1158
|
|
|
1159
|
+
capability_signing_public_key = tls_private_key.capability_signing.public_key_pem
|
|
1160
|
+
|
|
1403
1161
|
stage = var.stage
|
|
1404
1162
|
account_id = var.account_id
|
|
1405
1163
|
region = var.region
|
|
@@ -1410,6 +1168,7 @@ module "agentcore_pi" {
|
|
|
1410
1168
|
async_dlq_arn = module.agentcore_platform.agentcore_async_dlq_arn
|
|
1411
1169
|
|
|
1412
1170
|
hindsight_endpoint = local.hindsight_enabled ? module.hindsight[0].hindsight_endpoint : ""
|
|
1171
|
+
hindsight_database_name = var.hindsight_database_name
|
|
1413
1172
|
agentcore_memory_id = module.agentcore_memory.memory_id
|
|
1414
1173
|
memory_engine = local.resolved_memory_engine
|
|
1415
1174
|
requester_idle_memory_learning_enabled = var.requester_idle_memory_learning_enabled
|
|
@@ -1423,9 +1182,6 @@ module "agentcore_pi" {
|
|
|
1423
1182
|
db_cluster_arn = module.database.db_cluster_arn
|
|
1424
1183
|
db_secret_arn = module.database.graphql_db_secret_arn
|
|
1425
1184
|
|
|
1426
|
-
cognee_subnet_ids = local.cognee_enabled ? local.cognee_worker_subnet_ids : []
|
|
1427
|
-
cognee_security_group_ids = local.cognee_enabled ? [aws_security_group.cognee_worker[0].id] : []
|
|
1428
|
-
|
|
1429
1185
|
okf_efs_enabled = var.okf_wiki_efs_enabled
|
|
1430
1186
|
okf_efs_subnet_ids = var.okf_wiki_efs_enabled ? local.okf_wiki_subnet_ids : []
|
|
1431
1187
|
okf_efs_security_group_ids = var.okf_wiki_efs_enabled ? [aws_security_group.okf_wiki_lambda[0].id] : []
|
|
@@ -1530,6 +1286,32 @@ module "routines_stepfunctions" {
|
|
|
1530
1286
|
execution_callback_lambda_arn = ""
|
|
1531
1287
|
}
|
|
1532
1288
|
|
|
1289
|
+
# Workflow Interpreter substrate (THINK-219): the ONE static Step Functions
|
|
1290
|
+
# state machine per stage that interprets every workflow definition, plus its
|
|
1291
|
+
# shared execution role, vended log group, machine-ARN SSM parameter, and the
|
|
1292
|
+
# EventBridge SFN-state-change rule -> workflow-execution-callback.
|
|
1293
|
+
#
|
|
1294
|
+
# Unlike routines (rule moved into module.api to break a cycle), there is NO
|
|
1295
|
+
# cycle here: module.api does not consume any interpreter output (the machine
|
|
1296
|
+
# ARN reaches graphql-http/job-trigger via SSM at runtime, not terraform), so
|
|
1297
|
+
# this module can safely depend on module.api for the callback function ARN.
|
|
1298
|
+
#
|
|
1299
|
+
# enable_execution_callback is a STATIC true (not derived from the ARN): the
|
|
1300
|
+
# module gates its EventBridge resources' count on it, and a count that depends
|
|
1301
|
+
# on a computed attribute (the Lambda ARN, unknown until the function exists)
|
|
1302
|
+
# fails plan with "Invalid count argument". The ARN itself is consumed only
|
|
1303
|
+
# inside resource bodies, where computed values are fine.
|
|
1304
|
+
module "workflow_interpreter_stepfunctions" {
|
|
1305
|
+
source = "../app/workflow-interpreter-stepfunctions"
|
|
1306
|
+
|
|
1307
|
+
stage = var.stage
|
|
1308
|
+
account_id = var.account_id
|
|
1309
|
+
region = var.region
|
|
1310
|
+
|
|
1311
|
+
enable_execution_callback = true
|
|
1312
|
+
execution_callback_lambda_arn = module.api.workflow_execution_callback_fn_arn
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1533
1315
|
module "hindsight" {
|
|
1534
1316
|
count = local.hindsight_enabled ? 1 : 0
|
|
1535
1317
|
source = "../app/hindsight-memory"
|
|
@@ -1539,77 +1321,13 @@ module "hindsight" {
|
|
|
1539
1321
|
subnet_ids = module.vpc.public_subnet_ids
|
|
1540
1322
|
db_security_group_id = module.database.db_security_group_id
|
|
1541
1323
|
database_url = module.database.database_url
|
|
1324
|
+
database_name = var.hindsight_database_name
|
|
1542
1325
|
image_tag = var.hindsight_image_tag
|
|
1543
1326
|
|
|
1544
1327
|
enable_auto_consolidation = var.hindsight_enable_auto_consolidation
|
|
1545
1328
|
consolidation_dedup_threshold = var.hindsight_consolidation_dedup_threshold
|
|
1546
1329
|
observations_mission = var.hindsight_observations_mission
|
|
1547
1330
|
}
|
|
1548
|
-
|
|
1549
|
-
module "cognee" {
|
|
1550
|
-
count = local.cognee_enabled ? 1 : 0
|
|
1551
|
-
source = "../../../plugins/company-brain/terraform/cognee"
|
|
1552
|
-
|
|
1553
|
-
stage = var.stage
|
|
1554
|
-
vpc_id = module.vpc.vpc_id
|
|
1555
|
-
subnet_ids = module.vpc.public_subnet_ids
|
|
1556
|
-
db_security_group_id = module.database.db_security_group_id
|
|
1557
|
-
db_host = module.database.cluster_endpoint
|
|
1558
|
-
db_name = var.cognee_db_name
|
|
1559
|
-
db_username = var.cognee_db_username
|
|
1560
|
-
db_password_secret_arn = var.cognee_db_password_secret_arn
|
|
1561
|
-
|
|
1562
|
-
allowed_internal_cidr_blocks = var.cognee_allowed_internal_cidr_blocks
|
|
1563
|
-
allowed_internal_security_group_ids = concat(
|
|
1564
|
-
var.cognee_allowed_internal_security_group_ids,
|
|
1565
|
-
[aws_security_group.cognee_worker[0].id],
|
|
1566
|
-
)
|
|
1567
|
-
image_uri = var.cognee_image_uri
|
|
1568
|
-
desired_count = var.cognee_desired_count
|
|
1569
|
-
backend_mode = var.cognee_backend_mode
|
|
1570
|
-
|
|
1571
|
-
brain_tenant_id = var.cognee_brain_tenant_id
|
|
1572
|
-
brain_instance_key = var.cognee_brain_instance_key
|
|
1573
|
-
brain_storage_tier = var.cognee_brain_storage_tier
|
|
1574
|
-
brain_s3_artifact_root = var.cognee_brain_s3_artifact_root
|
|
1575
|
-
brain_s3_manifest_root = var.cognee_brain_s3_manifest_root
|
|
1576
|
-
brain_s3_vault_projection_root = var.cognee_brain_s3_vault_projection_root
|
|
1577
|
-
brain_artifacts_bucket_arn = var.cognee_brain_artifacts_bucket_arn
|
|
1578
|
-
brain_artifacts_prefixes = var.cognee_brain_artifacts_prefixes
|
|
1579
|
-
private_substrate_mode = var.cognee_private_substrate_mode
|
|
1580
|
-
require_authentication = var.cognee_require_authentication
|
|
1581
|
-
enable_backend_access_control = var.cognee_enable_backend_access_control
|
|
1582
|
-
cors_allowed_origins = var.cognee_cors_allowed_origins
|
|
1583
|
-
|
|
1584
|
-
llm_provider = var.cognee_llm_provider
|
|
1585
|
-
llm_model = var.cognee_llm_model
|
|
1586
|
-
llm_api_key_secret_arn = var.cognee_llm_api_key_secret_arn
|
|
1587
|
-
|
|
1588
|
-
embedding_provider = var.cognee_embedding_provider
|
|
1589
|
-
embedding_model = var.cognee_embedding_model
|
|
1590
|
-
embedding_dimensions = var.cognee_embedding_dimensions
|
|
1591
|
-
embedding_api_key_secret_arn = var.cognee_embedding_api_key_secret_arn
|
|
1592
|
-
|
|
1593
|
-
vector_db_provider = var.cognee_vector_db_provider
|
|
1594
|
-
vector_db_url = var.cognee_vector_db_url
|
|
1595
|
-
vector_db_key_secret_arn = var.cognee_vector_db_key_secret_arn
|
|
1596
|
-
|
|
1597
|
-
graph_database_provider = var.cognee_graph_database_provider
|
|
1598
|
-
graph_database_url = var.cognee_graph_database_url
|
|
1599
|
-
graph_database_username = var.cognee_graph_database_username
|
|
1600
|
-
graph_database_password_secret_arn = var.cognee_graph_database_password_secret_arn
|
|
1601
|
-
|
|
1602
|
-
neptune_graph_id = var.cognee_neptune_graph_id
|
|
1603
|
-
neptune_graph_arn = var.cognee_neptune_graph_arn
|
|
1604
|
-
neptune_endpoint = var.cognee_neptune_endpoint
|
|
1605
|
-
production_posture = var.cognee_production_posture
|
|
1606
|
-
|
|
1607
|
-
bedrock_model_resource_arns = var.cognee_bedrock_model_resource_arns
|
|
1608
|
-
kms_key_arns = var.cognee_kms_key_arns
|
|
1609
|
-
|
|
1610
|
-
depends_on = [terraform_data.cognee_configuration_guardrails]
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
1331
|
module "twenty" {
|
|
1614
1332
|
count = local.twenty_provisioned ? 1 : 0
|
|
1615
1333
|
source = "../../../plugins/twenty/terraform/twenty"
|
|
@@ -1668,15 +1386,14 @@ module "n8n" {
|
|
|
1668
1386
|
worker_concurrency = var.n8n_worker_concurrency
|
|
1669
1387
|
container_port = var.n8n_container_port
|
|
1670
1388
|
|
|
1671
|
-
database_admin_secret_arn
|
|
1672
|
-
database_url_secret_arn
|
|
1673
|
-
database_name
|
|
1674
|
-
database_username
|
|
1675
|
-
encryption_key_secret_arn
|
|
1676
|
-
operator_secret_arn
|
|
1677
|
-
service_credential_secret_arn
|
|
1678
|
-
|
|
1679
|
-
create_secret_placeholders = var.deployment_control_plane_create_secret_placeholders
|
|
1389
|
+
database_admin_secret_arn = var.n8n_database_admin_secret_arn
|
|
1390
|
+
database_url_secret_arn = var.n8n_database_url_secret_arn
|
|
1391
|
+
database_name = var.n8n_database_name
|
|
1392
|
+
database_username = var.n8n_database_username
|
|
1393
|
+
encryption_key_secret_arn = var.n8n_encryption_key_secret_arn
|
|
1394
|
+
operator_secret_arn = var.n8n_operator_secret_arn
|
|
1395
|
+
service_credential_secret_arn = var.n8n_service_credential_secret_arn
|
|
1396
|
+
create_secret_placeholders = var.deployment_control_plane_create_secret_placeholders
|
|
1680
1397
|
|
|
1681
1398
|
storage_bucket_name = var.n8n_storage_bucket_name
|
|
1682
1399
|
create_storage_bucket = (
|
|
@@ -1716,6 +1433,8 @@ module "ses" {
|
|
|
1716
1433
|
inbound_bucket_name = module.s3.bucket_name
|
|
1717
1434
|
email_inbound_fn_arn = module.api.email_inbound_fn_arn
|
|
1718
1435
|
email_inbound_fn_name = module.api.email_inbound_fn_name
|
|
1436
|
+
email_inbound_fn_arn_attr = module.api.email_inbound_fn_arn_attr
|
|
1437
|
+
email_inbound_fn_name_attr = module.api.email_inbound_fn_name_attr
|
|
1719
1438
|
enable_email_inbound_lambda_action = true
|
|
1720
1439
|
|
|
1721
1440
|
manage_active_rule_set = var.ses_manage_active_rule_set
|
|
@@ -1805,6 +1524,8 @@ module "customer_domain" {
|
|
|
1805
1524
|
inbound_bucket_name = module.s3.bucket_name
|
|
1806
1525
|
email_inbound_fn_arn = module.api.email_inbound_fn_arn
|
|
1807
1526
|
email_inbound_fn_name = module.api.email_inbound_fn_name
|
|
1527
|
+
email_inbound_fn_arn_attr = module.api.email_inbound_fn_arn_attr
|
|
1528
|
+
email_inbound_fn_name_attr = module.api.email_inbound_fn_name_attr
|
|
1808
1529
|
enable_email_inbound_lambda_action = true
|
|
1809
1530
|
|
|
1810
1531
|
# KTD6 — one active receipt rule set per account/region. The customer-domain
|