aiven.KafkaConnector
Explore with Pulumi AI
Creates and manages Aiven for Apache Kafka® connectors. Source connectors let you import data from an external system into a Kafka topic. Sink connectors let you export data from a topic to an external system.
You can use connectors with any Aiven for Apache Kafka® service that is integrated with an Aiven for Apache Kafka® Connect service.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aiven from "@pulumi/aiven";
const kafka_os_connector = new aiven.KafkaConnector("kafka-os-connector", {
project: exampleProject.project,
serviceName: exampleKafka.serviceName,
connectorName: "kafka-opensearch-connector",
config: {
name: "kafka-opensearch-connector",
topics: exampleTopic.topicName,
"connector.class": "io.aiven.kafka.connect.opensearch.OpensearchSinkConnector",
"type.name": "os-connector",
"connection.url": exampleOs.serviceUri,
"connection.username": exampleOs.serviceUsername,
"connection.password": exampleOs.servicePassword,
},
});
import pulumi
import pulumi_aiven as aiven
kafka_os_connector = aiven.KafkaConnector("kafka-os-connector",
project=example_project["project"],
service_name=example_kafka["serviceName"],
connector_name="kafka-opensearch-connector",
config={
"name": "kafka-opensearch-connector",
"topics": example_topic["topicName"],
"connector.class": "io.aiven.kafka.connect.opensearch.OpensearchSinkConnector",
"type.name": "os-connector",
"connection.url": example_os["serviceUri"],
"connection.username": example_os["serviceUsername"],
"connection.password": example_os["servicePassword"],
})
package main
import (
"github.com/pulumi/pulumi-aiven/sdk/v6/go/aiven"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := aiven.NewKafkaConnector(ctx, "kafka-os-connector", &aiven.KafkaConnectorArgs{
Project: pulumi.Any(exampleProject.Project),
ServiceName: pulumi.Any(exampleKafka.ServiceName),
ConnectorName: pulumi.String("kafka-opensearch-connector"),
Config: pulumi.StringMap{
"name": pulumi.String("kafka-opensearch-connector"),
"topics": pulumi.Any(exampleTopic.TopicName),
"connector.class": pulumi.String("io.aiven.kafka.connect.opensearch.OpensearchSinkConnector"),
"type.name": pulumi.String("os-connector"),
"connection.url": pulumi.Any(exampleOs.ServiceUri),
"connection.username": pulumi.Any(exampleOs.ServiceUsername),
"connection.password": pulumi.Any(exampleOs.ServicePassword),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aiven = Pulumi.Aiven;
return await Deployment.RunAsync(() =>
{
var kafka_os_connector = new Aiven.KafkaConnector("kafka-os-connector", new()
{
Project = exampleProject.Project,
ServiceName = exampleKafka.ServiceName,
ConnectorName = "kafka-opensearch-connector",
Config =
{
{ "name", "kafka-opensearch-connector" },
{ "topics", exampleTopic.TopicName },
{ "connector.class", "io.aiven.kafka.connect.opensearch.OpensearchSinkConnector" },
{ "type.name", "os-connector" },
{ "connection.url", exampleOs.ServiceUri },
{ "connection.username", exampleOs.ServiceUsername },
{ "connection.password", exampleOs.ServicePassword },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aiven.KafkaConnector;
import com.pulumi.aiven.KafkaConnectorArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var kafka_os_connector = new KafkaConnector("kafka-os-connector", KafkaConnectorArgs.builder()
.project(exampleProject.project())
.serviceName(exampleKafka.serviceName())
.connectorName("kafka-opensearch-connector")
.config(Map.ofEntries(
Map.entry("name", "kafka-opensearch-connector"),
Map.entry("topics", exampleTopic.topicName()),
Map.entry("connector.class", "io.aiven.kafka.connect.opensearch.OpensearchSinkConnector"),
Map.entry("type.name", "os-connector"),
Map.entry("connection.url", exampleOs.serviceUri()),
Map.entry("connection.username", exampleOs.serviceUsername()),
Map.entry("connection.password", exampleOs.servicePassword())
))
.build());
}
}
resources:
kafka-os-connector:
type: aiven:KafkaConnector
properties:
project: ${exampleProject.project}
serviceName: ${exampleKafka.serviceName}
connectorName: kafka-opensearch-connector
config:
name: kafka-opensearch-connector
topics: ${exampleTopic.topicName}
connector.class: io.aiven.kafka.connect.opensearch.OpensearchSinkConnector
type.name: os-connector
connection.url: ${exampleOs.serviceUri}
connection.username: ${exampleOs.serviceUsername}
connection.password: ${exampleOs.servicePassword}
Create KafkaConnector Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new KafkaConnector(name: string, args: KafkaConnectorArgs, opts?: CustomResourceOptions);
@overload
def KafkaConnector(resource_name: str,
args: KafkaConnectorArgs,
opts: Optional[ResourceOptions] = None)
@overload
def KafkaConnector(resource_name: str,
opts: Optional[ResourceOptions] = None,
config: Optional[Mapping[str, str]] = None,
connector_name: Optional[str] = None,
project: Optional[str] = None,
service_name: Optional[str] = None)
func NewKafkaConnector(ctx *Context, name string, args KafkaConnectorArgs, opts ...ResourceOption) (*KafkaConnector, error)
public KafkaConnector(string name, KafkaConnectorArgs args, CustomResourceOptions? opts = null)
public KafkaConnector(String name, KafkaConnectorArgs args)
public KafkaConnector(String name, KafkaConnectorArgs args, CustomResourceOptions options)
type: aiven:KafkaConnector
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args KafkaConnectorArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args KafkaConnectorArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args KafkaConnectorArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KafkaConnectorArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KafkaConnectorArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var kafkaConnectorResource = new Aiven.KafkaConnector("kafkaConnectorResource", new()
{
Config =
{
{ "string", "string" },
},
ConnectorName = "string",
Project = "string",
ServiceName = "string",
});
example, err := aiven.NewKafkaConnector(ctx, "kafkaConnectorResource", &aiven.KafkaConnectorArgs{
Config: pulumi.StringMap{
"string": pulumi.String("string"),
},
ConnectorName: pulumi.String("string"),
Project: pulumi.String("string"),
ServiceName: pulumi.String("string"),
})
var kafkaConnectorResource = new KafkaConnector("kafkaConnectorResource", KafkaConnectorArgs.builder()
.config(Map.of("string", "string"))
.connectorName("string")
.project("string")
.serviceName("string")
.build());
kafka_connector_resource = aiven.KafkaConnector("kafkaConnectorResource",
config={
"string": "string",
},
connector_name="string",
project="string",
service_name="string")
const kafkaConnectorResource = new aiven.KafkaConnector("kafkaConnectorResource", {
config: {
string: "string",
},
connectorName: "string",
project: "string",
serviceName: "string",
});
type: aiven:KafkaConnector
properties:
config:
string: string
connectorName: string
project: string
serviceName: string
KafkaConnector Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The KafkaConnector resource accepts the following input properties:
- Config Dictionary<string, string>
- The Kafka connector configuration parameters.
- Connector
Name string - The Kafka connector name. Changing this property forces recreation of the resource.
- Project string
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- Service
Name string - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- Config map[string]string
- The Kafka connector configuration parameters.
- Connector
Name string - The Kafka connector name. Changing this property forces recreation of the resource.
- Project string
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- Service
Name string - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- config Map<String,String>
- The Kafka connector configuration parameters.
- connector
Name String - The Kafka connector name. Changing this property forces recreation of the resource.
- project String
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- service
Name String - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- config {[key: string]: string}
- The Kafka connector configuration parameters.
- connector
Name string - The Kafka connector name. Changing this property forces recreation of the resource.
- project string
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- service
Name string - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- config Mapping[str, str]
- The Kafka connector configuration parameters.
- connector_
name str - The Kafka connector name. Changing this property forces recreation of the resource.
- project str
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- service_
name str - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- config Map<String>
- The Kafka connector configuration parameters.
- connector
Name String - The Kafka connector name. Changing this property forces recreation of the resource.
- project String
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- service
Name String - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the KafkaConnector resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- string
- The Kafka connector author.
- Plugin
Class string - The Kafka connector Java class.
- Plugin
Doc stringUrl - The Kafka connector documentation URL.
- Plugin
Title string - The Kafka connector title.
- Plugin
Type string - The Kafka connector type.
- Plugin
Version string - The version of the Kafka connector.
- Tasks
List<Kafka
Connector Task> - List of tasks of a connector.
- Id string
- The provider-assigned unique ID for this managed resource.
- string
- The Kafka connector author.
- Plugin
Class string - The Kafka connector Java class.
- Plugin
Doc stringUrl - The Kafka connector documentation URL.
- Plugin
Title string - The Kafka connector title.
- Plugin
Type string - The Kafka connector type.
- Plugin
Version string - The version of the Kafka connector.
- Tasks
[]Kafka
Connector Task - List of tasks of a connector.
- id String
- The provider-assigned unique ID for this managed resource.
- String
- The Kafka connector author.
- plugin
Class String - The Kafka connector Java class.
- plugin
Doc StringUrl - The Kafka connector documentation URL.
- plugin
Title String - The Kafka connector title.
- plugin
Type String - The Kafka connector type.
- plugin
Version String - The version of the Kafka connector.
- tasks
List<Kafka
Connector Task> - List of tasks of a connector.
- id string
- The provider-assigned unique ID for this managed resource.
- string
- The Kafka connector author.
- plugin
Class string - The Kafka connector Java class.
- plugin
Doc stringUrl - The Kafka connector documentation URL.
- plugin
Title string - The Kafka connector title.
- plugin
Type string - The Kafka connector type.
- plugin
Version string - The version of the Kafka connector.
- tasks
Kafka
Connector Task[] - List of tasks of a connector.
- id str
- The provider-assigned unique ID for this managed resource.
- str
- The Kafka connector author.
- plugin_
class str - The Kafka connector Java class.
- plugin_
doc_ strurl - The Kafka connector documentation URL.
- plugin_
title str - The Kafka connector title.
- plugin_
type str - The Kafka connector type.
- plugin_
version str - The version of the Kafka connector.
- tasks
Sequence[Kafka
Connector Task] - List of tasks of a connector.
- id String
- The provider-assigned unique ID for this managed resource.
- String
- The Kafka connector author.
- plugin
Class String - The Kafka connector Java class.
- plugin
Doc StringUrl - The Kafka connector documentation URL.
- plugin
Title String - The Kafka connector title.
- plugin
Type String - The Kafka connector type.
- plugin
Version String - The version of the Kafka connector.
- tasks List<Property Map>
- List of tasks of a connector.
Look up Existing KafkaConnector Resource
Get an existing KafkaConnector resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: KafkaConnectorState, opts?: CustomResourceOptions): KafkaConnector
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config: Optional[Mapping[str, str]] = None,
connector_name: Optional[str] = None,
plugin_author: Optional[str] = None,
plugin_class: Optional[str] = None,
plugin_doc_url: Optional[str] = None,
plugin_title: Optional[str] = None,
plugin_type: Optional[str] = None,
plugin_version: Optional[str] = None,
project: Optional[str] = None,
service_name: Optional[str] = None,
tasks: Optional[Sequence[KafkaConnectorTaskArgs]] = None) -> KafkaConnector
func GetKafkaConnector(ctx *Context, name string, id IDInput, state *KafkaConnectorState, opts ...ResourceOption) (*KafkaConnector, error)
public static KafkaConnector Get(string name, Input<string> id, KafkaConnectorState? state, CustomResourceOptions? opts = null)
public static KafkaConnector get(String name, Output<String> id, KafkaConnectorState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Config Dictionary<string, string>
- The Kafka connector configuration parameters.
- Connector
Name string - The Kafka connector name. Changing this property forces recreation of the resource.
- string
- The Kafka connector author.
- Plugin
Class string - The Kafka connector Java class.
- Plugin
Doc stringUrl - The Kafka connector documentation URL.
- Plugin
Title string - The Kafka connector title.
- Plugin
Type string - The Kafka connector type.
- Plugin
Version string - The version of the Kafka connector.
- Project string
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- Service
Name string - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- Tasks
List<Kafka
Connector Task> - List of tasks of a connector.
- Config map[string]string
- The Kafka connector configuration parameters.
- Connector
Name string - The Kafka connector name. Changing this property forces recreation of the resource.
- string
- The Kafka connector author.
- Plugin
Class string - The Kafka connector Java class.
- Plugin
Doc stringUrl - The Kafka connector documentation URL.
- Plugin
Title string - The Kafka connector title.
- Plugin
Type string - The Kafka connector type.
- Plugin
Version string - The version of the Kafka connector.
- Project string
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- Service
Name string - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- Tasks
[]Kafka
Connector Task Args - List of tasks of a connector.
- config Map<String,String>
- The Kafka connector configuration parameters.
- connector
Name String - The Kafka connector name. Changing this property forces recreation of the resource.
- String
- The Kafka connector author.
- plugin
Class String - The Kafka connector Java class.
- plugin
Doc StringUrl - The Kafka connector documentation URL.
- plugin
Title String - The Kafka connector title.
- plugin
Type String - The Kafka connector type.
- plugin
Version String - The version of the Kafka connector.
- project String
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- service
Name String - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- tasks
List<Kafka
Connector Task> - List of tasks of a connector.
- config {[key: string]: string}
- The Kafka connector configuration parameters.
- connector
Name string - The Kafka connector name. Changing this property forces recreation of the resource.
- string
- The Kafka connector author.
- plugin
Class string - The Kafka connector Java class.
- plugin
Doc stringUrl - The Kafka connector documentation URL.
- plugin
Title string - The Kafka connector title.
- plugin
Type string - The Kafka connector type.
- plugin
Version string - The version of the Kafka connector.
- project string
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- service
Name string - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- tasks
Kafka
Connector Task[] - List of tasks of a connector.
- config Mapping[str, str]
- The Kafka connector configuration parameters.
- connector_
name str - The Kafka connector name. Changing this property forces recreation of the resource.
- str
- The Kafka connector author.
- plugin_
class str - The Kafka connector Java class.
- plugin_
doc_ strurl - The Kafka connector documentation URL.
- plugin_
title str - The Kafka connector title.
- plugin_
type str - The Kafka connector type.
- plugin_
version str - The version of the Kafka connector.
- project str
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- service_
name str - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- tasks
Sequence[Kafka
Connector Task Args] - List of tasks of a connector.
- config Map<String>
- The Kafka connector configuration parameters.
- connector
Name String - The Kafka connector name. Changing this property forces recreation of the resource.
- String
- The Kafka connector author.
- plugin
Class String - The Kafka connector Java class.
- plugin
Doc StringUrl - The Kafka connector documentation URL.
- plugin
Title String - The Kafka connector title.
- plugin
Type String - The Kafka connector type.
- plugin
Version String - The version of the Kafka connector.
- project String
- The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- service
Name String - The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
- tasks List<Property Map>
- List of tasks of a connector.
Supporting Types
KafkaConnectorTask, KafkaConnectorTaskArgs
Import
$ pulumi import aiven:index/kafkaConnector:KafkaConnector kafka-os-connector PROJECT/SERVICE_NAME/CONNECTOR_NAME
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Aiven pulumi/pulumi-aiven
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aiven
Terraform Provider.