# Entity Enrichment config
#
# Uses the EntityEnrichment template to attach custom properties to
# entities that already exist in the Veza graph (discovered by other
# integrations). This example reads a CSV of AWS IAM role ARNs and
# enriches each role with company-internal metadata.
#
# Key differences from a custom_app config:
#   * `destination_type: ENTITY_ENRICHMENT`
#   * each source uses `destination: EnrichedEntity`
#   * each source declares the Veza `entity_type` it enriches
#     (e.g. AwsIamRole, AwsIamUser, OktaUser)
#   * each source declares the `data_source_id` of the Veza datasource
#     that owns the entities being enriched
#   * field_mapping must include a row mapped to `id` — the Veza unique
#     ID of the entity (for AWS, the ARN)
#
# Run with:
#   oaa custom_app -c ./entity-enrichment.yaml run

version: v2

VEZA_URL: https://myorg.vezacloud.com
VEZA_API_KEY: "!env"

destination_type: ENTITY_ENRICHMENT

app:
  name: Company Metadata Enrichment

sources:
  aws_iam_roles:
    destination: EnrichedEntity
    entity_type: AwsIamRole
    data_source_id: "339083562601:awsiam"
    source_type: csv
    csv_filepath: ./data/role_metadata.csv
    field_mapping:
      role_arn:
        destination_field: id
      my_company_id:
        destination_field: my_company_id
        custom_type: STRING
      company_purpose:
        destination_field: company_purpose
        custom_type: STRING
      is_compliance_validated:
        destination_field: is_compliance_validated
        custom_type: BOOLEAN

  aws_iam_users:
    destination: EnrichedEntity
    entity_type: AwsIamUser
    data_source_id: "339083562601:awsiam"
    source_type: csv
    csv_filepath: ./data/user_metadata.csv
    field_mapping:
      user_arn:
        destination_field: id
      company_purpose:
        destination_field: company_purpose
        custom_type: STRING
