1. Packages
  2. Aiven
  3. API Docs
  4. KafkaConnector
Aiven v6.13.0 published on Monday, Mar 25, 2024 by Pulumi

aiven.KafkaConnector

Explore with Pulumi AI

aiven logo
Aiven v6.13.0 published on Monday, Mar 25, 2024 by Pulumi

    The Kafka connectors resource allows the creation and management of Aiven Kafka connectors.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aiven from "@pulumi/aiven";
    
    const kafka_os_con1 = new aiven.KafkaConnector("kafka-os-con1", {
        project: aiven_project["kafka-con-project1"].project,
        serviceName: aiven_kafka["kafka-service1"].service_name,
        connectorName: "kafka-os-con1",
        config: {
            topics: aiven_kafka_topic["kafka-topic1"].topic_name,
            "connector.class": "io.aiven.kafka.connect.opensearch.OpensearchSinkConnector",
            "type.name": "os-connector",
            name: "kafka-os-con1",
            "connection.url": aiven_opensearch["os-service1"].service_uri,
            "connection.username": aiven_opensearch["os-service1"].service_username,
            "connection.password": aiven_opensearch["os-service1"].service_password,
        },
    });
    
    import pulumi
    import pulumi_aiven as aiven
    
    kafka_os_con1 = aiven.KafkaConnector("kafka-os-con1",
        project=aiven_project["kafka-con-project1"]["project"],
        service_name=aiven_kafka["kafka-service1"]["service_name"],
        connector_name="kafka-os-con1",
        config={
            "topics": aiven_kafka_topic["kafka-topic1"]["topic_name"],
            "connector.class": "io.aiven.kafka.connect.opensearch.OpensearchSinkConnector",
            "type.name": "os-connector",
            "name": "kafka-os-con1",
            "connection.url": aiven_opensearch["os-service1"]["service_uri"],
            "connection.username": aiven_opensearch["os-service1"]["service_username"],
            "connection.password": aiven_opensearch["os-service1"]["service_password"],
        })
    
    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-con1", &aiven.KafkaConnectorArgs{
    			Project:       pulumi.Any(aiven_project.KafkaConProject1.Project),
    			ServiceName:   pulumi.Any(aiven_kafka.KafkaService1.Service_name),
    			ConnectorName: pulumi.String("kafka-os-con1"),
    			Config: pulumi.StringMap{
    				"topics":              pulumi.Any(aiven_kafka_topic.KafkaTopic1.Topic_name),
    				"connector.class":     pulumi.String("io.aiven.kafka.connect.opensearch.OpensearchSinkConnector"),
    				"type.name":           pulumi.String("os-connector"),
    				"name":                pulumi.String("kafka-os-con1"),
    				"connection.url":      pulumi.Any(aiven_opensearch.OsService1.Service_uri),
    				"connection.username": pulumi.Any(aiven_opensearch.OsService1.Service_username),
    				"connection.password": pulumi.Any(aiven_opensearch.OsService1.Service_password),
    			},
    		})
    		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_con1 = new Aiven.KafkaConnector("kafka-os-con1", new()
        {
            Project = aiven_project.Kafka_con_project1.Project,
            ServiceName = aiven_kafka.Kafka_service1.Service_name,
            ConnectorName = "kafka-os-con1",
            Config = 
            {
                { "topics", aiven_kafka_topic.Kafka_topic1.Topic_name },
                { "connector.class", "io.aiven.kafka.connect.opensearch.OpensearchSinkConnector" },
                { "type.name", "os-connector" },
                { "name", "kafka-os-con1" },
                { "connection.url", aiven_opensearch.Os_service1.Service_uri },
                { "connection.username", aiven_opensearch.Os_service1.Service_username },
                { "connection.password", aiven_opensearch.Os_service1.Service_password },
            },
        });
    
    });
    
    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_con1 = new KafkaConnector("kafka-os-con1", KafkaConnectorArgs.builder()        
                .project(aiven_project.kafka-con-project1().project())
                .serviceName(aiven_kafka.kafka-service1().service_name())
                .connectorName("kafka-os-con1")
                .config(Map.ofEntries(
                    Map.entry("topics", aiven_kafka_topic.kafka-topic1().topic_name()),
                    Map.entry("connector.class", "io.aiven.kafka.connect.opensearch.OpensearchSinkConnector"),
                    Map.entry("type.name", "os-connector"),
                    Map.entry("name", "kafka-os-con1"),
                    Map.entry("connection.url", aiven_opensearch.os-service1().service_uri()),
                    Map.entry("connection.username", aiven_opensearch.os-service1().service_username()),
                    Map.entry("connection.password", aiven_opensearch.os-service1().service_password())
                ))
                .build());
    
        }
    }
    
    resources:
      kafka-os-con1:
        type: aiven:KafkaConnector
        properties:
          project: ${aiven_project"kafka-con-project1"[%!s(MISSING)].project}
          serviceName: ${aiven_kafka"kafka-service1"[%!s(MISSING)].service_name}
          connectorName: kafka-os-con1
          config:
            topics: ${aiven_kafka_topic"kafka-topic1"[%!s(MISSING)].topic_name}
            connector.class: io.aiven.kafka.connect.opensearch.OpensearchSinkConnector
            type.name: os-connector
            name: kafka-os-con1
            connection.url: ${aiven_opensearch"os-service1"[%!s(MISSING)].service_uri}
            connection.username: ${aiven_opensearch"os-service1"[%!s(MISSING)].service_username}
            connection.password: ${aiven_opensearch"os-service1"[%!s(MISSING)].service_password}
    

    Create KafkaConnector Resource

    new KafkaConnector(name: string, args: KafkaConnectorArgs, opts?: CustomResourceOptions);
    @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)
    @overload
    def KafkaConnector(resource_name: str,
                       args: KafkaConnectorArgs,
                       opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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.
    ConnectorName string
    The kafka connector name. Changing this property forces recreation of the resource.
    Project string
    Identifies 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.
    ServiceName string
    Specifies 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.
    ConnectorName string
    The kafka connector name. Changing this property forces recreation of the resource.
    Project string
    Identifies 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.
    ServiceName string
    Specifies 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.
    connectorName String
    The kafka connector name. Changing this property forces recreation of the resource.
    project String
    Identifies 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.
    serviceName String
    Specifies 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.
    connectorName string
    The kafka connector name. Changing this property forces recreation of the resource.
    project string
    Identifies 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.
    serviceName string
    Specifies 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
    Identifies 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
    Specifies 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.
    connectorName String
    The kafka connector name. Changing this property forces recreation of the resource.
    project String
    Identifies 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.
    serviceName String
    Specifies 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.
    PluginAuthor string
    The Kafka connector author.
    PluginClass string
    The Kafka connector Java class.
    PluginDocUrl string
    The Kafka connector documentation URL.
    PluginTitle string
    The Kafka connector title.
    PluginType string
    The Kafka connector type.
    PluginVersion string
    The version of the kafka connector.
    Tasks List<KafkaConnectorTask>
    List of tasks of a connector.
    Id string
    The provider-assigned unique ID for this managed resource.
    PluginAuthor string
    The Kafka connector author.
    PluginClass string
    The Kafka connector Java class.
    PluginDocUrl string
    The Kafka connector documentation URL.
    PluginTitle string
    The Kafka connector title.
    PluginType string
    The Kafka connector type.
    PluginVersion string
    The version of the kafka connector.
    Tasks []KafkaConnectorTask
    List of tasks of a connector.
    id String
    The provider-assigned unique ID for this managed resource.
    pluginAuthor String
    The Kafka connector author.
    pluginClass String
    The Kafka connector Java class.
    pluginDocUrl String
    The Kafka connector documentation URL.
    pluginTitle String
    The Kafka connector title.
    pluginType String
    The Kafka connector type.
    pluginVersion String
    The version of the kafka connector.
    tasks List<KafkaConnectorTask>
    List of tasks of a connector.
    id string
    The provider-assigned unique ID for this managed resource.
    pluginAuthor string
    The Kafka connector author.
    pluginClass string
    The Kafka connector Java class.
    pluginDocUrl string
    The Kafka connector documentation URL.
    pluginTitle string
    The Kafka connector title.
    pluginType string
    The Kafka connector type.
    pluginVersion string
    The version of the kafka connector.
    tasks KafkaConnectorTask[]
    List of tasks of a connector.
    id str
    The provider-assigned unique ID for this managed resource.
    plugin_author str
    The Kafka connector author.
    plugin_class str
    The Kafka connector Java class.
    plugin_doc_url str
    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[KafkaConnectorTask]
    List of tasks of a connector.
    id String
    The provider-assigned unique ID for this managed resource.
    pluginAuthor String
    The Kafka connector author.
    pluginClass String
    The Kafka connector Java class.
    pluginDocUrl String
    The Kafka connector documentation URL.
    pluginTitle String
    The Kafka connector title.
    pluginType String
    The Kafka connector type.
    pluginVersion 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.
    The following state arguments are supported:
    Config Dictionary<string, string>
    The Kafka Connector configuration parameters.
    ConnectorName string
    The kafka connector name. Changing this property forces recreation of the resource.
    PluginAuthor string
    The Kafka connector author.
    PluginClass string
    The Kafka connector Java class.
    PluginDocUrl string
    The Kafka connector documentation URL.
    PluginTitle string
    The Kafka connector title.
    PluginType string
    The Kafka connector type.
    PluginVersion string
    The version of the kafka connector.
    Project string
    Identifies 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.
    ServiceName string
    Specifies 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<KafkaConnectorTask>
    List of tasks of a connector.
    Config map[string]string
    The Kafka Connector configuration parameters.
    ConnectorName string
    The kafka connector name. Changing this property forces recreation of the resource.
    PluginAuthor string
    The Kafka connector author.
    PluginClass string
    The Kafka connector Java class.
    PluginDocUrl string
    The Kafka connector documentation URL.
    PluginTitle string
    The Kafka connector title.
    PluginType string
    The Kafka connector type.
    PluginVersion string
    The version of the kafka connector.
    Project string
    Identifies 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.
    ServiceName string
    Specifies 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 []KafkaConnectorTaskArgs
    List of tasks of a connector.
    config Map<String,String>
    The Kafka Connector configuration parameters.
    connectorName String
    The kafka connector name. Changing this property forces recreation of the resource.
    pluginAuthor String
    The Kafka connector author.
    pluginClass String
    The Kafka connector Java class.
    pluginDocUrl String
    The Kafka connector documentation URL.
    pluginTitle String
    The Kafka connector title.
    pluginType String
    The Kafka connector type.
    pluginVersion String
    The version of the kafka connector.
    project String
    Identifies 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.
    serviceName String
    Specifies 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<KafkaConnectorTask>
    List of tasks of a connector.
    config {[key: string]: string}
    The Kafka Connector configuration parameters.
    connectorName string
    The kafka connector name. Changing this property forces recreation of the resource.
    pluginAuthor string
    The Kafka connector author.
    pluginClass string
    The Kafka connector Java class.
    pluginDocUrl string
    The Kafka connector documentation URL.
    pluginTitle string
    The Kafka connector title.
    pluginType string
    The Kafka connector type.
    pluginVersion string
    The version of the kafka connector.
    project string
    Identifies 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.
    serviceName string
    Specifies 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 KafkaConnectorTask[]
    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.
    plugin_author str
    The Kafka connector author.
    plugin_class str
    The Kafka connector Java class.
    plugin_doc_url str
    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
    Identifies 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
    Specifies 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[KafkaConnectorTaskArgs]
    List of tasks of a connector.
    config Map<String>
    The Kafka Connector configuration parameters.
    connectorName String
    The kafka connector name. Changing this property forces recreation of the resource.
    pluginAuthor String
    The Kafka connector author.
    pluginClass String
    The Kafka connector Java class.
    pluginDocUrl String
    The Kafka connector documentation URL.
    pluginTitle String
    The Kafka connector title.
    pluginType String
    The Kafka connector type.
    pluginVersion String
    The version of the kafka connector.
    project String
    Identifies 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.
    serviceName String
    Specifies 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

    Connector string
    The name of the related connector.
    Task int
    The task id of the task.
    Connector string
    The name of the related connector.
    Task int
    The task id of the task.
    connector String
    The name of the related connector.
    task Integer
    The task id of the task.
    connector string
    The name of the related connector.
    task number
    The task id of the task.
    connector str
    The name of the related connector.
    task int
    The task id of the task.
    connector String
    The name of the related connector.
    task Number
    The task id of the task.

    Import

    $ pulumi import aiven:index/kafkaConnector:KafkaConnector kafka-os-con1 project/service_name/connector_name
    

    Package Details

    Repository
    Aiven pulumi/pulumi-aiven
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aiven Terraform Provider.
    aiven logo
    Aiven v6.13.0 published on Monday, Mar 25, 2024 by Pulumi