apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnector
metadata:
  labels:
    strimzi.io/cluster: {{ .Values.kafkaConnectConf.clusterName }}
  name: {{ .Values.kafkaConnectConf.auditConnectorName }}
spec:
  class: 'io.confluent.connect.jdbc.JdbcSinkConnector'
  tasksMax: 1
  config:
    value.converter.schema.registry.url: {{ .Values.kafkaConnectConf.schemaRegistryUrl }}
    value.converter: 'io.confluent.connect.avro.AvroConverter'
    topics: 'audit-events'
    name: {{ .Values.kafkaConnectConf.auditConnectorName }}
    connection.password: '${env:DB_PASSWORD}'
    connector.class: 'io.confluent.connect.jdbc.JdbcSinkConnector'
    table.name.format: 'audit_event'
    connection.user: '${env:DB_USER}'
    auto.evolve: 'true'
    connection.url: {{ .Values.kafkaConnectConf.dbConnectionUrl }}
    transforms: 'TimestampConverter'
    transforms.TimestampConverter.field: 'timestamp'
    transforms.TimestampConverter.type: 'org.apache.kafka.connect.transforms.TimestampConverter$Value'
    transforms.TimestampConverter.target.type: 'Timestamp'
