{
  "id": "terraform-12",
  "title": "Trust Score profile",
  "description": "Declare a Trust Score profile that scores Person nodes on verification, origin and freshness, recomputed daily, with the indykite_trust_score_profile resource.",
  "category": "TrustScore",
  "tags": [
    "Trust Score",
    "Data Quality",
    "Dimensions"
  ],
  "lastUpdated": "2026-10-12",
  "terraformProviderDocs": [
    "https://registry.terraform.io/providers/indykite/indykite/latest/docs/resources/trust_score_profile"
  ],
  "relatedGuides": [
    "/guides/guide-trust-score",
    "/guides/guide-terraform"
  ],
  "commonErrors": [
    {
      "code": "ALREADY_EXISTS",
      "message": "Conflict",
      "solution": "name is unique within the project and immutable. Choose another name, or import the existing profile into Terraform state."
    }
  ],
  "summary": "A Trust Score profile gives every node of one type a score that says how far its data can be trusted. The score combines the chosen dimensions, each with a weight, and is recomputed on the profile's schedule; it is then readable on the node and usable in authorization conditions.\nThis Terraform configuration creates a profile for Person nodes that:\n1. Weights verification 0.5, origin 0.3 and freshness 0.2 (the other dimensions are validity and completeness).\n2. Recomputes daily (UPDATE_FREQUENCY_DAILY; the other schedules are every twelve, six or three hours).\nnode_classification is fixed at creation; weights and schedule can be updated.",
  "usecase": "Scenario: Person records come from several sources of different quality and a policy must favour the trustworthy ones.\n- The profile is declared in version control; data owners agree on the dimensions and weights in a reviewed change.\n- After the first computation the trust score and its dimensions are read like any other property, and a KBAC or ContX IQ policy can require a minimum score, as the Trust Score guide shows.\n- Rebalancing the weights is an update and takes effect at the next scheduled computation.",
  "requirements": "- ServiceAccount credentials created in the IndyKite Hub for your organization.\n- IndyKite Terraform provider 0.49.0 or later, the release the example pins in required_providers; the Terraform guide lists the version each feature first appeared in.\n- A project GID for project_id, and Person nodes captured with property metadata (source, verification, timestamps) for the dimensions to have something to score.",
  "steps": "1. Put your project GID in project_id and the node type in node_classification.\n2. Choose the dimensions and weights (each between 0 and 1) and the schedule, then apply.\n3. After the first run, read the score on a node through ContX IQ and use it in a policy condition.\n4. Adjust weights or schedule and apply again; the next computation uses the new values.",
  "code": [
    {
      "description": "A Trust Score profile for Person nodes with three weighted dimensions and a daily schedule.",
      "filename": "main.tf",
      "code": "\nterraform {\n  required_providers {\n    indykite = {\n      source  = \"indykite/indykite\"\n      version = \">= 0.49.0\" # or a later release\n    }\n  }\n}\n\n# indykite provider integrates IndyKite platform with Terraform scripting.\n# Provider for now does not support any parameters and all is set within service account credential file.\nprovider \"indykite\" {}\n\n# A Trust Score profile scores every node of one type on the chosen dimensions,\n# weighted, and recomputes on the schedule. node_classification cannot be\n# changed after creation. Each weight is between 0 and 1 and the weights sum to 1.0.\nresource \"indykite_trust_score_profile\" \"person\" {\n  name                = \"terraform-trust-score-person\"\n  display_name        = \"Trust score for Person nodes\"\n  description         = \"How far a Person record can be trusted: verified and well-sourced data scores highest\"\n  project_id          = \"gid:AAAAAmluZHlraURlgAABDwAAAAA\" # your project GID\n  node_classification = \"Person\"\n  dimension {\n    name   = \"NAME_VERIFICATION\" # the data was confirmed by a trusted source\n    weight = 0.5\n  }\n  dimension {\n    name   = \"NAME_ORIGIN\" # where the data comes from\n    weight = 0.3\n  }\n  dimension {\n    name   = \"NAME_FRESHNESS\" # how recently it was updated\n    weight = 0.2\n  }\n  # UPDATE_FREQUENCY_DAILY, _TWELVE_HOURS, _SIX_HOURS or _THREE_HOURS\n  schedule = \"UPDATE_FREQUENCY_DAILY\"\n}\n"
    }
  ],
  "links": {
    "html": "/terraform/terraform-12",
    "markdown": "/terraform/terraform-12.md",
    "terraformRegistry": "https://registry.terraform.io/providers/indykite/indykite/latest/docs"
  }
}