Policy Importer Service

Batch and API ingestion service that converts external policy data into Policy and Identity commands for the Capstone PAS.

Service Supporting Service Batch Processing

Overview

The Policy Importer Service ingests policy data from external systems and transforms it into Capstone policy and identity commands. It supports both batch CSV uploads and JSON ingestion via HTTP, enabling migrations and partner integrations.

Ingestion Paths

Batch CSV (S3)

  • CSV files uploaded to sft-capstone-{env}-bulk-policy-import-risk
  • PolicyBatchImporterLambdaHandler parses rows into policy and identity commands
  • Failed rows are written to sft-capstone-{env}-bulk-policy-import-risk-failed

JSON API

  • POST /policies handled by CreatePolicyRequestHttpIngestionLambdaHandler
  • Requests are enqueued to sft-capstone-policy-importer-{env}-create-policy-request-queue
  • CreatePolicyRequestCommandLambdaHandler validates and dispatches downstream commands

Command Dispatch

  • Policy Service: CreateFuneralPolicy commands sent to the policy command queue
  • Identity Service: CreateUnverifiedIdentity commands sent to the identity command queue

Failure Handling

  • Invalid messages are routed to IMQ/DLQ queues
  • Failed CSV rows are exported with an error column for reprocessing

Infrastructure

  • Lambdas: batch importer, HTTP ingestion, SQS command handler
  • Queues: create-policy-request, IMQ, DLQ
  • Buckets: risk import bucket, failed-row bucket
  • Observability: Datadog integration enabled for non-sandbox environments