Skip to content

Resource: awsMskconnectConnector

Provides an Amazon MSK Connect Connector resource.

Example Usage

Basic configuration

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.mskconnectConnector.MskconnectConnector(this, "example", {
  capacity: {
    autoscaling: {
      maxWorkerCount: 2,
      mcuCount: 1,
      minWorkerCount: 1,
      scaleInPolicy: {
        cpuUtilizationPercentage: 20,
      },
      scaleOutPolicy: {
        cpuUtilizationPercentage: 80,
      },
    },
  },
  connectorConfiguration: {
    "connector.class":
      "com.github.jcustenborder.kafka.connect.simulator.SimulatorSinkConnector",
    "tasks.max": "1",
    topics: "example",
  },
  kafkaCluster: {
    apacheKafkaCluster: {
      bootstrapServers: "${aws_msk_cluster.example.bootstrap_brokers_tls}",
      vpc: {
        securityGroups: ["${aws_security_group.example.id}"],
        subnets: [
          "${aws_subnet.example1.id}",
          "${aws_subnet.example2.id}",
          "${aws_subnet.example3.id}",
        ],
      },
    },
  },
  kafkaClusterClientAuthentication: {
    authenticationType: "NONE",
  },
  kafkaClusterEncryptionInTransit: {
    encryptionType: "TLS",
  },
  kafkaconnectVersion: "2.7.1",
  name: "example",
  plugin: [
    {
      customPlugin: {
        arn: "${aws_mskconnect_custom_plugin.example.arn}",
        revision: "${aws_mskconnect_custom_plugin.example.latest_revision}",
      },
    },
  ],
  serviceExecutionRoleArn: "${aws_iam_role.example.arn}",
});

Argument Reference

The following arguments are supported:

  • capacity - (Required) Information about the capacity allocated to the connector. See below.
  • connectorConfiguration - (Required) A map of keys to values that represent the configuration for the connector.
  • description - (Optional) A summary description of the connector.
  • kafkaCluster - (Required) Specifies which Apache Kafka cluster to connect to. See below.
  • kafkaClusterClientAuthentication - (Required) Details of the client authentication used by the Apache Kafka cluster. See below.
  • kafkaClusterEncryptionInTransit - (Required) Details of encryption in transit to the Apache Kafka cluster. See below.
  • kafkaconnectVersion - (Required) The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.
  • logDelivery - (Optional) Details about log delivery. See below.
  • name - (Required) The name of the connector.
  • plugin - (Required) Specifies which plugins to use for the connector. See below.
  • serviceExecutionRoleArn - (Required) 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.
  • workerConfiguration - (Optional) Specifies which worker configuration to use with the connector. See below.

capacity Configuration Block

  • autoscaling - (Optional) Information about the auto scaling parameters for the connector. See below.
  • provisionedCapacity - (Optional) Details about a fixed capacity allocated to a connector. See below.

autoscaling Configuration Block

  • maxWorkerCount - (Required) The maximum number of workers allocated to the connector.
  • mcuCount - (Optional) The number of microcontroller units (MCUs) allocated to each connector worker. Valid values: 1, 2, 4, 8. The default value is 1.
  • minWorkerCount - (Required) The minimum number of workers allocated to the connector.
  • scaleInPolicy - (Optional) The scale-in policy for the connector. See below.
  • scaleOutPolicy - (Optional) The scale-out policy for the connector. See below.

scale_in_policy Configuration Block

  • cpuUtilizationPercentage - (Required) Specifies the CPU utilization percentage threshold at which you want connector scale in to be triggered.

scale_out_policy Configuration Block

  • cpuUtilizationPercentage - (Required) The CPU utilization percentage threshold at which you want connector scale out to be triggered.

provisioned_capacity Configuration Block

  • mcuCount - (Optional) The number of microcontroller units (MCUs) allocated to each connector worker. Valid values: 1, 2, 4, 8. The default value is 1.
  • workerCount - (Required) The number of workers that are allocated to the connector.

kafka_cluster Configuration Block

  • apacheKafkaCluster - (Required) The Apache Kafka cluster to which the connector is connected.

apache_kafka_cluster Configuration Block

  • bootstrapServers - (Required) The bootstrap servers of the cluster.
  • vpc - (Required) Details of an Amazon VPC which has network connectivity to the Apache Kafka cluster.

vpc Configuration Block

  • securityGroups - (Required) The security groups for the connector.
  • subnets - (Required) The subnets for the connector.

kafka_cluster_client_authentication Configuration Block

  • authenticationType - (Optional) The type of client authentication used to connect to the Apache Kafka cluster. Valid values: iam, none. A value of none means that no client authentication is used. The default value is none.

kafka_cluster_encryption_in_transit Configuration Block

  • encryptionType - (Optional) The type of encryption in transit to the Apache Kafka cluster. Valid values: plaintext, tls. The default values is plaintext.

log_delivery Configuration Block

  • workerLogDelivery - (Required) The workers can send worker logs to different destination types. This configuration specifies the details of these destinations. See below.

worker_log_delivery Configuration Block

  • cloudwatchLogs - (Optional) Details about delivering logs to Amazon CloudWatch Logs. See below.
  • firehose - (Optional) Details about delivering logs to Amazon Kinesis Data Firehose. See below.
  • s3 - (Optional) Details about delivering logs to Amazon S3. See below.

cloudwatch_logs Configuration Block

  • enabled - (Optional) Whether log delivery to Amazon CloudWatch Logs is enabled.
  • logGroup - (Required) The name of the CloudWatch log group that is the destination for log delivery.

firehose Configuration Block

  • deliveryStream - (Optional) The name of the Kinesis Data Firehose delivery stream that is the destination for log delivery.
  • enabled - (Required) Specifies whether connector logs get delivered to Amazon Kinesis Data Firehose.

s3 Configuration Block

  • bucket - (Optional) The name of the S3 bucket that is the destination for log delivery.
  • enabled - (Required) Specifies whether connector logs get sent to the specified Amazon S3 destination.
  • prefix - (Optional) The S3 prefix that is the destination for log delivery.

plugin Configuration Block

  • customPlugin - (Required) Details about a custom plugin. See below.

custom_plugin Configuration Block

  • arn - (Required) The Amazon Resource Name (ARN) of the custom plugin.
  • revision - (Required) The revision of the custom plugin.

worker_configuration Configuration Block

  • arn - (Required) The Amazon Resource Name (ARN) of the worker configuration.
  • revision - (Required) The revision of the worker configuration.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - The Amazon Resource Name (ARN) of the connector.
  • version - The current version of the connector.

Timeouts

Configuration options:

  • create - (Default 20M)
  • update - (Default 20M)
  • delete - (Default 10M)

Import

MSK Connect Connector can be imported using the connector's arn, e.g.,

$ terraform import aws_mskconnect_connector.example 'arn:aws:kafkaconnect:eu-central-1:123456789012:connector/example/264edee4-17a3-412e-bd76-6681cfc93805-3'