Skip to content

create_connector

create_connector(
    capacity: Capacity,
    connector_configuration: ConnectorConfiguration,
    connector_name: __stringMin1Max128,
    kafka_cluster: KafkaCluster,
    kafka_cluster_client_authentication: KafkaClusterClientAuthentication,
    kafka_cluster_encryption_in_transit: KafkaClusterEncryptionInTransit,
    kafka_connect_version: __string,
    plugins: __listOfPlugin,
    service_execution_role_arn: __string,
    *,
    config_overrides: Optional[KafkaConnectClientConfig] = None,
    connector_description: Optional[__stringMax1024] = None,
    log_delivery: Optional[LogDelivery] = None,
    network_type: Optional[NetworkType] = None,
    worker_configuration: Optional[WorkerConfiguration] = None,
    tags: Optional[Tags] = None,
) -> CreateConnectorResponse

Creates a connector using the specified properties.

Parameters:

  • capacity (Capacity) –

    Information about the capacity allocated to the connector. Exactly one of the two properties must be specified.

  • connector_configuration (ConnectorConfiguration) –

    A map of keys to values that represent the configuration for the connector.

  • connector_description (Optional[__stringMax1024], default: None ) –

    A summary description of the connector.

  • connector_name (__stringMin1Max128) –

    The name of the connector.

  • kafka_cluster (KafkaCluster) –

    Specifies which Apache Kafka cluster to connect to.

  • kafka_cluster_client_authentication (KafkaClusterClientAuthentication) –

    Details of the client authentication used by the Apache Kafka cluster.

  • kafka_cluster_encryption_in_transit (KafkaClusterEncryptionInTransit) –

    Details of encryption in transit to the Apache Kafka cluster.

  • kafka_connect_version (__string) –

    The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.

  • log_delivery (Optional[LogDelivery], default: None ) –

    Details about log delivery.

  • network_type (Optional[NetworkType], default: None ) –

    The network type of the connector. It gives connectors connectivity to either IPv4 (IPV4) or IPv4 and IPv6 (DUAL) destinations. Defaults to IPV4.

  • plugins (__listOfPlugin) –

    Amazon MSK Connect does not currently support specifying multiple plugins as a list. To use more than one plugin for your connector, you can create a single custom plugin using a ZIP file that bundles multiple plugins together.

    Specifies which plugin to use for the connector. You must specify a single-element list containing one customPlugin object.

  • service_execution_role_arn (__string) –

    The Amazon Resource Name (ARN) of the IAM role used by the connector to access the Amazon Web Services resources that it needs. The types of resources depends on the logic of the connector. For example, a connector that has Amazon S3 as a destination must have permissions that allow it to write to the S3 destination bucket.

  • worker_configuration (Optional[WorkerConfiguration], default: None ) –

    Specifies which worker configuration to use with the connector.

  • tags (Optional[Tags], default: None ) –

    The tags you want to attach to the connector.

Raises:

  • BadRequestException –

    HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it.

  • ConflictException –

    HTTP Status Code 409: Conflict. A resource with this name already exists. Retry your request with another name.

  • ForbiddenException –

    HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request.

  • InternalServerErrorException –

    HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue.

  • NotFoundException –

    HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it.

  • ServiceUnavailableException –

    HTTP Status Code 503: Service Unavailable. Retrying your request in some time might resolve the issue.

  • TooManyRequestsException –

    HTTP Status Code 429: Limit exceeded. Resource limit reached.

  • UnauthorizedException –

    HTTP Status Code 401: Unauthorized request. The provided credentials couldn't be validated.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_kafkaconnect/_services/kafka_connect.py
