{
    "name": "{{ index . `CONNECTOR_NAME` }}",
    "connector.class": "io.aiven.kafka.connect.opensearch.OpenSearchSinkConnector",
    "tasks.max": "{{ index . `MAX_TASKS` }}",
    "topics": "{{ index . `KAFKA_TOPICS` }}",
    "connection.url": "{{ index . `OPENSEARCH_HOST` }}",
    {{ if (index . "SECRETS_MANAGER_OPENSEARCH_SECRET_NAME") }}
    "connection.username": "${aws:{{ index . `Environment` }}/{{ index . `SERVICE_NAME` }}/{{ index . `SECRETS_MANAGER_OPENSEARCH_SECRET_NAME` }}:username}",
    "connection.password": "${aws:{{ index . `Environment` }}/{{ index . `SERVICE_NAME` }}/{{ index . `SECRETS_MANAGER_OPENSEARCH_SECRET_NAME` }}:password}",
    "config.providers": "aws",
    "config.providers.aws.class": "io.lenses.connect.secrets.providers.AWSSecretProvider",
    "config.providers.aws.param.aws.auth.method": "default",
    "config.providers.aws.param.aws.access.key": "dummy",
    "config.providers.aws.param.aws.secret.key": "dummy",
    "config.providers.aws.param.aws.region": "{{ index . `AWS_REGION` }}",
    {{ else if and (index . "OPENSEARCH_USERNAME") (index . "OPENSEARCH_PASSWORD") }}
    "connection.username": "{{ index . `OPENSEARCH_USERNAME` }}",
    "connection.password": "{{ index . `OPENSEARCH_PASSWORD` }}",
    {{ end }}
    "type.name": "{{ index . `OPENSEARCH_DOC_TYPE` }}",
    "key.ignore": "{{ index . `OPENSEARCH_KEY_IGNORE` }}",
    "key.ignore.id.strategy": "record.key",
    "schema.ignore": "{{ index . `OPENSEARCH_SCHEMA_IGNORE` }}",
    "key.converter": "org.apache.kafka.connect.storage.StringConverter",
    "value.converter": "org.apache.kafka.connect.json.JsonConverter",
    "value.converter.schemas.enable": "false",
    "index.write.method": "{{ index . `WRITE_METHOD` }}",
    "batch.size": "{{ index . `BATCH_SIZE` }}",
    "max.in.flight.requests": "{{ index . `MAX_INFLIGHT_REQUESTS` }}",
    "max.buffered.records": "{{ index . `MAX_BUFFERED_RECORDS` }}",
    "flush.timeout.ms": "{{ index . `FLUSH_TIMEOUT_MS` }}",
    "read.timeout.ms": "{{ index . `READ_TIMEOUT_MS` }}",
    "max.retries": "{{ index . `MAX_RETRIES` }}",
    "retry.backoff.ms": "{{ index . `RETRY_BACKOFF_MS` }}",
    "behavior.on.null.values": "delete",
    "transforms": "{{ index . `TRANSFORMS` }}",
    "transforms.renameTopic.type": "{{ index . `TRANSFORMS_RENAMETOPIC_TYPE` }}",
    "transforms.renameTopic.regex": "{{ index . `TRANSFORMS_RENAMETOPIC_REGEX` }}",
    "transforms.renameTopic.replacement": "{{ index . `TRANSFORMS_RENAMETOPIC_REPLACEMENT` }}",
    "errors.tolerance": "all",
    "behavior.on.malformed.documents": "report",
    "behavior.on.version.conflict": "{{ index . `BEHAVIOR_ON_VERSION_CONFLICT` }}",
    {{ if (index . "DLQ_TOPIC_NAME") }}
    "errors.deadletterqueue.topic.name": "{{ index . `DLQ_TOPIC_NAME` }}",
    "errors.deadletterqueue.context.headers.enable": "true",
    {{ end }}
    "errors.log.enable": true,
    "errors.log.include.messages": true,
    "errors.retry.timeout": "15",
    "errors.retry.delay.max.ms": "5000"
}
