Hello,
I am following this article to create a source connector in the AWS Ecosystem (AWS MSK and AWS Kafka Connect). I am following this article which details how we can externalize the secrets (username and password) from the mongo connection string with a config provider: Stream data with Amazon DocumentDB, Amazon MSK Serverless, and Amazon MSK Connect | AWS Database Blog
However, I get the following validation error on the connection.uri property when using the config provider:
Code: **InvalidInput.InvalidConnectorConfiguration**
Message: **The connector configuration is invalid. Message: Connector configuration is invalid and contains the following 1 error(s): Invalid value mongodb://${ssm::/order/db/order/username}:${ssm::/order/db/order/password}@redactedurlformongo:27017/?ssl=true&replicaSet=rs0&retryWrites=false for configuration connection.uri: The connection string contains an invalid host '${ssm::'. Reserved characters such as ':' must be escaped according RFC 2396. Any IPv6 address literal must be enclosed in '[' and ']' according to RFC 2732.**
Here is an example of my configuration:
connector.class=com.mongodb.kafka.connect.MongoSourceConnector
connection.ssl.truststorePassword=${ssm::/platform/db/master/cacert/truststore/password}
tasks.max=1
change.stream.full.document=updateLookup
config.providers.ssm.class=com.amazonaws.kafka.config.providers.SsmParamStoreConfigProvider
config.providers=s3import,ssm
collection=orders
connection.ssl.truststore=${s3import:us-east-2:ole-poc-kafka-connectors/rds-truststore.jks}
config.providers.s3import.param.region=us-east-2
database=order
topic.namespace.map={"order.orders": "orders"}
connection.uri=mongodb://${ssm::/order/db/order/username}:${ssm::/order/db/order/password}@redactedurlformongo:27017/?ssl=true&replicaSet=rs0&retryWrites=false
errors.tolerance=all
config.providers.ssm.param.region=us-east-2
config.providers.s3import.class=com.amazonaws.kafka.config.providers.S3ImportConfigProvider
This issue is also reported here: MongoDB Source Connector - configuration validation runs before replacement when using a Config Provider · Issue #1319 · confluentinc/kafka-connect-jdbc · GitHub