def create_connector(
    self,
    capacity: "capo_kafkaconnect.types.capacity.Capacity",
    connector_configuration: "capo_kafkaconnect.types.connector_configuration.ConnectorConfiguration",
    connector_name: "capo_kafkaconnect.types.__string_min1_max128.__stringMin1Max128",
    kafka_cluster: "capo_kafkaconnect.types.kafka_cluster.KafkaCluster",
    kafka_cluster_client_authentication: "capo_kafkaconnect.types.kafka_cluster_client_authentication.KafkaClusterClientAuthentication",
    kafka_cluster_encryption_in_transit: "capo_kafkaconnect.types.kafka_cluster_encryption_in_transit.KafkaClusterEncryptionInTransit",
    kafka_connect_version: "capo_kafkaconnect.types.__string.__string",
    plugins: "capo_kafkaconnect.types.__list_of_plugin.__listOfPlugin",
    service_execution_role_arn: "capo_kafkaconnect.types.__string.__string",
    *,
    config_overrides: Optional[KafkaConnectClientConfig] = None,
    connector_description: Optional[
        "capo_kafkaconnect.types.__string_max1024.__stringMax1024"
    ] = None,
    log_delivery: Optional[
        "capo_kafkaconnect.types.log_delivery.LogDelivery"
    ] = None,
    network_type: Optional[
        "capo_kafkaconnect.types.network_type.NetworkType"
    ] = None,
    worker_configuration: Optional[
        "capo_kafkaconnect.types.worker_configuration.WorkerConfiguration"
    ] = None,
    tags: Optional["capo_kafkaconnect.types.tags.Tags"] = None,
) -> "capo_kafkaconnect.types.create_connector_response.CreateConnectorResponse":
    """<p>Creates a connector using the specified properties. </p>

    Args:
        capacity: <p>Information about the capacity allocated to the connector. Exactly one of the two properties must be specified.</p>
        connector_configuration: <p>A map of keys to values that represent the configuration for the connector.</p>
        connector_description: <p>A summary description of the connector.</p>
        connector_name: <p>The name of the connector.</p>
        kafka_cluster: <p>Specifies which Apache Kafka cluster to connect to.</p>
        kafka_cluster_client_authentication: <p>Details of the client authentication used by the Apache Kafka cluster.</p>
        kafka_cluster_encryption_in_transit: <p>Details of encryption in transit to the Apache Kafka cluster.</p>
        kafka_connect_version: <p>The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.</p>
        log_delivery: <p>Details about log delivery.</p>
        network_type: <p>The network type of the connector. It gives connectors connectivity to either IPv4 (IPV4) or IPv4 and IPv6 (DUAL) destinations. Defaults to IPV4.</p>
        plugins: <important> <p>Amazon MSK Connect does not currently support specifying multiple plugins as a list. To use more than one plugin for your connector, you can create a single custom plugin using a ZIP file that bundles multiple plugins together.</p> </important> <p>Specifies which plugin to use for the connector. You must specify a single-element list containing one <code>customPlugin</code> object.</p>
        service_execution_role_arn: <p>The Amazon Resource Name (ARN) of the IAM role used by the connector to access the Amazon Web Services resources that it needs. The types of resources depends on the logic of the connector. For example, a connector that has Amazon S3 as a destination must have permissions that allow it to write to the S3 destination bucket.</p>
        worker_configuration: <p>Specifies which worker configuration to use with the connector.</p>
        tags: <p>The tags you want to attach to the connector.</p>

    Raises:
        capo_kafkaconnect.errors.bad_request_exception.BadRequestException: <p>HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it.</p>
        capo_kafkaconnect.errors.conflict_exception.ConflictException: <p>HTTP Status Code 409: Conflict. A resource with this name already exists. Retry your request with another name.</p>
        capo_kafkaconnect.errors.forbidden_exception.ForbiddenException: <p>HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request.</p>
        capo_kafkaconnect.errors.internal_server_error_exception.InternalServerErrorException: <p>HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue.</p>
        capo_kafkaconnect.errors.not_found_exception.NotFoundException: <p>HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it.</p>
        capo_kafkaconnect.errors.service_unavailable_exception.ServiceUnavailableException: <p>HTTP Status Code 503: Service Unavailable. Retrying your request in some time might resolve the issue.</p>
        capo_kafkaconnect.errors.too_many_requests_exception.TooManyRequestsException: <p>HTTP Status Code 429: Limit exceeded. Resource limit reached.</p>
        capo_kafkaconnect.errors.unauthorized_exception.UnauthorizedException: <p>HTTP Status Code 401: Unauthorized request. The provided credentials couldn't be validated.</p>
        capo_kafkaconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_kafkaconnect.types.create_connector_request.CreateConnectorRequest]",
    ) -> OperationResponse[
        "capo_kafkaconnect.types.create_connector_response.CreateConnectorResponse"
    ]:
        import capo_kafkaconnect._operations.kafka_connect.create_connector

        output, http_response = (
            capo_kafkaconnect._operations.kafka_connect.create_connector.create_connector(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_kafkaconnect.types.create_connector_request.CreateConnectorRequest",
    ) -> dict[str, Any]:
        import capo_kafkaconnect.types.create_connector_request

        return capo_kafkaconnect.types.create_connector_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateConnector", redact_input=_redact_input),
    )
    input_: capo_kafkaconnect.types.create_connector_request.CreateConnectorRequest = {
        "capacity": capacity,
        "connector_configuration": connector_configuration,
        "connector_name": connector_name,
        "kafka_cluster": kafka_cluster,
        "kafka_cluster_client_authentication": kafka_cluster_client_authentication,
        "kafka_cluster_encryption_in_transit": kafka_cluster_encryption_in_transit,
        "kafka_connect_version": kafka_connect_version,
        "plugins": plugins,
        "service_execution_role_arn": service_execution_role_arn,
    }
    if connector_description is not None:
        input_["connector_description"] = connector_description
    if log_delivery is not None:
        input_["log_delivery"] = log_delivery
    if network_type is not None:
        input_["network_type"] = network_type
    if worker_configuration is not None:
        input_["worker_configuration"] = worker_configuration
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output