Skip to content

Latest commit

 

History

History

README.md

Complete example

The full Security Copilot surface: an Azure compute capacity (azapi), a plugin on the default workspace, and a chained session, prompt and evaluation (the prompt and evaluation reference their parents by map key so the module resolves the created ids). Experimental and beta; ids are placeholders and nothing applies without a provisioned tenant, SCU capacity and the security Graph permissions.

Terraform Registry

Example configuration

# Complete call, showing the full Security Copilot surface end to end:
#   - deploy an Azure compute capacity (azapi, Microsoft.SecurityCopilot/capacities)
#   - manage a plugin on the default workspace
#   - create a session, a prompt in that session, and an evaluation on that prompt (chained by key)
#   - reach any other endpoint through the generic passthrough
#
# EXPERIMENTAL and beta. Nothing here applies without a Security Copilot provisioned tenant, an
# Azure subscription with SCU capacity, and the security Graph permissions; ids are placeholders.
module "security_copilot" {
  source = "../../"

  # Azure ARM compute capacity (SCUs). Verify azapi_version against the current provider API version.
  compute_capacity = {
    primary = {
      resource_group_id = var.resource_group_id
      name              = "seccopilot-${var.short}-uks-01"
      location          = "uksouth"
      number_of_units   = 1
      geo               = "UK"
    }
  }

  # A plugin on the default workspace.
  plugins = {
    my-plugin = {
      body = {
        displayName = "terraform-plugin"
      }
    }
  }

  # A session, then a prompt in it, then an evaluation on that prompt. The prompt references the
  # session by key, and the evaluation references both the session and the prompt by key, so the
  # module resolves the created ids and builds the nested URLs.
  sessions = {
    chat = {
      body = { title = "terraform-complete-session" }
    }
  }

  prompts = {
    question = {
      session_key = "chat"
      body = {
        promptType = "userPrompt"
        content = {
          text = "Summarise the highest severity incidents from the last 24 hours."
        }
      }
    }
  }

  evaluations = {
    run = {
      session_key = "chat"
      prompt_key  = "question"
    }
  }

  # Anything else, by raw URL.
  resources = {
    list-workspaces = {
      url  = "security/securityCopilot/workspaces"
      body = {}
    }
  }
}

Requirements

Name Version
terraform >= 1.9.0, < 2.0.0
azapi >= 2.0.0, < 3.0.0
msgraph >= 0.1.0, < 1.0.0

Providers

No providers.

Modules

Name Source Version
security_copilot ../../ n/a

Resources

No resources.

Inputs

Name Description Type Default Required
resource_group_id Resource group id for the Security Copilot compute capacity. Replace with a real id. string "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-ldo-uks-copilot" no
short Infix: short product code used in resource names. string "ldo" no

Outputs

Name Description
compute_capacity_ids Azure resource ids of the Security Copilot capacities.
evaluations Created evaluations (poll these for AI results).
prompt_ids Created prompt ids.
session_ids Created session ids.